Merge lp:~azzar1/nautilus/higidpi-desktop-view-margins into lp:~ubuntu-desktop/nautilus/ubuntu

Proposed by Andrea Azzarone on 2016-08-01
Status: Needs review
Proposed branch: lp:~azzar1/nautilus/higidpi-desktop-view-margins
Merge into: lp:~ubuntu-desktop/nautilus/ubuntu
Diff against target: 71 lines (+51/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/hidpi_desktop_view_margins.patch (+43/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~azzar1/nautilus/higidpi-desktop-view-margins
Reviewer Review Type Date Requested Status
VCS imports 2016-08-01 Pending
Review via email: mp+301621@code.launchpad.net

This proposal supersedes a proposal from 2016-08-01.

Commit Message

* debian/patches/hidpi_desktop_view_margins.patch:
  - scale desktop workarea margins.

To post a comment you must log in.

Unmerged revisions

513. By Andrea Azzarone on 2016-07-29

* debian/patches/hidpi_desktop_view_margins.patch:
  - scale desktop workarea margins.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2016-07-21 13:45:02 +0000
3+++ debian/changelog 2016-08-01 08:31:23 +0000
4@@ -1,3 +1,10 @@
5+nautilus (1:3.18.4.is.3.14.3-0ubuntu6) UNRELEASED; urgency=medium
6+
7+ * debian/patches/hidpi_desktop_view_margins.patch:
8+ - scale desktop workarea margins.
9+
10+ -- Andrea Azzarone <andrea.azzarone@canonical.com> Fri, 29 Jul 2016 21:55:44 +0200
11+
12 nautilus (1:3.18.4.is.3.14.3-0ubuntu5) UNRELEASED; urgency=medium
13
14 [ Iain Lane ]
15
16=== added file 'debian/patches/hidpi_desktop_view_margins.patch'
17--- debian/patches/hidpi_desktop_view_margins.patch 1970-01-01 00:00:00 +0000
18+++ debian/patches/hidpi_desktop_view_margins.patch 2016-08-01 08:31:23 +0000
19@@ -0,0 +1,43 @@
20+Description: desktop-canvas-view: scale desktop workarea
21+
22+The problem is that in the function canvas_container_set_workarea the screen
23+width and height are in "application pixels" while the workarea ones are in
24+"device pixels" so when the scaling is > 1, the margins are not properly set.
25+We need to scale-down the workarea geometries to "application pixels".
26+
27+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/1564375
28+Bug: https://bugzilla.gnome.org/show_bug.cgi?id=769302
29+Forwarded: yes
30+Author: Andrea Azzarone <andrea.azzarone@canonical.com>
31+
32+Index: nautilus-3.18.4.is.3.14.3/src/nautilus-desktop-canvas-view.c
33+===================================================================
34+--- nautilus-3.18.4.is.3.14.3.orig/src/nautilus-desktop-canvas-view.c
35++++ nautilus-3.18.4.is.3.14.3/src/nautilus-desktop-canvas-view.c
36+@@ -101,6 +101,7 @@ canvas_container_set_workarea (NautilusC
37+ {
38+ int left, right, top, bottom;
39+ int screen_width, screen_height;
40++ int scale;
41+ int i;
42+
43+ left = right = top = bottom = 0;
44+@@ -108,11 +109,14 @@ canvas_container_set_workarea (NautilusC
45+ screen_width = gdk_screen_get_width (screen);
46+ screen_height = gdk_screen_get_height (screen);
47+
48++ scale = gdk_window_get_scale_factor (gdk_screen_get_root_window (screen));
49++ scale = scale ? scale : 1;
50++
51+ for (i = 0; i < n_items; i += 4) {
52+- int x = workareas [i];
53+- int y = workareas [i + 1];
54+- int width = workareas [i + 2];
55+- int height = workareas [i + 3];
56++ int x = workareas [i] / scale;
57++ int y = workareas [i + 1] / scale;
58++ int width = workareas [i + 2] / scale;
59++ int height = workareas [i + 3] / scale;
60+
61+ if ((x + width) > screen_width || (y + height) > screen_height)
62+ continue;
63
64=== modified file 'debian/patches/series'
65--- debian/patches/series 2016-07-21 13:45:02 +0000
66+++ debian/patches/series 2016-08-01 08:31:23 +0000
67@@ -41,3 +41,4 @@
68 0001-desktop-window-restore-transparency.patch
69 0002-desktop-window-restore-transparency-again.patch
70 git_hover_hidebar.patch
71+hidpi_desktop_view_margins.patch

Subscribers

People subscribed via source and target branches

to all changes: