[gnome-shell] [popupMenu] Fix wrong positioning when showing for the first time



commit a691192ffa8b78dddcbd26a6981e4b07d462d9f9
Author: Adel Gadllah <adel gadllah gmail com>
Date:   Sat Jun 12 18:13:04 2010 +0200

    [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 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index c907f31..d2d3a2f 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,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]