[gnome-shell] boxpointer: If available, use source actor for constraining
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] boxpointer: If available, use source actor for constraining
- Date: Mon, 4 Sep 2017 08:29:23 +0000 (UTC)
commit 96e14dcbe76cb2b7fc2dcb972a97575a7cb4a724
Author: Jonas Ådahl <jadahl gmail com>
Date: Mon Sep 4 14:37:45 2017 +0800
boxpointer: If available, use source actor for constraining
If a source actor is set, use that for determining the arrow side (i.e.
whether the BoxPointer widget should expand in a certain direction).
This is better because it ensures that the popup is displayed on the
same monitor as the widget it originates from.
Without this, entering text with a vertically aligned input method
close to the bottom of a monitor would expand the BoxPointer downwards
on the monitor beneath it, instead of upwards, which is what one would
expect.
https://bugzilla.gnome.org/show_bug.cgi?id=786886
js/ui/boxpointer.js | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/boxpointer.js b/js/ui/boxpointer.js
index 091ae15..4527b4d 100644
--- a/js/ui/boxpointer.js
+++ b/js/ui/boxpointer.js
@@ -587,7 +587,10 @@ var BoxPointer = new Lang.Class({
_calculateArrowSide: function(arrowSide) {
let sourceAllocation = Shell.util_get_transformed_allocation(this._sourceActor);
let [minWidth, minHeight, boxWidth, boxHeight] = this._container.get_preferred_size();
- let monitor = Main.layoutManager.findMonitorForActor(this.actor);
+ let monitorActor = this.sourceActor;
+ if (!monitorActor)
+ monitorActor = this.actor;
+ let monitor = Main.layoutManager.findMonitorForActor(monitorActor);
switch (arrowSide) {
case St.Side.TOP:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]