[gnome-shell/gbsneto/remove-generic-container: 2/28] switcherPopup: Use MonitorConstraint instead of vfunc overrides
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gbsneto/remove-generic-container: 2/28] switcherPopup: Use MonitorConstraint instead of vfunc overrides
- Date: Fri, 5 Oct 2018 22:27:31 +0000 (UTC)
commit 335de41422e0131b5af697e2ad29c36efc466863
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Thu Aug 23 13:35:43 2018 -0300
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.
js/ui/switcherPopup.js | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
---
diff --git a/js/ui/switcherPopup.js b/js/ui/switcherPopup.js
index 4b1d89e76..ad77787cf 100644
--- a/js/ui/switcherPopup.js
+++ b/js/ui/switcherPopup.js
@@ -10,6 +10,7 @@ const Shell = imports.gi.Shell;
const Signals = imports.signals;
const St = imports.gi.St;
+const Layout = imports.ui.layout;
const Main = imports.ui.main;
const Tweener = imports.ui.tweener;
@@ -63,21 +64,13 @@ var SwitcherPopup = new Lang.Class({
this._initialDelayTimeoutId = 0;
this._noModsTimeoutId = 0;
+ this.add_constraint(new Layout.MonitorConstraint({ primary: true }));
+
// Initially disable hover so we ignore the enter-event if
// the switcher appears underneath the current pointer location
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) {
this.set_allocation(box, flags);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]