From 030e6aa507643d1b2b8771748b943cd4581830c8 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Sat, 2 Mar 2013 00:00:59 +0100 Subject: [PATCH] Fix overview sizing with multimonitor Previously, the overview BoxLayout was sized and positioned explicitly using the primary monitor coordinates, as its parent was at 0,0 and with a fixed layout manager. Now we use a bin layout, so we need to position and size the stack actor, and set the overview boxlayout to expand. Take also the occasion to use a MonitorConstraint instead of handling position and size manually. https://bugzilla.gnome.org/show_bug.cgi?id=694969 --- js/ui/overview.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js/ui/overview.js b/js/ui/overview.js index 3ee87fa0b..6f236081d 100644 --- a/js/ui/overview.js +++ b/js/ui/overview.js @@ -13,6 +13,7 @@ const Gdk = imports.gi.Gdk; const Background = imports.ui.background; const Dash = imports.ui.dash; const DND = imports.ui.dnd; +const LayoutManager = imports.ui.layout; const Main = imports.ui.main; const MessageTray = imports.ui.messageTray; const OverviewControls = imports.ui.overviewControls; @@ -120,13 +121,16 @@ const Overview = new Lang.Class({ let layout = new Clutter.BinLayout(); this._stack = new Clutter.Actor({ layout_manager: layout }); + this._stack.add_constraint(new LayoutManager.MonitorConstraint({ primary: true })); /* Translators: This is the main view to select activities. See also note for "Activities" string. */ this._overview = new St.BoxLayout({ name: 'overview', accessible_name: _("Overview"), reactive: true, - vertical: true }); + vertical: true, + x_expand: true, + y_expand: true }); this._overview._delegate = this; this._groupStack = new St.Widget({ layout_manager: new Clutter.BinLayout(), @@ -442,12 +446,8 @@ const Overview = new Lang.Class({ // when it is next shown. this.hide(); - let primary = Main.layoutManager.primaryMonitor; let workArea = Main.layoutManager.getWorkAreaForMonitor(Main.layoutManager.primaryIndex); - this._overview.set_position(primary.x, primary.y); - this._overview.set_size(primary.width, primary.height); - this._coverPane.set_position(0, workArea.y); this._coverPane.set_size(workArea.width, workArea.height);