Merge branch 'window-activate-grab-4-again' into 'master'

gdk: activate surface on keyboard grabs

Closes #85

See merge request GNOME/gtk!174
This commit is contained in:
Matthias Clasen 2018-06-18 11:36:09 +00:00
commit 5a319f66af
2 changed files with 8 additions and 8 deletions

View File

@ -31,8 +31,8 @@
#define HAS_FOCUS(toplevel) \
((toplevel)->has_focus_window || (toplevel)->has_pointer_focus)
#define APPEARS_FOCUSED(toplevel) \
((toplevel)->has_focus || (toplevel)->has_focus_window || (toplevel)->has_pointer_focus)
static void gdk_x11_device_manager_core_finalize (GObject *object);
static void gdk_x11_device_manager_core_constructed (GObject *object);
@ -822,7 +822,7 @@ _gdk_device_manager_core_handle_focus (GdkSurface *surface,
if (toplevel->focus_window == original)
return;
had_focus = HAS_FOCUS (toplevel);
had_focus = APPEARS_FOCUSED (toplevel);
x11_screen = GDK_X11_SCREEN (GDK_SURFACE_SCREEN (surface));
switch (detail)
@ -884,7 +884,7 @@ _gdk_device_manager_core_handle_focus (GdkSurface *surface,
break;
}
if (HAS_FOCUS (toplevel) != had_focus)
if (APPEARS_FOCUSED (toplevel) != had_focus)
{
GdkEvent *event;

View File

@ -36,8 +36,8 @@ static void gdk_event_source_finalize (GSource *source);
static GQuark quark_needs_enter = 0;
#define HAS_FOCUS(toplevel) \
((toplevel)->has_focus_window || (toplevel)->has_pointer_focus)
#define APPEARS_FOCUSED(toplevel) \
((toplevel)->has_focus || (toplevel)->has_focus_window || (toplevel)->has_pointer_focus)
struct _GdkEventSource
{
@ -108,10 +108,10 @@ handle_focus_change (GdkEventCrossing *event)
if (!event->focus || toplevel->has_focus_window)
return;
had_focus = HAS_FOCUS (toplevel);
had_focus = APPEARS_FOCUSED (toplevel);
toplevel->has_pointer_focus = focus_in;
if (HAS_FOCUS (toplevel) != had_focus)
if (APPEARS_FOCUSED (toplevel) != had_focus)
{
GdkEvent *focus_event;