[gnote] Fix pop-up menu position calculation



commit 331d5af569aabfb2081ddea1dcfa69ff8bc353aa
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Sat Jan 4 16:55:54 2014 +0200

    Fix pop-up menu position calculation

 src/utils.cpp |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/utils.cpp b/src/utils.cpp
index f00c22f..2487b04 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -1,7 +1,7 @@
 /*
  * gnote
  *
- * Copyright (C) 2010-2013 Aurimas Cernius
+ * Copyright (C) 2010-2014 Aurimas Cernius
  * Copyright (C) 2010 Debarshi Ray
  * Copyright (C) 2009 Hubert Figuiere
  *
@@ -70,7 +70,9 @@ namespace gnote {
         }
       
         menu->get_attach_widget()->get_window()->get_origin(x, y);
-        x += menu->get_attach_widget()->get_allocation().get_x();
+        Gdk::Rectangle rect = menu->get_attach_widget()->get_allocation();
+        x += rect.get_x();
+        y += rect.get_y();
         
         Gtk::Requisition menu_req, unused;
         menu->get_preferred_size(unused, menu_req);
@@ -78,7 +80,7 @@ namespace gnote {
           y -= menu_req.height;
         }
         else {
-          y += menu->get_attach_widget()->get_allocation().get_height();
+          y += rect.get_height();
         }
         
         push_in = true;


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