[Webkit-unassigned] [Bug 56466] New: Popup menu can get stuck in closed state when GtkMenu can't grab mouse.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 16 09:23:38 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=56466

           Summary: Popup menu can get stuck in closed state when GtkMenu
                    can't grab mouse.
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: WebKit Gtk
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: textshell at neutronstar.dyndns.org


Created an attachment (id=85934)
 --> (https://bugs.webkit.org/attachment.cgi?id=85934&action=review)
patch to fix the bug

gtk_menu_popup show can silent fail to actually open a menu when it can't acquire a mouse pointer grab.
As WebCore and gtk track the opened/visible status separately this can lead to a situation where WebCore believes the menu is open and then tries to close it but gtk never signals back that it closed the menu (because it was not visible to start from gtk's point of view). This way the user can not open for example drop down menus on a website at all.

PopupMenuGtk needs to check if the gtk_menu_popup call actually succeeded and if it didn't call back to WebCore to signal that the menu is closed again.

I experienced this bug with a compositing manager, i didn't manage to reproduce it without, but the problem is likely also triggerable without anything special.


I've make a patch to fix this by calling gtk_widget_get_visible and if it returns false call client()->popupDidHide();

The patch is against an older version but trunk seems to have exactly the same code.


--- webkit-1.2.5.orig/WebCore/platform/gtk/PopupMenuGtk.cpp     2011-03-15 14:54:30.807239931 +0100
+++ webkit-1.2.5/WebCore/platform/gtk/PopupMenuGtk.cpp  2011-03-15 14:54:39.415987337 +0100
@@ -108,6 +108,11 @@

     g_list_free(children);
     gtk_menu_popup(m_popup.get(), 0, 0, reinterpret_cast<GtkMenuPositionFunc>(menuPositionFunction), this, 0, gtk_get_current_event_time());
+    if (!gtk_widget_get_visible(GTK_WIDGET(m_popup.get()))) {
+        // gtk can refuse to actually open the menu when grabs fail. Make sure WebCore's state keeps in sync.
+        ASSERT(that->client());
+        client()->popupDidHide();
+    }
 }

 void PopupMenu::hide()

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list