Input: Send XI2 FocusOut NotifyPointer events to the pointer window.
This changes XInput 2's propagation of NotifyPointer focus out events to include the pointer window as well, similar to core events. This fixes a potential permanent focus in GDK when the focus moves to PointerRoot. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=93539 Signed-off-by: Andrew Comminos <andrew@comminos.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
984be789d5
commit
2fbf5c2f91
|
@ -1447,19 +1447,25 @@ DeviceFocusEvents(DeviceIntPtr dev, WindowPtr from, WindowPtr to, int mode)
|
||||||
|
|
||||||
if ((to == NullWindow) || (to == PointerRootWin)) {
|
if ((to == NullWindow) || (to == PointerRootWin)) {
|
||||||
if ((from == NullWindow) || (from == PointerRootWin)) {
|
if ((from == NullWindow) || (from == PointerRootWin)) {
|
||||||
if (from == PointerRootWin)
|
if (from == PointerRootWin) {
|
||||||
|
DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyPointer,
|
||||||
|
sprite->win);
|
||||||
DeviceFocusOutEvents(dev, sprite->win,
|
DeviceFocusOutEvents(dev, sprite->win,
|
||||||
GetCurrentRootWindow(dev), mode,
|
GetCurrentRootWindow(dev), mode,
|
||||||
NotifyPointer);
|
NotifyPointer);
|
||||||
|
}
|
||||||
/* Notify all the roots */
|
/* Notify all the roots */
|
||||||
for (i = 0; i < nscreens; i++)
|
for (i = 0; i < nscreens; i++)
|
||||||
DeviceFocusEvent(dev, XI_FocusOut, mode, out,
|
DeviceFocusEvent(dev, XI_FocusOut, mode, out,
|
||||||
screenInfo.screens[i]->root);
|
screenInfo.screens[i]->root);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (IsParent(from, sprite->win))
|
if (IsParent(from, sprite->win)) {
|
||||||
|
DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyPointer,
|
||||||
|
sprite->win);
|
||||||
DeviceFocusOutEvents(dev, sprite->win, from, mode,
|
DeviceFocusOutEvents(dev, sprite->win, from, mode,
|
||||||
NotifyPointer);
|
NotifyPointer);
|
||||||
|
}
|
||||||
DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyNonlinear, from);
|
DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyNonlinear, from);
|
||||||
/* next call catches the root too, if the screen changed */
|
/* next call catches the root too, if the screen changed */
|
||||||
DeviceFocusOutEvents(dev, from, NullWindow, mode,
|
DeviceFocusOutEvents(dev, from, NullWindow, mode,
|
||||||
|
@ -1477,10 +1483,13 @@ DeviceFocusEvents(DeviceIntPtr dev, WindowPtr from, WindowPtr to, int mode)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ((from == NullWindow) || (from == PointerRootWin)) {
|
if ((from == NullWindow) || (from == PointerRootWin)) {
|
||||||
if (from == PointerRootWin)
|
if (from == PointerRootWin) {
|
||||||
|
DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyPointer,
|
||||||
|
sprite->win);
|
||||||
DeviceFocusOutEvents(dev, sprite->win,
|
DeviceFocusOutEvents(dev, sprite->win,
|
||||||
GetCurrentRootWindow(dev), mode,
|
GetCurrentRootWindow(dev), mode,
|
||||||
NotifyPointer);
|
NotifyPointer);
|
||||||
|
}
|
||||||
for (i = 0; i < nscreens; i++)
|
for (i = 0; i < nscreens; i++)
|
||||||
DeviceFocusEvent(dev, XI_FocusOut, mode, out,
|
DeviceFocusEvent(dev, XI_FocusOut, mode, out,
|
||||||
screenInfo.screens[i]->root);
|
screenInfo.screens[i]->root);
|
||||||
|
@ -1507,9 +1516,12 @@ DeviceFocusEvents(DeviceIntPtr dev, WindowPtr from, WindowPtr to, int mode)
|
||||||
if ((IsParent(from, sprite->win)) &&
|
if ((IsParent(from, sprite->win)) &&
|
||||||
(sprite->win != from) &&
|
(sprite->win != from) &&
|
||||||
(!IsParent(to, sprite->win)) &&
|
(!IsParent(to, sprite->win)) &&
|
||||||
(!IsParent(sprite->win, to)))
|
(!IsParent(sprite->win, to))) {
|
||||||
|
DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyPointer,
|
||||||
|
sprite->win);
|
||||||
DeviceFocusOutEvents(dev, sprite->win, from, mode,
|
DeviceFocusOutEvents(dev, sprite->win, from, mode,
|
||||||
NotifyPointer);
|
NotifyPointer);
|
||||||
|
}
|
||||||
DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyInferior, from);
|
DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyInferior, from);
|
||||||
DeviceFocusInEvents(dev, from, to, mode, NotifyVirtual);
|
DeviceFocusInEvents(dev, from, to, mode, NotifyVirtual);
|
||||||
DeviceFocusEvent(dev, XI_FocusIn, mode, NotifyAncestor, to);
|
DeviceFocusEvent(dev, XI_FocusIn, mode, NotifyAncestor, to);
|
||||||
|
|
Loading…
Reference in New Issue