summaryrefslogtreecommitdiff
path: root/cpufreq/src/cpufreq-applet.c
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2017-12-05 00:27:00 +0100
committerPablo Barciela <[email protected]>2017-12-05 01:11:03 +0100
commit9736a57f3a39d293daf30401a5ae8463a42b76e4 (patch)
treedd58f141d9d0c73f03fefb2054e17807eb617813 /cpufreq/src/cpufreq-applet.c
parent462cff94c554f3146c6fa7091bc3ff7765fb558a (diff)
downloadmate-applets-9736a57f3a39d293daf30401a5ae8463a42b76e4.tar.bz2
mate-applets-9736a57f3a39d293daf30401a5ae8463a42b76e4.tar.xz
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
Diffstat (limited to 'cpufreq/src/cpufreq-applet.c')
-rw-r--r--cpufreq/src/cpufreq-applet.c10
1 files changed, 3 insertions, 7 deletions
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 <gtk/gtk.h>
+#include <gdk/gdkx.h>
#include <gdk/gdkkeysyms.h>
#include <gio/gio.h>
#include <mate-panel-applet.h>
@@ -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;