summaryrefslogtreecommitdiff
path: root/src/nautilus-desktop-canvas-view.c
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2013-03-19 19:25:37 -0400
committerCosimo Cecchi <cosimoc@gnome.org>2013-03-19 19:30:49 -0400
commit6f6fcf1b4e99c8a5186c78e911a159b1f06df7b0 (patch)
treea473c273382a9515d0d354e4b7efbac55a9ea755 /src/nautilus-desktop-canvas-view.c
parent4d9128837b03ddfc3e027fbb19ceae6378142915 (diff)
downloadnautilus-6f6fcf1b4e99c8a5186c78e911a159b1f06df7b0.tar.gz
Revert "desktop-canvas: set margins according to the primary workarea"
This fix proved to be more problematic than the original bug, so we'll revert to the original behavior for now. This reverts commit 1292610b87be44fcd5a7d5a09738cd7f3287325f. https://bugzilla.gnome.org/show_bug.cgi?id=695336
Diffstat (limited to 'src/nautilus-desktop-canvas-view.c')
-rw-r--r--src/nautilus-desktop-canvas-view.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/nautilus-desktop-canvas-view.c b/src/nautilus-desktop-canvas-view.c
index fb7513988..75287ec28 100644
--- a/src/nautilus-desktop-canvas-view.c
+++ b/src/nautilus-desktop-canvas-view.c
@@ -99,27 +99,27 @@ canvas_container_set_workarea (NautilusCanvasContainer *canvas_container,
int n_items)
{
int left, right, top, bottom;
+ int screen_width, screen_height;
int i;
- GdkRectangle geometry;
left = right = top = bottom = 0;
- gdk_screen_get_monitor_geometry (screen, gdk_screen_get_primary_monitor (screen), &geometry);
- for (i = 0; i < n_items; i += 4) {
- GdkRectangle workarea;
+ screen_width = gdk_screen_get_width (screen);
+ screen_height = gdk_screen_get_height (screen);
- workarea.x = workareas[i];
- workarea.y = workareas[i + 1];
- workarea.width = workareas[i + 2];
- workarea.height = workareas[i + 3];
+ for (i = 0; i < n_items; i += 4) {
+ int x = workareas [i];
+ int y = workareas [i + 1];
+ int width = workareas [i + 2];
+ int height = workareas [i + 3];
- if (!gdk_rectangle_intersect (&geometry, &workarea, &workarea))
+ if ((x + width) > screen_width || (y + height) > screen_height)
continue;
- left = MAX (left, workarea.x);
- right = MAX (right, (geometry.x + geometry.width) - (workarea.x + workarea.width));
- top = MAX (top, workarea.y);
- bottom = MAX (bottom, (geometry.y + geometry.height) - (workarea.y + workarea.height));
+ left = MAX (left, x);
+ right = MAX (right, screen_width - width - x);
+ top = MAX (top, y);
+ bottom = MAX (bottom, screen_height - height - y);
}
nautilus_canvas_container_set_margins (canvas_container,