From 9736a57f3a39d293daf30401a5ae8463a42b76e4 Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Tue, 5 Dec 2017 00:27:00 +0100 Subject: WidthOfScreen and HeightOfScreen implementation This commit reverts: https://github.com/mate-desktop/mate-applets/commit/d809e57c7b09f545f1cf847f514fa738d44ac2b3 https://github.com/mate-desktop/mate-applets/commit/2f5515815c1f6c9b66f85d6ec228aad7aea0b441 And it applies an alternative to fix the deprecated functions: gdk_screen_get_width gdk_screen_get_height gdk_screen_width gdk_screen_height --- stickynotes/stickynotes_applet.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'stickynotes') diff --git a/stickynotes/stickynotes_applet.c b/stickynotes/stickynotes_applet.c index 2f1b4b76..c7c88ac2 100644 --- a/stickynotes/stickynotes_applet.c +++ b/stickynotes/stickynotes_applet.c @@ -24,6 +24,7 @@ #include "stickynotes.h" #include +#include StickyNotes *stickynotes = NULL; @@ -154,8 +155,6 @@ stickynotes_destroy (GtkWidget *widget, void stickynotes_applet_init (MatePanelApplet *mate_panel_applet) { - gint sc_height; - stickynotes = g_new(StickyNotes, 1); stickynotes->notes = NULL; @@ -191,10 +190,7 @@ stickynotes_applet_init (MatePanelApplet *mate_panel_applet) G_CALLBACK (preferences_apply_cb), NULL); /* Max height for large notes*/ - gdk_window_get_geometry (gdk_screen_get_root_window (gdk_screen_get_default()), NULL, NULL, - NULL, &sc_height); - - stickynotes->max_height = 0.8 * sc_height; + stickynotes->max_height = 0.8 * HeightOfScreen (gdk_x11_screen_get_xscreen (gdk_screen_get_default ())); /* Load sticky notes */ stickynotes_load (gtk_widget_get_screen (GTK_WIDGET (mate_panel_applet))); -- cgit v1.2.1