Skip to content

fix: accurate mouse monitor detection on Wayland via GNOME Shell extension - #2349

Open
brandor5 wants to merge 1 commit into
Guake:masterfrom
brandor5:fix/wayland-mouse-monitor
Open

fix: accurate mouse monitor detection on Wayland via GNOME Shell extension#2349
brandor5 wants to merge 1 commit into
Guake:masterfrom
brandor5:fix/wayland-mouse-monitor

Conversation

@brandor5

@brandor5 brandor5 commented Sep 8, 2026

Copy link
Copy Markdown

On Wayland sessions, Guake runs as an XWayland client (GDK_BACKEND=x11).
GDK's pointer position only updates when the cursor hovers over another
XWayland window, causing 'appear on mouse display' to select the wrong
monitor when the cursor is over native Wayland apps or the desktop.

This adds a small GNOME Shell extension (guake-pointer-helper) that
queries Mutter's CursorTracker for the real Wayland cursor coordinates
and exposes them over a dedicated D-Bus interface. The existing
get_final_window_monitor() method now queries this interface on Wayland
sessions before falling back to the GDK pointer (which remains correct
on X11 sessions).

The extension is installed automatically by 'make install' to the
system-wide GNOME Shell extensions directory but must be enabled by
the user with:

gnome-extensions enable guake-pointer-helper@guake.org

A log warning is emitted on the first toggle if the extension is not
available on a Wayland session.

When the extension is not installed or not enabled, behavior is
unchanged from the current release (GDK fallback).

Tested on GNOME Shell 50.4 / Fedora 44 / Wayland with dual 2560x1440
screens

Fixes: #2121
Fixes: #2115
Refs: #1689
Co-authored-by: Cursor cursoragent@cursor.com

…nsion

On Wayland sessions, Guake runs as an XWayland client (GDK_BACKEND=x11).
GDK's pointer position only updates when the cursor hovers over another
XWayland window, causing 'appear on mouse display' to select the wrong
monitor when the cursor is over native Wayland apps or the desktop.

This adds a small GNOME Shell extension (guake-pointer-helper) that
queries Mutter's CursorTracker for the real Wayland cursor coordinates
and exposes them over a dedicated D-Bus interface. The existing
get_final_window_monitor() method now queries this interface on Wayland
sessions before falling back to the GDK pointer (which remains correct
on X11 sessions).

The extension is installed automatically by 'make install' to the
system-wide GNOME Shell extensions directory but must be enabled by
the user with:

    gnome-extensions enable guake-pointer-helper@guake.org

A log warning is emitted on the first toggle if the extension is not
available on a Wayland session.

When the extension is not installed or not enabled, behavior is
unchanged from the current release (GDK fallback).

Fixes: Guake#2121
Fixes: Guake#2115
Refs: Guake#1689
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Follow mouse" in multi monitor setup only works for certain windows Guake does not open on display with mouse in gnome

1 participant