~tintou/gala/hidpi

« back to all changes in this revision

Viewing changes to src/Widgets/WorkspaceClone.vala

  • Committer: felescoto95 at hotmail
  • Date: 2016-11-13 16:00:48 UTC
  • Revision ID: felescoto95@hotmail.com-20161113160048-1832k1t725dc55m0
WorkspaceClone: Fixed changing resolution breaking Multitasking View

Show diffs side-by-side

added added

removed removed

Lines of Context:
136
136
 
137
137
                        window_container = new WindowCloneContainer ();
138
138
                        window_container.window_selected.connect ((w) => { window_selected (w); });
139
 
                        window_container.width = monitor_geometry.width;
140
 
                        window_container.height = monitor_geometry.height;
 
139
                        window_container.set_size (monitor_geometry.width, monitor_geometry.height);
141
140
                        screen.restacked.connect (window_container.restack_windows);
142
141
 
143
142
                        icon_group = new IconGroup (workspace);
249
248
                                remove_window (window);
250
249
                }
251
250
 
 
251
                void update_size (Meta.Rectangle monitor_geometry)
 
252
                {
 
253
                        if (window_container.width != monitor_geometry.width || window_container.height != monitor_geometry.height) {
 
254
                                window_container.set_size (monitor_geometry.width, monitor_geometry.height);
 
255
                                background.set_size (window_container.width, window_container.height);
 
256
                        }
 
257
                }
 
258
 
252
259
                /**
253
260
                 * Utility function to shrink a MetaRectangle on all sides for the given amount.
254
261
                 * Negative amounts will scale it instead.
282
289
                        var monitor = screen.get_monitor_geometry (screen.get_primary_monitor ());
283
290
                        var scale = (float)(monitor.height - TOP_OFFSET - BOTTOM_OFFSET) / monitor.height;
284
291
                        var pivotY = TOP_OFFSET / (monitor.height - monitor.height * scale);
 
292
 
 
293
                        update_size (monitor);
 
294
 
285
295
                        background.set_pivot_point (0.5f, pivotY);
286
296
 
287
297
                        background.save_easing_state ();