mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 03:50:11 +02:00
Filter LeaveNotify based on window under pointer
Instead of ignoring all `NonlinearVirtual` events. This lets us release focus when instantly moving the mouse from a plugin GUI to something else. This generates `NonlinearVirtual` event, and previously we ignored those because that also happens when opening a dropdown menu in a TDR plugin (which uses popup windows instead of actual dropdowns).
This commit is contained in:
@@ -262,6 +262,18 @@ class Editor {
|
||||
const bool use_xembed;
|
||||
|
||||
private:
|
||||
/**
|
||||
* Get the current cursor position, in Win32 screen coordinates. This is
|
||||
* needed for our `LeaveNotify` handling because `GetCursorPos()` only
|
||||
* updates once every 100 ms. This takes the X11 mouse cursor position, and
|
||||
* then adds to that the difference between `wine_window`'s X11 coordinates
|
||||
* and its Win32 coordinates. This is kind of a workaround for Wine's
|
||||
* X11drv's `root_to_virtual_screen()` function not being exposed.
|
||||
*
|
||||
* If we cannot obtain the X11 cursor position, then this returns a nullopt.
|
||||
*/
|
||||
std::optional<POINT> get_current_pointer_position() const;
|
||||
|
||||
/**
|
||||
* Returns `true` if the currently active window (as per
|
||||
* `_NET_ACTIVE_WINDOW`) contains `wine_window`. If the window manager does
|
||||
|
||||
Reference in New Issue
Block a user