mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 12:50:04 +01:00
Merge branch 'master' into 'master'
xwayland: prevent X11 get enter event when pointer is over Wayland client Closes #1818 See merge request xorg/xserver!2112
This commit is contained in:
commit
240d47a772
2 changed files with 10 additions and 3 deletions
|
|
@ -527,6 +527,7 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer,
|
||||||
int sx, sy;
|
int sx, sy;
|
||||||
int dx, dy;
|
int dx, dy;
|
||||||
ScreenPtr pScreen = xwl_screen->screen;
|
ScreenPtr pScreen = xwl_screen->screen;
|
||||||
|
xwl_seat->pointer_enter_count++;
|
||||||
ValuatorMask mask;
|
ValuatorMask mask;
|
||||||
DeviceEvent enter;
|
DeviceEvent enter;
|
||||||
|
|
||||||
|
|
@ -621,6 +622,9 @@ pointer_handle_leave(void *data, struct wl_pointer *pointer,
|
||||||
Bool focus_lost = FALSE;
|
Bool focus_lost = FALSE;
|
||||||
|
|
||||||
xwl_screen->serial = serial;
|
xwl_screen->serial = serial;
|
||||||
|
BUG_WARN(xwl_seat->pointer_enter_count == 0);
|
||||||
|
if (xwl_seat->pointer_enter_count > 0)
|
||||||
|
xwl_seat->pointer_enter_count--;
|
||||||
|
|
||||||
/* The pointer has left a known xwindow, save it for a possible match
|
/* The pointer has left a known xwindow, save it for a possible match
|
||||||
* in sprite_check_lost_focus()
|
* in sprite_check_lost_focus()
|
||||||
|
|
@ -3226,6 +3230,7 @@ sprite_check_lost_focus(SpritePtr sprite, WindowPtr window)
|
||||||
{
|
{
|
||||||
DeviceIntPtr device, master;
|
DeviceIntPtr device, master;
|
||||||
struct xwl_seat *xwl_seat;
|
struct xwl_seat *xwl_seat;
|
||||||
|
Bool pointer_crossing;
|
||||||
|
|
||||||
for (device = inputInfo.devices; device; device = device->next) {
|
for (device = inputInfo.devices; device; device = device->next) {
|
||||||
/* Ignore non-wayland devices */
|
/* Ignore non-wayland devices */
|
||||||
|
|
@ -3241,16 +3246,17 @@ sprite_check_lost_focus(SpritePtr sprite, WindowPtr window)
|
||||||
if (!xwl_seat)
|
if (!xwl_seat)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
pointer_crossing = (xwl_seat->pointer_enter_count > 0);
|
||||||
master = GetMaster(device, POINTER_OR_FLOAT);
|
master = GetMaster(device, POINTER_OR_FLOAT);
|
||||||
if (!master || !master->lastSlave)
|
if (!master || !master->lastSlave)
|
||||||
return FALSE;
|
return !pointer_crossing;
|
||||||
|
|
||||||
/* We do want the last active slave, we only check on slave xwayland
|
/* We do want the last active slave, we only check on slave xwayland
|
||||||
* devices so we can find out the xwl_seat, but those don't actually own
|
* devices so we can find out the xwl_seat, but those don't actually own
|
||||||
* their sprite, so the match doesn't mean a lot.
|
* their sprite, so the match doesn't mean a lot.
|
||||||
*/
|
*/
|
||||||
if (master->lastSlave != get_pointer_device(xwl_seat))
|
if (master->lastSlave != get_pointer_device(xwl_seat))
|
||||||
return FALSE;
|
return !pointer_crossing;
|
||||||
|
|
||||||
/* If we left the surface with a button down, it means the wayland compositor
|
/* If we left the surface with a button down, it means the wayland compositor
|
||||||
* has grabbed the pointer so we will not get button release events from the
|
* has grabbed the pointer so we will not get button release events from the
|
||||||
|
|
@ -3272,7 +3278,7 @@ sprite_check_lost_focus(SpritePtr sprite, WindowPtr window)
|
||||||
IsParent(xwl_seat->last_focus_window->toplevel, window)))
|
IsParent(xwl_seat->last_focus_window->toplevel, window)))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
return FALSE;
|
return !pointer_crossing;
|
||||||
}
|
}
|
||||||
|
|
||||||
static WindowPtr
|
static WindowPtr
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,7 @@ struct xwl_seat {
|
||||||
struct xwl_window *tablet_focus_window;
|
struct xwl_window *tablet_focus_window;
|
||||||
uint32_t id;
|
uint32_t id;
|
||||||
uint32_t pointer_enter_serial;
|
uint32_t pointer_enter_serial;
|
||||||
|
uint8_t pointer_enter_count;
|
||||||
struct xorg_list link;
|
struct xorg_list link;
|
||||||
CursorPtr x_cursor;
|
CursorPtr x_cursor;
|
||||||
OsTimerPtr x_cursor_timer;
|
OsTimerPtr x_cursor_timer;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue