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 --- cpufreq/src/cpufreq-applet.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'cpufreq/src') diff --git a/cpufreq/src/cpufreq-applet.c b/cpufreq/src/cpufreq-applet.c index 1b7e4b71..33812df2 100644 --- a/cpufreq/src/cpufreq-applet.c +++ b/cpufreq/src/cpufreq-applet.c @@ -24,6 +24,7 @@ #endif #include +#include #include #include #include @@ -415,8 +416,6 @@ cpufreq_applet_popup_position_menu (GtkMenu *menu, GtkAllocation allocation; gint menu_xpos; gint menu_ypos; - gint sc_width; - gint sc_height; widget = GTK_WIDGET (gdata); @@ -426,23 +425,20 @@ cpufreq_applet_popup_position_menu (GtkMenu *menu, gtk_widget_get_allocation (widget, &allocation); - gdk_window_get_geometry (gdk_screen_get_root_window (gtk_widget_get_screen (widget)), NULL, NULL, - &sc_width, &sc_height); - menu_xpos += allocation.x; menu_ypos += allocation.y; switch (mate_panel_applet_get_orient (MATE_PANEL_APPLET (widget))) { case MATE_PANEL_APPLET_ORIENT_DOWN: case MATE_PANEL_APPLET_ORIENT_UP: - if (menu_ypos > sc_height / 2) + if (menu_ypos > HeightOfScreen (gdk_x11_screen_get_xscreen (gtk_widget_get_screen (widget))) / 2) menu_ypos -= requisition.height; else menu_ypos += allocation.height; break; case MATE_PANEL_APPLET_ORIENT_RIGHT: case MATE_PANEL_APPLET_ORIENT_LEFT: - if (menu_xpos > sc_width / 2) + if (menu_xpos > WidthOfScreen (gdk_x11_screen_get_xscreen (gtk_widget_get_screen (widget))) / 2) menu_xpos -= requisition.width; else menu_xpos += allocation.width; -- cgit v1.2.1