summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2022-03-16 13:04:21 +0100
committerLuke from DC <[email protected]>2022-03-18 05:45:32 +0000
commit9befec030d2f7252541bf1ca84d2fe56e093ff8f (patch)
tree5a5d4057bf11f4341019dcca634f9fb40505e3b0
parent01c6f4fef3e8522728fafee5392489e62b910dc9 (diff)
downloadmate-panel-9befec030d2f7252541bf1ca84d2fe56e093ff8f.tar.bz2
mate-panel-9befec030d2f7252541bf1ca84d2fe56e093ff8f.tar.xz
wncklet: Condition 'sdd->wnck_screen!=NULL' is always false
-rw-r--r--applets/wncklet/showdesktop.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/applets/wncklet/showdesktop.c b/applets/wncklet/showdesktop.c
index d500db13..190077f1 100644
--- a/applets/wncklet/showdesktop.c
+++ b/applets/wncklet/showdesktop.c
@@ -370,15 +370,20 @@ static void show_desktop_applet_realized(MatePanelApplet* applet, gpointer data)
#ifdef HAVE_X11
if (GDK_IS_X11_DISPLAY (gdk_display_get_default ()))
- sdd->wnck_screen = wnck_screen_get(gdk_x11_screen_get_screen_number (screen));
+ {
+ sdd->wnck_screen = wnck_screen_get (gdk_x11_screen_get_screen_number (screen));
+ if (sdd->wnck_screen != NULL)
+ wncklet_connect_while_alive (sdd->wnck_screen,
+ "showing_desktop_changed",
+ G_CALLBACK (show_desktop_changed_callback),
+ sdd,
+ sdd->applet);
+ else
+ g_warning ("Could not get WnckScreen!");
+ }
#endif /* HAVE_X11 */
- if (sdd->wnck_screen != NULL)
- wncklet_connect_while_alive(sdd->wnck_screen, "showing_desktop_changed", G_CALLBACK(show_desktop_changed_callback), sdd, sdd->applet);
- else
- g_warning("Could not get WnckScreen!");
-
- show_desktop_changed_callback(sdd->wnck_screen, sdd);
+ show_desktop_changed_callback (sdd->wnck_screen, sdd);
sdd->icon_theme = gtk_icon_theme_get_for_screen (screen);
wncklet_connect_while_alive(sdd->icon_theme, "changed", G_CALLBACK(theme_changed_callback), sdd, sdd->applet);