summaryrefslogtreecommitdiff
path: root/cpufreq/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpufreq/src')
-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;