Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/steamcompmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1943,9 +1943,14 @@ void MouseCursor::paint(steamcompmgr_win_t *window, steamcompmgr_win_t *fit, str
cursorOffsetX = (currentOutputWidth - sourceWidth * currentScaleRatio_x) / 2.0f;
cursorOffsetY = (currentOutputHeight - sourceHeight * currentScaleRatio_y) / 2.0f;

// Actual point on scaled screen where the cursor hotspot should be
scaledX = (winX - window->GetGeometry().nX) * currentScaleRatio_x + cursorOffsetX;
scaledY = (winY - window->GetGeometry().nY) * currentScaleRatio_y + cursorOffsetY;
// Actual point on scaled screen where the cursor hotspot should be.
// Compositing ignores the focused window's X11 origin, so the cursor
// must also ignore it to stay consistent with the composited output.
bool isFocusWindow = (window == m_ctx->focus.focusWindow);
int32_t winOriginX = isFocusWindow ? 0 : window->GetGeometry().nX;
int32_t winOriginY = isFocusWindow ? 0 : window->GetGeometry().nY;
scaledX = (winX - winOriginX) * currentScaleRatio_x + cursorOffsetX;
scaledY = (winY - winOriginY) * currentScaleRatio_y + cursorOffsetY;

if ( zoomScaleRatio != 1.0 )
{
Expand Down Expand Up @@ -3956,9 +3961,6 @@ void xwayland_ctx_t::DetermineAndApplyFocus( const std::vector< steamcompmgr_win
ctx->focus.focusWindow->nudged = true;
}

if (w->GetGeometry().nX != 0 || w->GetGeometry().nY != 0)
XMoveWindow(ctx->dpy, ctx->focus.focusWindow->xwayland().id, 0, 0);

if ( win_has_game_id( w ) )
{
if ( window_is_fullscreen( ctx->focus.focusWindow ) || ctx->force_windows_fullscreen )
Expand Down