Merge lp:~philip.scott/gala/resolution-multitasking-fix into lp:gala

Proposed by Felipe Escoto
Status: Merged
Merged at revision: 543
Proposed branch: lp:~philip.scott/gala/resolution-multitasking-fix
Merge into: lp:gala
Diff against target: 53 lines (+16/-2)
2 files modified
src/Background/BackgroundManager.vala (+4/-0)
src/Widgets/WorkspaceClone.vala (+12/-2)
To merge this branch: bzr merge lp:~philip.scott/gala/resolution-multitasking-fix
Reviewer Review Type Date Requested Status
Rico Tzschichholz Approve
Adam Bieńkowski (community) code / testing Approve
Review via email: mp+310706@code.launchpad.net

Commit message

Fix: Changing resolution breaking Multitasking View

Description of the change

Changing the screen's resolution breaks the multitasking view. This branch fixes that by resizing the views if the resolution has changed

To post a comment you must log in.
Revision history for this message
Adam Bieńkowski (donadigo) wrote :

Works for me.

review: Approve (code / testing)
543. By Felipe Escoto

WorkspaceClone: Fixed changing resolution breaking Multitasking View

Revision history for this message
Rico Tzschichholz (ricotz) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Background/BackgroundManager.vala'
2--- src/Background/BackgroundManager.vala 2016-05-12 15:30:20 +0000
3+++ src/Background/BackgroundManager.vala 2016-11-13 16:01:25 +0000
4@@ -118,6 +118,10 @@
5 background.set_data<ulong> ("background-loaded-handler", handler);
6 }
7
8+ public void set_size (float width, float height) {
9+ background_actor.set_size (width, height);
10+ }
11+
12 Meta.BackgroundActor create_background_actor ()
13 {
14 var background = background_source.get_background (monitor_index);
15
16=== modified file 'src/Widgets/WorkspaceClone.vala'
17--- src/Widgets/WorkspaceClone.vala 2016-02-16 18:05:29 +0000
18+++ src/Widgets/WorkspaceClone.vala 2016-11-13 16:01:25 +0000
19@@ -136,8 +136,7 @@
20
21 window_container = new WindowCloneContainer ();
22 window_container.window_selected.connect ((w) => { window_selected (w); });
23- window_container.width = monitor_geometry.width;
24- window_container.height = monitor_geometry.height;
25+ window_container.set_size (monitor_geometry.width, monitor_geometry.height);
26 screen.restacked.connect (window_container.restack_windows);
27
28 icon_group = new IconGroup (workspace);
29@@ -249,6 +248,14 @@
30 remove_window (window);
31 }
32
33+ void update_size (Meta.Rectangle monitor_geometry)
34+ {
35+ if (window_container.width != monitor_geometry.width || window_container.height != monitor_geometry.height) {
36+ window_container.set_size (monitor_geometry.width, monitor_geometry.height);
37+ background.set_size (window_container.width, window_container.height);
38+ }
39+ }
40+
41 /**
42 * Utility function to shrink a MetaRectangle on all sides for the given amount.
43 * Negative amounts will scale it instead.
44@@ -282,6 +289,9 @@
45 var monitor = screen.get_monitor_geometry (screen.get_primary_monitor ());
46 var scale = (float)(monitor.height - TOP_OFFSET - BOTTOM_OFFSET) / monitor.height;
47 var pivotY = TOP_OFFSET / (monitor.height - monitor.height * scale);
48+
49+ update_size (monitor);
50+
51 background.set_pivot_point (0.5f, pivotY);
52
53 background.save_easing_state ();

Subscribers

People subscribed via source and target branches