[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdebase/klipper
From:       Aaron J. Seigo <aseigo () kde ! org>
Date:       2003-08-14 5:48:59
[Download RAW message or body]

CVS commit by aseigo: 

ok, so apparently that hideous move/show/hide/move code _is_ necessary
to get proper positioning of the menu. and i thought tricks were just for
kids.

anyways, this time, add a comment to it, and block the signals while
messing with it to make it a complete no-op for everyone but the menu


  M +11 -0     toplevel.cpp   1.133


--- kdebase/klipper/toplevel.cpp  #1.132:1.133
@@ -278,4 +278,15 @@ void KlipperWidget::showPopupMenu( QPopu
     Q_ASSERT( menu != 0L );
 
+    // OK, so apparently Qt has a hard time figuring out how to size menus
+    // unless they are actually shown first! blarg!
+    // that's what this code does. and now there's a comment here saying
+    // as much, so you don't have to figure it out on your own, as much
+    // fun as that can be. AJS
+    menu->blockSignals(true);
+    menu->move(-1000, -1000);
+    menu->show();
+    menu->hide();
+    menu->blockSignals(false);
+
     if (bPopupAtMouse) {
         QPoint g = QCursor::pos();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic