summaryrefslogtreecommitdiff
path: root/libmate-desktop
diff options
context:
space:
mode:
Diffstat (limited to 'libmate-desktop')
-rw-r--r--libmate-desktop/mate-bg.c12
-rw-r--r--libmate-desktop/mate-colorsel.c9
-rw-r--r--libmate-desktop/mate-rr-labeler.c5
3 files changed, 18 insertions, 8 deletions
diff --git a/libmate-desktop/mate-bg.c b/libmate-desktop/mate-bg.c
index 36198f9..fa38a99 100644
--- a/libmate-desktop/mate-bg.c
+++ b/libmate-desktop/mate-bg.c
@@ -1463,8 +1463,8 @@ mate_bg_get_surface_from_root (GdkScreen *screen)
gdk_error_trap_pop_ignored ();
}
- width = gdk_screen_get_width (screen);
- height = gdk_screen_get_height (screen);
+ gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL,
+ &width, &height);
if (source_pixmap) {
surface = cairo_surface_create_similar (source_pixmap,
@@ -2109,10 +2109,14 @@ scale_thumbnail (MateBGPlacement placement,
if (get_thumb_annotations (thumb, &o_width, &o_height) ||
(filename && get_original_size (filename, &o_width, &o_height))) {
- int scr_height = gdk_screen_get_height (screen);
- int scr_width = gdk_screen_get_width (screen);
+ int scr_height;
+ int scr_width;
int thumb_width = gdk_pixbuf_get_width (thumb);
int thumb_height = gdk_pixbuf_get_height (thumb);
+
+ gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL,
+ &scr_width, &scr_height);
+
double screen_to_dest = fit_factor (scr_width, scr_height,
dest_width, dest_height);
double thumb_to_orig = fit_factor (thumb_width, thumb_height,
diff --git a/libmate-desktop/mate-colorsel.c b/libmate-desktop/mate-colorsel.c
index 7382c17..cea7d3b 100644
--- a/libmate-desktop/mate-colorsel.c
+++ b/libmate-desktop/mate-colorsel.c
@@ -1306,6 +1306,7 @@ popup_position_func (GtkMenu *menu,
GtkRequisition req;
gint root_x, root_y;
GdkScreen *screen;
+ gint sc_width, sc_height;
GtkAllocation allocation;
widget = GTK_WIDGET (user_data);
@@ -1323,8 +1324,12 @@ popup_position_func (GtkMenu *menu,
/* Ensure sanity */
screen = gtk_widget_get_screen (widget);
- *x = CLAMP (*x, 0, MAX (0, gdk_screen_get_width (screen) - req.width));
- *y = CLAMP (*y, 0, MAX (0, gdk_screen_get_height (screen) - req.height));
+
+ gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL,
+ &sc_width, &sc_height);
+
+ *x = CLAMP (*x, 0, MAX (0, sc_width - req.width));
+ *y = CLAMP (*y, 0, MAX (0, sc_height - req.height));
}
static void
diff --git a/libmate-desktop/mate-rr-labeler.c b/libmate-desktop/mate-rr-labeler.c
index de65423..72b9585 100644
--- a/libmate-desktop/mate-rr-labeler.c
+++ b/libmate-desktop/mate-rr-labeler.c
@@ -121,8 +121,9 @@ get_work_area (MateRRLabeler *labeler,
/* Defaults in case of error */
rect->x = 0;
rect->y = 0;
- rect->width = gdk_screen_get_width (labeler->priv->screen);
- rect->height = gdk_screen_get_height (labeler->priv->screen);
+
+ gdk_window_get_geometry (gdk_screen_get_root_window (labeler->priv->screen), NULL, NULL,
+ &rect->width, &rect->height);
if (workarea == None)
return FALSE;