[Xfce4-commits] <thunar:use-libxfce4ui> Use the gdk extension from libxfce4ui.

Nick Schermer noreply at xfce.org
Sat Oct 17 18:26:04 CEST 2009


Updating branch refs/heads/nick/use-libxfce4ui
         to def5565565c641964bcae4bf14be275f2fecd5c6 (commit)
       from 8990efaf5a89afa3a47b9358b57aa0ffad64eff0 (commit)

commit def5565565c641964bcae4bf14be275f2fecd5c6
Author: Nick Schermer <nick at xfce.org>
Date:   Sat Oct 17 18:24:15 2009 +0200

    Use the gdk extension from libxfce4ui.

 thunar/thunar-application.c    |    6 ++-
 thunar/thunar-gdk-extensions.c |   62 ----------------------------------------
 thunar/thunar-gdk-extensions.h |    2 -
 3 files changed, 4 insertions(+), 66 deletions(-)

diff --git a/thunar/thunar-application.c b/thunar/thunar-application.c
index 363783a..0004a78 100644
--- a/thunar/thunar-application.c
+++ b/thunar/thunar-application.c
@@ -36,6 +36,8 @@
 #include <time.h>
 #endif
 
+#include <libxfce4ui/libxfce4ui.h>
+
 #include <thunar/thunar-application.h>
 #include <thunar/thunar-browser.h>
 #include <thunar/thunar-dialogs.h>
@@ -563,7 +565,7 @@ thunar_application_drive_eject (GVolumeMonitor    *volume_monitor,
       argv[3] = NULL;
 
       /* locate the currently active screen (the one with the pointer) */
-      screen = thunar_gdk_screen_get_active ();
+      screen = xfce_gdk_screen_get_active (NULL);
 
       /* try to spawn the volume_monitor on the active screen */
       if (!gdk_spawn_on_screen (screen, NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &err))
@@ -614,7 +616,7 @@ thunar_application_volman_idle (gpointer user_data)
           application->volman_udis = g_slist_delete_link (application->volman_udis, application->volman_udis);
 
           /* locate the currently active screen (the one with the pointer) */
-          screen = thunar_gdk_screen_get_active ();
+          screen = xfce_gdk_screen_get_active (NULL);
 
           /* try to spawn the volman on the active screen */
           if (gdk_spawn_on_screen (screen, NULL, argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH, NULL, NULL, &pid, &err))
diff --git a/thunar/thunar-gdk-extensions.c b/thunar/thunar-gdk-extensions.c
index 4305d02..8330303 100644
--- a/thunar/thunar-gdk-extensions.c
+++ b/thunar/thunar-gdk-extensions.c
@@ -37,10 +37,6 @@
 #include <thunar/thunar-gdk-extensions.h>
 #include <thunar/thunar-private.h>
 
-#if defined(GDK_WINDOWING_X11)
-#include <gdk/gdkx.h>
-#endif
-
 
 
 /**
@@ -132,61 +128,3 @@ thunar_gdk_screen_open (const gchar *display_name,
 
   return screen;
 }
-
-
-
-/**
- * thunar_gdk_screen_get_active:
- *
- * Returns the currently active #GdkScreen, that is the
- * screen, which currently contains the pointer.
- *
- * Return value: the currently active #GdkScreen.
- **/
-GdkScreen*
-thunar_gdk_screen_get_active (void)
-{
-#if defined(GDK_WINDOWING_X11)
-  GdkScreen *screen;
-  Window     child;
-	Window     root;
-  GSList    *displays;
-  GSList    *lp;
-	guint      xmask;
-	gint       rootx, rooty;
-	gint       winx, winy;
-  gint       n;
-
-  /* determine the list of active displays */
-  displays = gdk_display_manager_list_displays (gdk_display_manager_get ());
-  for (lp = displays; lp != NULL; lp = lp->next)
-    {
-      /* check all screens on this display */
-      for (n = 0; n < gdk_display_get_n_screens (lp->data); ++n)
-        {
-          /* check if this screen contains the pointer */
-          screen = gdk_display_get_screen (lp->data, n);
-          if (XQueryPointer (GDK_SCREEN_XDISPLAY (screen),
-                             GDK_DRAWABLE_XID (gdk_screen_get_root_window (screen)),
-                             &root, &child, &rootx, &rooty, &winx, &winy, &xmask))
-            {
-              /* yap, this screen contains the pointer, hence it's the active screen */
-              goto out;
-            }
-        }
-    }
-
-  /* fallback to the default screen */
-  screen = gdk_screen_get_default ();
-
-out:
-  /* release the displays */
-  g_slist_free (displays);
-  return screen;
-#else
-  /* dunno what to do on non-X11 window systems */
-  return gdk_screen_get_default ();
-#endif
-}
-
-
diff --git a/thunar/thunar-gdk-extensions.h b/thunar/thunar-gdk-extensions.h
index 8cd3885..be516bb 100644
--- a/thunar/thunar-gdk-extensions.h
+++ b/thunar/thunar-gdk-extensions.h
@@ -27,8 +27,6 @@ G_BEGIN_DECLS;
 GdkScreen *thunar_gdk_screen_open       (const gchar *display_name,
                                          GError     **error);
 
-GdkScreen *thunar_gdk_screen_get_active (void);
-
 G_END_DECLS;
 
 #endif /* !__THUNAR_GDK_EXTENSIONS_H__ */



More information about the Xfce4-commits mailing list