steamcompmgr: Add GAMESCOPE_CURSOR_VISIBLE_FEEDBACK
This commit is contained in:
parent
122ba3dda9
commit
7f2db65c00
3 changed files with 35 additions and 2 deletions
|
@ -900,6 +900,7 @@ MouseCursor::MouseCursor(xwayland_ctx_t *ctx)
|
||||||
{
|
{
|
||||||
m_lastX = g_nNestedWidth / 2;
|
m_lastX = g_nNestedWidth / 2;
|
||||||
m_lastY = g_nNestedHeight / 2;
|
m_lastY = g_nNestedHeight / 2;
|
||||||
|
updateCursorFeedback( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
void MouseCursor::queryPositions(int &rootX, int &rootY, int &winX, int &winY)
|
void MouseCursor::queryPositions(int &rootX, int &rootY, int &winX, int &winY)
|
||||||
|
@ -973,6 +974,8 @@ void MouseCursor::checkSuspension()
|
||||||
nudge_steamcompmgr();
|
nudge_steamcompmgr();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateCursorFeedback();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MouseCursor::warp(int x, int y)
|
void MouseCursor::warp(int x, int y)
|
||||||
|
@ -1162,6 +1165,7 @@ void MouseCursor::move(int x, int y)
|
||||||
XWarpPointer(m_ctx->dpy, None, x11_win(m_ctx->focus.inputFocusWindow), 0, 0, 0, 0, m_lastX, m_lastY);
|
XWarpPointer(m_ctx->dpy, None, x11_win(m_ctx->focus.inputFocusWindow), 0, 0, 0, 0, m_lastX, m_lastY);
|
||||||
}
|
}
|
||||||
m_hideForMovement = false;
|
m_hideForMovement = false;
|
||||||
|
updateCursorFeedback();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MouseCursor::updatePosition()
|
void MouseCursor::updatePosition()
|
||||||
|
@ -1235,8 +1239,10 @@ bool MouseCursor::getTexture()
|
||||||
}
|
}
|
||||||
|
|
||||||
m_dirty = false;
|
m_dirty = false;
|
||||||
|
updateCursorFeedback();
|
||||||
|
|
||||||
if (m_imageEmpty) {
|
if (m_imageEmpty) {
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1257,7 +1263,7 @@ bool MouseCursor::getTexture()
|
||||||
|
|
||||||
void MouseCursor::paint(win *window, win *fit, struct FrameInfo_t *frameInfo)
|
void MouseCursor::paint(win *window, win *fit, struct FrameInfo_t *frameInfo)
|
||||||
{
|
{
|
||||||
if (m_hideForMovement || m_imageEmpty) {
|
if ( m_hideForMovement || m_imageEmpty ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1334,6 +1340,25 @@ void MouseCursor::paint(win *window, win *fit, struct FrameInfo_t *frameInfo)
|
||||||
layer->blackBorder = false;
|
layer->blackBorder = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MouseCursor::updateCursorFeedback( bool bForce )
|
||||||
|
{
|
||||||
|
// Can't resolve this until cursor is un-dirtied.
|
||||||
|
if ( m_dirty && !bForce )
|
||||||
|
return;
|
||||||
|
|
||||||
|
bool bVisible = !isHidden();
|
||||||
|
|
||||||
|
if ( m_bCursorVisibleFeedback == bVisible && !bForce )
|
||||||
|
return;
|
||||||
|
|
||||||
|
uint32_t value = bVisible ? 1 : 0;
|
||||||
|
|
||||||
|
XChangeProperty(m_ctx->dpy, m_ctx->root, m_ctx->atoms.gamescopeCursorVisibleFeedback, XA_CARDINAL, 32, PropModeReplace,
|
||||||
|
(unsigned char *)&value, 1 );
|
||||||
|
|
||||||
|
m_bCursorVisibleFeedback = bVisible;
|
||||||
|
}
|
||||||
|
|
||||||
struct BaseLayerInfo_t
|
struct BaseLayerInfo_t
|
||||||
{
|
{
|
||||||
float scale[2];
|
float scale[2];
|
||||||
|
@ -5158,6 +5183,8 @@ void init_xwayland_ctx(gamescope_xwayland_server_t *xwayland_server)
|
||||||
ctx->atoms.gamescopeDisplayIsExternal = XInternAtom( ctx->dpy, "GAMESCOPE_DISPLAY_IS_EXTERNAL", false );
|
ctx->atoms.gamescopeDisplayIsExternal = XInternAtom( ctx->dpy, "GAMESCOPE_DISPLAY_IS_EXTERNAL", false );
|
||||||
ctx->atoms.gamescopeDisplayModeListExternal = XInternAtom( ctx->dpy, "GAMESCOPE_DISPLAY_MODE_LIST_EXTERNAL", false );
|
ctx->atoms.gamescopeDisplayModeListExternal = XInternAtom( ctx->dpy, "GAMESCOPE_DISPLAY_MODE_LIST_EXTERNAL", false );
|
||||||
|
|
||||||
|
ctx->atoms.gamescopeCursorVisibleFeedback = XInternAtom( ctx->dpy, "GAMESCOPE_CURSOR_VISIBLE_FEEDBACK", false );
|
||||||
|
|
||||||
ctx->atoms.wineHwndStyle = XInternAtom( ctx->dpy, "_WINE_HWND_STYLE", false );
|
ctx->atoms.wineHwndStyle = XInternAtom( ctx->dpy, "_WINE_HWND_STYLE", false );
|
||||||
ctx->atoms.wineHwndStyleEx = XInternAtom( ctx->dpy, "_WINE_HWND_EXSTYLE", false );
|
ctx->atoms.wineHwndStyleEx = XInternAtom( ctx->dpy, "_WINE_HWND_EXSTYLE", false );
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ public:
|
||||||
|
|
||||||
void hide() { m_lastMovedTime = 0; checkSuspension(); }
|
void hide() { m_lastMovedTime = 0; checkSuspension(); }
|
||||||
|
|
||||||
bool isHidden() { return m_hideForMovement; }
|
bool isHidden() { return m_hideForMovement || m_imageEmpty; }
|
||||||
|
|
||||||
void forcePosition(int x, int y)
|
void forcePosition(int x, int y)
|
||||||
{
|
{
|
||||||
|
@ -77,6 +77,8 @@ private:
|
||||||
|
|
||||||
bool getTexture();
|
bool getTexture();
|
||||||
|
|
||||||
|
void updateCursorFeedback( bool bForce = false );
|
||||||
|
|
||||||
int m_x = 0, m_y = 0;
|
int m_x = 0, m_y = 0;
|
||||||
int m_hotspotX = 0, m_hotspotY = 0;
|
int m_hotspotX = 0, m_hotspotY = 0;
|
||||||
|
|
||||||
|
@ -93,6 +95,8 @@ private:
|
||||||
|
|
||||||
int m_lastX = 0;
|
int m_lastX = 0;
|
||||||
int m_lastY = 0;
|
int m_lastY = 0;
|
||||||
|
|
||||||
|
bool m_bCursorVisibleFeedback = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern std::vector< wlr_surface * > wayland_surfaces_deleted;
|
extern std::vector< wlr_surface * > wayland_surfaces_deleted;
|
||||||
|
|
|
@ -153,6 +153,8 @@ struct xwayland_ctx_t
|
||||||
Atom gamescopeDisplayIsExternal;
|
Atom gamescopeDisplayIsExternal;
|
||||||
Atom gamescopeDisplayModeListExternal;
|
Atom gamescopeDisplayModeListExternal;
|
||||||
|
|
||||||
|
Atom gamescopeCursorVisibleFeedback;
|
||||||
|
|
||||||
Atom wineHwndStyle;
|
Atom wineHwndStyle;
|
||||||
Atom wineHwndStyleEx;
|
Atom wineHwndStyleEx;
|
||||||
} atoms;
|
} atoms;
|
||||||
|
|
Loading…
Reference in a new issue