Title: [101538] trunk/Source/WebCore
Revision
101538
Author
kev...@webkit.org
Date
2011-11-30 11:34:08 -0800 (Wed, 30 Nov 2011)

Log Message

[wx] Ensure we always notify the popup client that the popup
was hidden, and fix handling of empty menu items.
https://bugs.webkit.org/show_bug.cgi?id=73464
        
Reviewed by Kevin Ollivier.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (101537 => 101538)


--- trunk/Source/WebCore/ChangeLog	2011-11-30 19:30:08 UTC (rev 101537)
+++ trunk/Source/WebCore/ChangeLog	2011-11-30 19:34:08 UTC (rev 101538)
@@ -1,3 +1,15 @@
+2011-11-30  Robin Dunn  <ro...@alldunn.com>
+
+        [wx] Ensure we always notify the popup client that the popup
+        was hidden, and fix handling of empty menu items.
+        https://bugs.webkit.org/show_bug.cgi?id=73464
+        
+        Reviewed by Kevin Ollivier.
+
+        * platform/wx/PopupMenuWx.cpp:
+        (WebCore::PopupMenuEventHandler::OnMenuItemSelected):
+        (WebCore::PopupMenuWx::show):
+
 2011-11-30  Tim Horton  <timothy_hor...@apple.com>
 
         dx causes non-BMP characters to fail to render
@@ -14,7 +26,7 @@
         * rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
         (WebCore::SVGTextLayoutAttributesBuilder::propagateLayoutAttributes):
 
-2011-11-29  Robin Dunn  <ro...@alldunn.com>
+2011-11-30  Robin Dunn  <ro...@alldunn.com>
 
         [wx] Add a scope for the raw bitmap access so that wx
         will not make a copy when creating the wxMemoryDC.

Modified: trunk/Source/WebCore/platform/wx/PopupMenuWx.cpp (101537 => 101538)


--- trunk/Source/WebCore/platform/wx/PopupMenuWx.cpp	2011-11-30 19:30:08 UTC (rev 101537)
+++ trunk/Source/WebCore/platform/wx/PopupMenuWx.cpp	2011-11-30 19:34:08 UTC (rev 101538)
@@ -50,11 +50,8 @@
 
     void OnMenuItemSelected(wxCommandEvent& event)
     {
-        if (m_client) {
+        if (m_client)
             m_client->valueChanged(event.GetId() - s_menuStartId);
-            m_client->popupDidHide();
-        }
-        // TODO: Do we need to call Disconnect here? Do we have a ref to the native window still?
     }
 
 private:
@@ -101,16 +98,18 @@
                 m_menu->AppendSeparator();
             }
             else {
-                // FIXME: appending a menu item with an empty label asserts in
-                // wx. This needs to be fixed at wx level so that we can have
-                // the concept of "no selection" in choice boxes, etc.
+                // NOTE: appending a menu item with an empty label asserts in wx.
                 if (!client()->itemText(i).isEmpty())
                     m_menu->Append(s_menuStartId + i, client()->itemText(i));
+                else
+                    m_menu->Append(s_menuStartId + i, " ");
             }
         }
         nativeWin->Connect(s_menuStartId, s_menuStartId + (size-1), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(PopupMenuEventHandler::OnMenuItemSelected), 0, m_popupHandler);
         nativeWin->PopupMenu(m_menu, r.x() - v->scrollX(), r.y() - v->scrollY());
         nativeWin->Disconnect(s_menuStartId, s_menuStartId + (size-1), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(PopupMenuEventHandler::OnMenuItemSelected), 0, m_popupHandler);
+        
+        client()->popupDidHide();
     }
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to