diff --git a/thunar/thunar-application.c b/thunar/thunar-application.c index 363783a0fc8c8268d316ba488330771d0b002b60..0004a78f78bd440903a8b678e5ced631a3e8103f 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 4305d02b31d006f00dc255288428b7c630cef884..833030380b8407eb6d6c72dab43e360197f45c86 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 8cd38850d64a1c9d4878e5d37172b41c26d76d70..be516bb59f47d369befb742498327ba75307f90d 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__ */