]> source.dussan.org Git - tigervnc.git/commitdiff
Fix some misbehaviour with the scroll widget caused by the popup menu.
authorPierre Ossman <ossman@cendio.se>
Wed, 1 Jun 2011 09:26:57 +0000 (09:26 +0000)
committerPierre Ossman <ossman@cendio.se>
Wed, 1 Jun 2011 09:26:57 +0000 (09:26 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4458 3789f03b-4d11-0410-bbf8-ca57d06f2519

vncviewer/Viewport.cxx

index 91daf9ea0200708ecdc589e7ec563acc962fae5c..3dd53e2fc12008c7e68f64b5b6345117503bc6bc 100644 (file)
@@ -82,6 +82,12 @@ Viewport::Viewport(int w, int h, const rfb::PixelFormat& serverPF, CConn* cc_)
   // button component (which we don't want)
   contextMenu->box(FL_NO_BOX);
 
+  // The (invisible) button associated with this widget can mess with
+  // things like Fl_Scroll so we need to get rid of any parents.
+  // Unfortunately that's not possible because of STR #2654, but
+  // reparenting to the current window works for most cases.
+  window()->add(contextMenu);
+
   initContextMenu();
 
   setMenuKey();
@@ -617,8 +623,6 @@ void Viewport::popupContextMenu()
   if (window()->contains(Fl::focus()))
     Fl::focus(NULL);
 
-  contextMenu->position(Fl::event_x(), Fl::event_y());
-
   m = contextMenu->popup();
   if (m == NULL)
     return;