[gnome-control-center] background: Fix preview when primary is not the leftmost
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] background: Fix preview when primary is not the leftmost
- Date: Thu, 27 Sep 2012 23:52:25 +0000 (UTC)
commit 97af01b56f7fdbb979e4484c8c38a8d08935b9fb
Author: Bastien Nocera <hadess hadess net>
Date: Fri Sep 28 01:31:02 2012 +0200
background: Fix preview when primary is not the leftmost
https://bugzilla.gnome.org/show_bug.cgi?id=684985
panels/background/cc-background-panel.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/panels/background/cc-background-panel.c b/panels/background/cc-background-panel.c
index e8d16a1..5e5ec57 100644
--- a/panels/background/cc-background-panel.c
+++ b/panels/background/cc-background-panel.c
@@ -227,6 +227,7 @@ on_screenshot_finished (GObject *source,
CcBackgroundPanelPrivate *priv = panel->priv;
GError *error;
GdkRectangle rect;
+ GdkRectangle workarea_rect;
GtkWidget *widget;
GdkPixbuf *pixbuf;
cairo_surface_t *surface;
@@ -269,11 +270,12 @@ on_screenshot_finished (GObject *source,
/* clear the workarea */
widget = WID ("background-desktop-drawingarea");
primary = gdk_screen_get_primary_monitor (gtk_widget_get_screen (widget));
- gdk_screen_get_monitor_workarea (gtk_widget_get_screen (widget), primary, &rect);
+ gdk_screen_get_monitor_geometry (gtk_widget_get_screen (widget), primary, &rect);
+ gdk_screen_get_monitor_workarea (gtk_widget_get_screen (widget), primary, &workarea_rect);
cairo_save (cr);
cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
- cairo_rectangle (cr, rect.x, rect.y, rect.width, rect.height);
+ cairo_rectangle (cr, workarea_rect.x - rect.x, workarea_rect.y - rect.y, rect.width, rect.height);
cairo_fill (cr);
cairo_restore (cr);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]