Changeset 190717 in webkit
- Timestamp:
- Oct 8, 2015 3:06:41 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r190715 r190717 1 2015-10-08 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Stop using a nested main loop for popup menus 4 https://bugs.webkit.org/show_bug.cgi?id=149920 5 6 Reviewed by Sergio Villar Senin. 7 8 Unskip platform/gtk/fast/forms/menulist-typeahead-find.html that 9 was timing out because of the nested main loop. 10 11 * platform/gtk/TestExpectations: 12 1 13 2015-10-08 Carlos Garcia Campos <cgarcia@igalia.com> 2 14 -
trunk/LayoutTests/platform/gtk/TestExpectations
r190715 r190717 1587 1587 Bug(GTK) http/tests/security/storage-blocking-strengthened-private-browsing-plugin.html [ Failure ] 1588 1588 Bug(GTK) platform/gtk/fast/events/event-sender-metakey.html [ Failure ] 1589 Bug(GTK) platform/gtk/fast/forms/menulist-typeahead-find.html [ Failure ]1590 1589 Bug(GTK) plugins/keyboard-events.html [ Failure ] 1591 1590 Bug(GTK) plugins/netscape-plugin-setwindow-size-2.html [ Failure ] -
trunk/Source/WebKit2/ChangeLog
r190693 r190717 1 2015-10-08 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Stop using a nested main loop for popup menus 4 https://bugs.webkit.org/show_bug.cgi?id=149920 5 6 Reviewed by Sergio Villar Senin. 7 8 WebPageProxy used to expect the popup menus to run in a nested 9 main loop and invalidated the menu right after showing it. But 10 this is no longer the case, so there's no reason to keep using 11 the nested main loop. 12 13 * UIProcess/gtk/WebPopupMenuProxyGtk.cpp: 14 (WebKit::WebPopupMenuProxyGtk::~WebPopupMenuProxyGtk): 15 (WebKit::WebPopupMenuProxyGtk::cancelTracking): 16 (WebKit::WebPopupMenuProxyGtk::menuItemActivated): 17 (WebKit::WebPopupMenuProxyGtk::WebPopupMenuProxyGtk): Deleted. 18 (WebKit::WebPopupMenuProxyGtk::showPopupMenu): Deleted. 19 (WebKit::WebPopupMenuProxyGtk::shutdownRunLoop): Deleted. 20 (WebKit::WebPopupMenuProxyGtk::menuUnmapped): Deleted. 21 * UIProcess/gtk/WebPopupMenuProxyGtk.h: 22 (WebKit::WebPopupMenuProxyGtk::setActiveItem): Deleted. 23 1 24 2015-10-07 Anders Carlsson <andersca@apple.com> 2 25 -
trunk/Source/WebKit2/UIProcess/gtk/WebPopupMenuProxyGtk.cpp
r187542 r190717 43 43 , m_webView(webView) 44 44 , m_popup(gtk_menu_new()) 45 , m_activeItem(-1)46 45 , m_previousKeyEventCharacter(0) 47 46 , m_previousKeyEventTimestamp(0) … … 53 52 WebPopupMenuProxyGtk::~WebPopupMenuProxyGtk() 54 53 { 55 if (m_popup) { 56 g_signal_handlers_disconnect_matched(m_popup, G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, this); 57 hidePopupMenu(); 58 gtk_widget_destroy(m_popup); 59 } 54 cancelTracking(); 60 55 } 61 56 … … 128 123 } 129 124 130 gulong unmapHandler = g_signal_connect(m_popup, "unmap", G_CALLBACK(menuUnmapped), this);131 132 125 const GdkEvent* event = m_client->currentlyProcessedMouseDownEvent() ? m_client->currentlyProcessedMouseDownEvent()->nativeEvent() : nullptr; 133 126 gtk_menu_popup_for_device(GTK_MENU(m_popup), event ? gdk_event_get_device(event) : nullptr, nullptr, nullptr, … … 150 143 return; 151 144 } 152 153 // WebPageProxy expects the menu to run in a nested run loop, since it invalidates the154 // menu right after calling WebPopupMenuProxy::showPopupMenu().155 m_runLoop = adoptGRef(g_main_loop_new(nullptr, FALSE));156 157 // This is to suppress warnings about gdk_threads_leave and gdk_threads_enter.158 #pragma GCC diagnostic push159 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"160 gdk_threads_leave();161 g_main_loop_run(m_runLoop.get());162 gdk_threads_enter();163 #pragma GCC diagnostic pop164 165 m_runLoop.clear();166 167 g_signal_handler_disconnect(m_popup, unmapHandler);168 169 if (!m_client)170 return;171 172 m_client->valueChangedForPopupMenu(this, m_activeItem);173 145 } 174 146 … … 177 149 gtk_menu_popdown(GTK_MENU(m_popup)); 178 150 resetTypeAheadFindState(); 151 } 152 153 void WebPopupMenuProxyGtk::cancelTracking() 154 { 155 if (!m_popup) 156 return; 157 158 g_signal_handlers_disconnect_matched(m_popup, G_SIGNAL_MATCH_DATA, 0, 0, nullptr, nullptr, this); 159 hidePopupMenu(); 160 gtk_widget_destroy(m_popup); 161 m_popup = nullptr; 179 162 } 180 163 … … 257 240 } 258 241 259 void WebPopupMenuProxyGtk::shutdownRunLoop()260 {261 if (g_main_loop_is_running(m_runLoop.get()))262 g_main_loop_quit(m_runLoop.get());263 }264 265 242 void WebPopupMenuProxyGtk::menuItemActivated(GtkAction* action, WebPopupMenuProxyGtk* popupMenu) 266 243 { 267 popupMenu->setActiveItem(GPOINTER_TO_INT(g_object_get_data(G_OBJECT(action), "popup-menu-action-index"))); 268 popupMenu->shutdownRunLoop(); 269 } 270 271 void WebPopupMenuProxyGtk::menuUnmapped(GtkWidget*, WebPopupMenuProxyGtk* popupMenu) 272 { 273 popupMenu->shutdownRunLoop(); 244 if (popupMenu->m_client) 245 popupMenu->m_client->valueChangedForPopupMenu(popupMenu, GPOINTER_TO_INT(g_object_get_data(G_OBJECT(action), "popup-menu-action-index"))); 274 246 } 275 247 -
trunk/Source/WebKit2/UIProcess/gtk/WebPopupMenuProxyGtk.h
r185637 r190717 44 44 ~WebPopupMenuProxyGtk(); 45 45 46 virtual void showPopupMenu(const WebCore::IntRect&, WebCore::TextDirection, double pageScaleFactor, const Vector<WebPopupItem>&, const PlatformPopupMenuData&, int32_t selectedIndex); 47 virtual void hidePopupMenu(); 46 virtual void showPopupMenu(const WebCore::IntRect&, WebCore::TextDirection, double pageScaleFactor, const Vector<WebPopupItem>&, const PlatformPopupMenuData&, int32_t selectedIndex) override; 47 virtual void hidePopupMenu() override; 48 virtual void cancelTracking() override; 48 49 49 50 private: 50 51 WebPopupMenuProxyGtk(GtkWidget*, WebPopupMenuProxy::Client*); 51 void shutdownRunLoop(); 52 void setActiveItem(int activeItem) { m_activeItem = activeItem; } 52 53 53 void setCurrentlySelectedMenuItem(GtkWidget* item) { m_currentlySelectedMenuItem = item; } 54 54 GtkAction* createGtkActionForMenuItem(const WebPopupItem&, int itemIndex); … … 59 59 60 60 static void menuItemActivated(GtkAction*, WebPopupMenuProxyGtk*); 61 static void menuUnmapped(GtkWidget*, WebPopupMenuProxyGtk*);62 61 static void selectItemCallback(GtkWidget*, WebPopupMenuProxyGtk*); 63 62 static gboolean keyPressEventCallback(GtkWidget*, GdkEventKey*, WebPopupMenuProxyGtk*); … … 65 64 GtkWidget* m_webView; 66 65 GtkWidget* m_popup; 67 int m_activeItem;68 GRefPtr<GMainLoop> m_runLoop;69 66 70 67 // Typeahead find.
Note: See TracChangeset
for help on using the changeset viewer.