diff options
| author | Victor Kareh <[email protected]> | 2025-09-04 11:14:18 -0400 |
|---|---|---|
| committer | lukefromdc <[email protected]> | 2025-10-19 16:24:30 -0400 |
| commit | 359d832e89d43f095463c81acd90b4c59176f17d (patch) | |
| tree | 1cd0bc306a0cac0f5abc04491b9769a36e8536f8 /src | |
| parent | 037e2094fe5ce1757a4796e7e3ea40c241462b6d (diff) | |
| download | mate-notification-daemon-359d832e89d43f095463c81acd90b4c59176f17d.tar.bz2 mate-notification-daemon-359d832e89d43f095463c81acd90b4c59176f17d.tar.xz | |
daemon: Bump libwnck to 43.0
Recent versions of libwnck introduced a WnckHandler object to be used as
the main entry point into the library.
Diffstat (limited to 'src')
| -rw-r--r-- | src/daemon/daemon.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c index 2064c46..b863758 100644 --- a/src/daemon/daemon.c +++ b/src/daemon/daemon.c @@ -1183,22 +1183,29 @@ static gboolean screensaver_active(GtkWidget* nw) #ifdef HAVE_X11 static gboolean fullscreen_window_exists(GtkWidget* nw) { + WnckHandle* wnck_handle; WnckScreen* wnck_screen; WnckWorkspace* wnck_workspace; GList* l; + gboolean retval = FALSE; g_return_val_if_fail (GDK_IS_X11_DISPLAY (gdk_display_get_default ()), FALSE); - wnck_screen = wnck_screen_get (GDK_SCREEN_XNUMBER (gdk_window_get_screen (gtk_widget_get_window (nw)))); + wnck_handle = wnck_handle_new (WNCK_CLIENT_TYPE_APPLICATION); + + g_return_val_if_fail (WNCK_IS_HANDLE (wnck_handle), FALSE); + + wnck_screen = wnck_handle_get_screen (wnck_handle, GDK_SCREEN_XNUMBER (gdk_window_get_screen (gtk_widget_get_window (nw)))); + + if (!wnck_screen) + goto cleanup; wnck_screen_force_update (wnck_screen); wnck_workspace = wnck_screen_get_active_workspace (wnck_screen); if (!wnck_workspace) - { - return FALSE; - } + goto cleanup; for (l = wnck_screen_get_windows_stacked (wnck_screen); l != NULL; l = l->next) { @@ -1219,12 +1226,15 @@ static gboolean fullscreen_window_exists(GtkWidget* nw) if (sw == w && sh == h) { - return TRUE; + retval = TRUE; + goto cleanup; } } } - return FALSE; +cleanup: + g_clear_object (&wnck_handle); + return retval; } static Window get_window_parent(GdkDisplay* display, Window window, Window* root) |
