[libwnck] core: Remove usage of gdk_display_get_default() in screen.c



commit 458454795054aea966036adb0e7eac435f2513db
Author: Vincent Untz <vuntz gnome org>
Date:   Fri Feb 18 19:15:08 2011 +0100

    core: Remove usage of gdk_display_get_default() in screen.c

 libwnck/screen.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/libwnck/screen.c b/libwnck/screen.c
index 96d34fb..1c456e0 100644
--- a/libwnck/screen.c
+++ b/libwnck/screen.c
@@ -906,10 +906,17 @@ wnck_screen_get_windows_stacked (WnckScreen *screen)
 GdkScreen *
 _wnck_screen_get_gdk_screen (WnckScreen *screen)
 {
+  Display    *display;
+  GdkDisplay *gdkdisplay;
+
   g_return_val_if_fail (WNCK_IS_SCREEN (screen), NULL);
 
-  return gdk_display_get_screen (gdk_display_get_default (),
-				 screen->priv->number);
+  display = DisplayOfScreen (screen->priv->xscreen);
+  gdkdisplay = _wnck_gdk_display_lookup_from_display (display);
+  if (!gdkdisplay)
+    return NULL;
+
+  return gdk_display_get_screen (gdkdisplay, screen->priv->number);
 }
 
 /**



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]