From a691192ffa8b78dddcbd26a6981e4b07d462d9f9 Mon Sep 17 00:00:00 2001 From: Adel Gadllah Date: Sat, 12 Jun 2010 18:13:04 +0200 Subject: [PATCH] [popupMenu] Fix wrong positioning when showing for the first time We query the transformed position and size of the popupMenu before actually showing it which results into wrong positioning, when displaying it for the first time. In case of the statusMenu this can even result into it being offscreen. https://bugzilla.gnome.org/show_bug.cgi?id=621385 --- js/ui/popupMenu.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index c907f316d..d2d3a2f9e 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -277,6 +277,10 @@ PopupMenu.prototype = { let primary = global.get_primary_monitor(); + // We need to show it now to force an allocation, + // so that we can query the correct size. + this.actor.show(); + // Position correctly relative to the sourceActor let [sourceX, sourceY] = this.sourceActor.get_transformed_position(); let [sourceWidth, sourceHeight] = this.sourceActor.get_transformed_size(); @@ -351,7 +355,6 @@ PopupMenu.prototype = { this.actor.y = Math.floor(menuY); // Now show it - this.actor.show(); this.actor.opacity = 0; this.actor.reactive = true; Tweener.addTween(this.actor, { opacity: 255,