Commit f8b017fa authored by Benjamin Otte's avatar Benjamin Otte

x11: Simplify code for single-screen case

parent b3158686
...@@ -450,7 +450,7 @@ gdk_x11_device_core_window_at_position (GdkDevice *device, ...@@ -450,7 +450,7 @@ gdk_x11_device_core_window_at_position (GdkDevice *device,
} }
else else
{ {
gint i, screens, width, height; gint width, height;
GList *toplevels, *list; GList *toplevels, *list;
Window pointer_window, root, child; Window pointer_window, root, child;
int rootx = -1, rooty = -1; int rootx = -1, rooty = -1;
...@@ -459,11 +459,7 @@ gdk_x11_device_core_window_at_position (GdkDevice *device, ...@@ -459,11 +459,7 @@ gdk_x11_device_core_window_at_position (GdkDevice *device,
/* FIXME: untrusted clients case not multidevice-safe */ /* FIXME: untrusted clients case not multidevice-safe */
pointer_window = None; pointer_window = None;
screens = gdk_display_get_n_screens (display); screen = gdk_display_get_screen (display, 0);
for (i = 0; i < screens; ++i)
{
screen = gdk_display_get_screen (display, i);
toplevels = gdk_screen_get_toplevel_windows (screen); toplevels = gdk_screen_get_toplevel_windows (screen);
for (list = toplevels; list != NULL; list = g_list_next (list)) for (list = toplevels; list != NULL; list = g_list_next (list))
{ {
...@@ -508,9 +504,6 @@ gdk_x11_device_core_window_at_position (GdkDevice *device, ...@@ -508,9 +504,6 @@ gdk_x11_device_core_window_at_position (GdkDevice *device,
} }
g_list_free (toplevels); g_list_free (toplevels);
if (pointer_window != None)
break;
}
xwindow = pointer_window; xwindow = pointer_window;
} }
......
...@@ -512,17 +512,14 @@ gdk_x11_device_xi2_window_at_position (GdkDevice *device, ...@@ -512,17 +512,14 @@ gdk_x11_device_xi2_window_at_position (GdkDevice *device,
} }
else else
{ {
gint i, screens, width, height; gint width, height;
GList *toplevels, *list; GList *toplevels, *list;
Window pointer_window, root, child; Window pointer_window, root, child;
/* FIXME: untrusted clients case not multidevice-safe */ /* FIXME: untrusted clients case not multidevice-safe */
pointer_window = None; pointer_window = None;
screens = gdk_display_get_n_screens (display);
for (i = 0; i < screens; ++i) screen = gdk_display_get_screen (display, 0);
{
screen = gdk_display_get_screen (display, i);
toplevels = gdk_screen_get_toplevel_windows (screen); toplevels = gdk_screen_get_toplevel_windows (screen);
for (list = toplevels; list != NULL; list = g_list_next (list)) for (list = toplevels; list != NULL; list = g_list_next (list))
{ {
...@@ -578,7 +575,6 @@ gdk_x11_device_xi2_window_at_position (GdkDevice *device, ...@@ -578,7 +575,6 @@ gdk_x11_device_xi2_window_at_position (GdkDevice *device,
break; break;
} }
} }
}
g_list_free (toplevels); g_list_free (toplevels);
if (pointer_window != None) if (pointer_window != None)
......
...@@ -478,12 +478,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, ...@@ -478,12 +478,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
if (xevent->type == DestroyNotify && !is_substructure) if (xevent->type == DestroyNotify && !is_substructure)
{ {
int i, n; screen = GDK_X11_DISPLAY (display)->screen;
n = gdk_display_get_n_screens (display);
for (i = 0; i < n; i++)
{
screen = gdk_display_get_screen (display, i);
x11_screen = GDK_X11_SCREEN (screen); x11_screen = GDK_X11_SCREEN (screen);
if (x11_screen->wmspec_check_window == xevent->xdestroywindow.window) if (x11_screen->wmspec_check_window == xevent->xdestroywindow.window)
...@@ -500,7 +495,6 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, ...@@ -500,7 +495,6 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
goto done; goto done;
} }
} }
}
/* We do a "manual" conversion of the XEvent to a /* We do a "manual" conversion of the XEvent to a
* GdkEvent. The structures are mostly the same so * GdkEvent. The structures are mostly the same so
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment