switcherPopup: Use MonitorConstraint instead of vfunc overrides
Instead of overriding vfunc_get_preferred_width|height(), use the already available Layout.MonitorConstraint to bind SwitcherPopup to the primary monitor.
This commit is contained in:
parent
a315e75e95
commit
0ec36fc5cf
@ -10,6 +10,7 @@ const Shell = imports.gi.Shell;
|
|||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
const St = imports.gi.St;
|
const St = imports.gi.St;
|
||||||
|
|
||||||
|
const Layout = imports.ui.layout;
|
||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
const Tweener = imports.ui.tweener;
|
const Tweener = imports.ui.tweener;
|
||||||
|
|
||||||
@ -63,21 +64,13 @@ var SwitcherPopup = new Lang.Class({
|
|||||||
this._initialDelayTimeoutId = 0;
|
this._initialDelayTimeoutId = 0;
|
||||||
this._noModsTimeoutId = 0;
|
this._noModsTimeoutId = 0;
|
||||||
|
|
||||||
|
this.add_constraint(new Layout.MonitorConstraint({ primary: true }));
|
||||||
|
|
||||||
// Initially disable hover so we ignore the enter-event if
|
// Initially disable hover so we ignore the enter-event if
|
||||||
// the switcher appears underneath the current pointer location
|
// the switcher appears underneath the current pointer location
|
||||||
this._disableHover();
|
this._disableHover();
|
||||||
},
|
},
|
||||||
|
|
||||||
vfunc_get_preferred_width(forHeight) {
|
|
||||||
let primary = Main.layoutManager.primaryMonitor;
|
|
||||||
return [primary.width, primary.width];
|
|
||||||
},
|
|
||||||
|
|
||||||
vfunc_get_preferred_height(forWidth) {
|
|
||||||
let primary = Main.layoutManager.primaryMonitor;
|
|
||||||
return [primary.height, primary.height];
|
|
||||||
},
|
|
||||||
|
|
||||||
vfunc_allocate(box, flags) {
|
vfunc_allocate(box, flags) {
|
||||||
this.set_allocation(box, flags);
|
this.set_allocation(box, flags);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user