diff options
author | lukefromdc <[email protected]> | 2024-11-22 02:42:18 -0500 |
---|---|---|
committer | Luke from DC <[email protected]> | 2024-11-27 03:49:44 +0000 |
commit | 1b84051f61bb578d1e33563f4443b861d3486300 (patch) | |
tree | 3af8f6d6b2e10adf9cd8970b434438f131ecb0cc | |
parent | 03bbe996c3d79461c89cac9e578b6ad01d1dcef9 (diff) | |
download | mate-applets-1b84051f61bb578d1e33563f4443b861d3486300.tar.bz2 mate-applets-1b84051f61bb578d1e33563f4443b861d3486300.tar.xz |
Compute screen height properly when not in X11
Don't use that value uninitialized
-rw-r--r-- | stickynotes/stickynotes_applet.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/stickynotes/stickynotes_applet.c b/stickynotes/stickynotes_applet.c index d88709da..0fb9b6a9 100644 --- a/stickynotes/stickynotes_applet.c +++ b/stickynotes/stickynotes_applet.c @@ -219,6 +219,16 @@ stickynotes_applet_init (MatePanelApplet *mate_panel_applet) #ifdef GDK_WINDOWING_X11 if (GDK_IS_X11_DISPLAY (gdk_screen_get_display (screen))) screen_height = HeightOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale; + + else + { + /*No root window or primary monitor in wayland unless compositors add it back*/ + GdkRectangle geometry = {0}; + GdkMonitor *monitor; + monitor = gdk_display_get_monitor (gdk_screen_get_display (screen), 0); + gdk_monitor_get_geometry (monitor, &geometry); + screen_height = geometry.height; + } #endif stickynotes->max_height = (int) (0.8 * (double) screen_height); |