summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/menu.c9
-rw-r--r--src/ui/tabpopup.c5
2 files changed, 5 insertions, 9 deletions
diff --git a/src/ui/menu.c b/src/ui/menu.c
index d066ffcb..1bea9232 100644
--- a/src/ui/menu.c
+++ b/src/ui/menu.c
@@ -21,6 +21,7 @@
* 02110-1301, USA.
*/
+#include <gdk/gdkx.h>
#include <config.h>
#include <stdio.h>
#include <string.h>
@@ -103,7 +104,6 @@ static void popup_position_func(GtkMenu* menu, gint* x, gint* y, gboolean* push_
{
GtkRequisition req;
GdkPoint* pos;
- int sc_width, sc_height;
pos = user_data;
@@ -117,12 +117,9 @@ static void popup_position_func(GtkMenu* menu, gint* x, gint* y, gboolean* push_
*x = MAX (0, *x - req.width);
}
- gdk_window_get_geometry (gdk_screen_get_root_window (gdk_screen_get_default()),
- NULL, NULL, &sc_width, &sc_height);
-
/* Ensure onscreen */
- *x = CLAMP (*x, 0, MAX(0, sc_width - req.width));
- *y = CLAMP (*y, 0, MAX(0, sc_height - req.height));
+ *x = CLAMP (*x, 0, MAX(0, WidthOfScreen (gdk_x11_screen_get_xscreen (gdk_screen_get_default ())) - req.width));
+ *y = CLAMP (*y, 0, MAX(0, HeightOfScreen (gdk_x11_screen_get_xscreen (gdk_screen_get_default ())) - req.height));
}
static void menu_closed(GtkMenu* widget, gpointer data)
diff --git a/src/ui/tabpopup.c b/src/ui/tabpopup.c
index f3d64733..f3d14240 100644
--- a/src/ui/tabpopup.c
+++ b/src/ui/tabpopup.c
@@ -34,6 +34,7 @@
#include "../core/frame-private.h"
#include "draw-workspace.h"
#include <gtk/gtk.h>
+#include <gdk/gdkx.h>
#include <math.h>
#define OUTSIDE_SELECT_RECT 2
@@ -259,9 +260,7 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries,
popup->current_selected_entry = NULL;
popup->border = border;
- gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL,
- &screen_width, NULL);
-
+ screen_width = WidthOfScreen (gdk_x11_screen_get_xscreen (screen));
for (i = 0; i < entry_count; ++i)
{
TabEntry* new_entry = tab_entry_new (&entries[i], screen_width,