Changeset 80429 in webkit
- Timestamp:
- Mar 5, 2011 2:32:57 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r80428 r80429 1 2011-03-01 Martin Robinson <mrobinson@igalia.com> 2 3 Reviewed by Xan Lopez. 4 5 [GTK] Windowless plugins override the view cursor 6 https://bugs.webkit.org/show_bug.cgi?id=55531 7 8 manual test: manual-tests/plugins/windowless.html 9 10 * platform/gtk/WidgetGtk.cpp: 11 (WebCore::Widget::setCursor): Call into the ChromeClient implementation now. 12 * plugins/gtk/PluginViewGtk.cpp: 13 (WebCore::PluginView::initXEvent): Instead of setting the window for windowless 14 plugin events, set the window value to none. This method is also used to send 15 focus in / focus out events to windowed plugins, but this is not one of the plugin 16 types where the window parameter matters. This matches what Mozilla does. Also 17 pass in the display of the widget itself, not the default display. 18 (WebCore::PluginView::handleMouseEvent): When the cursor leaves the plugin area, 19 reset the cursor. 20 (WebCore::PluginView::platformGetValue): Clean up this section slightly. Give the 21 widget the top-level window explicitly. This matches Mozilla. 22 1 23 2011-03-05 Martin Robinson <mrobinson@igalia.com> 2 24 -
trunk/Source/WebCore/platform/gtk/WidgetGtk.cpp
r73330 r80429 68 68 void Widget::setCursor(const Cursor& cursor) 69 69 { 70 GdkCursor* platformCursor = cursor.platformCursor().get(); 71 72 // http://bugs.webkit.org/show_bug.cgi?id=16388 73 // [GTK] Widget::setCursor() gets called frequently 74 // 75 // gdk_window_set_cursor() in certain GDK backends seems to be an 76 // expensive operation, so avoid it if possible. 77 78 if (platformCursor == lastSetCursor) 70 ScrollView* view = root(); 71 if (!view) 79 72 return; 80 81 gdk_window_set_cursor(gdkWindow(platformWidget()) ? gdkWindow(platformWidget()) : gtk_widget_get_window(GTK_WIDGET(root()->hostWindow()->platformPageClient())), platformCursor); 82 lastSetCursor = platformCursor; 73 view->hostWindow()->setCursor(cursor); 83 74 } 84 75 -
trunk/Source/WebCore/plugins/gtk/PluginViewGtk.cpp
r80428 r80429 323 323 xEvent->xany.serial = 0; // we are unaware of the last request processed by X Server 324 324 xEvent->xany.send_event = false; 325 xEvent->xany.display = GDK_DISPLAY_XDISPLAY(gdk_display_get_default());326 // NOTE: event->xany.window doesn't always correspond to the .window property of other XEvent's327 // but does in the case of KeyPress, KeyRelease, ButtonPress, ButtonRelease, and MotionNotify328 // events; thus, this is right:329 325 GtkWidget* widget = m_parentFrame->view()->hostWindow()->platformPageClient(); 330 xEvent->xany.window = widget ? GDK_WINDOW_XWINDOW(gtk_widget_get_window(widget)) : 0; 326 xEvent->xany.display = GDK_DISPLAY_XDISPLAY(gtk_widget_get_display(widget)); 327 328 // Mozilla also sends None here for windowless plugins. See nsObjectFrame.cpp in the Mozilla sources. 329 // This method also sets up FocusIn and FocusOut events for windows plugins, but Mozilla doesn't 330 // even send these types of events to windowed plugins. In the future, it may be good to only 331 // send them to windowless plugins. 332 xEvent->xany.window = None; 331 333 } 332 334 … … 416 418 else if (event->type() == eventNames().mousemoveEvent) 417 419 setXMotionEventSpecificFields(&xEvent, event, postZoomPos, m_parentFrame.get()); 418 else if (event->type() == eventNames().mouseoutEvent || event->type() == eventNames().mouseoverEvent) 420 else if (event->type() == eventNames().mouseoutEvent || event->type() == eventNames().mouseoverEvent) { 419 421 setXCrossingEventSpecificFields(&xEvent, event, postZoomPos, m_parentFrame.get()); 422 423 // This is a work-around for plugins which change the cursor. When that happens we 424 // get out of sync with GDK somehow. Resetting the cursor here seems to fix the issue. 425 if (event->type() == eventNames().mouseoutEvent) 426 gdk_window_set_cursor(gtk_widget_get_window(m_parentFrame->view()->hostWindow()->platformPageClient()), 0); 427 } 420 428 else 421 429 return; … … 650 658 651 659 case NPNVnetscapeWindow: { 652 #if defined(XP_UNIX) 653 void* w = reinterpret_cast<void*>(value); 654 GtkWidget* widget = m_parentFrame->view()->hostWindow()->platformPageClient(); 655 *((XID *)w) = GDK_WINDOW_XWINDOW(gtk_widget_get_window(widget)); 656 #endif 657 #ifdef GDK_WINDOWING_WIN32 658 HGDIOBJ* w = reinterpret_cast<HGDIOBJ*>(value); 659 GtkWidget* widget = m_parentFrame->view()->hostWindow()->platformPageClient(); 660 *w = GDK_WINDOW_HWND(gtk_widget_get_window(widget)); 660 GdkWindow* gdkWindow = gtk_widget_get_window(m_parentFrame->view()->hostWindow()->platformPageClient()); 661 #if defined(XP_UNIX) 662 *static_cast<Window*>(value) = GDK_WINDOW_XWINDOW(gdk_window_get_toplevel(gdkWindow)); 663 #elif defined(GDK_WINDOWING_WIN32) 664 *static_cast<HGIOBJ*>(value) = GDK_WINDOW_HWND(gdkWindow); 661 665 #endif 662 666 *result = NPERR_NO_ERROR; -
trunk/Source/WebKit/gtk/ChangeLog
r80299 r80429 1 2011-03-01 Martin Robinson <mrobinson@igalia.com> 2 3 Reviewed by Xan Lopez. 4 5 [GTK] Windowless plugins override the view cursor 6 https://bugs.webkit.org/show_bug.cgi?id=55531 7 8 * WebCoreSupport/ChromeClientGtk.cpp: 9 (WebKit::ChromeClient::setCursor): Moved the implementation of setCursor here 10 which is more fitting since it sets the cursor for the entire window. 11 1 12 2011-03-03 Brady Eidson <beidson@apple.com> 2 13 -
trunk/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
r80279 r80429 653 653 } 654 654 655 void ChromeClient::setCursor(const Cursor&) 656 { 657 notImplemented(); 655 void ChromeClient::setCursor(const Cursor& cursor) 656 { 657 // [GTK] Widget::setCursor() gets called frequently 658 // http://bugs.webkit.org/show_bug.cgi?id=16388 659 // Setting the cursor may be an expensive operation in some backends, 660 // so don't re-set the cursor if it's already set to the target value. 661 GdkWindow* window = gtk_widget_get_window(platformPageClient()); 662 GdkCursor* currentCursor = gdk_window_get_cursor(window); 663 GdkCursor* newCursor = cursor.platformCursor().get(); 664 if (currentCursor != newCursor) 665 gdk_window_set_cursor(window, newCursor); 658 666 } 659 667
Note: See TracChangeset
for help on using the changeset viewer.