Changeset 107249 in webkit
- Timestamp:
- Feb 9, 2012 8:38:52 AM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r107244 r107249 1 2012-02-08 Dan Vrátil <dvratil@redhat.com>, Milan Crha <mcrha@redhat.com> 2 3 [GTK] Embedded GtkWidgets are not drawn 4 https://bugs.webkit.org/show_bug.cgi?id=63451 5 6 Remove widget from it's parent container when GtkPluginWidget is destroyed. 7 Remove paint() method because real expose even is used for drawing child widgets now. 8 9 Reviewed by Martin Robinson. 10 11 * platform/gtk/GtkPluginWidget.cpp: 12 (WebCore::GtkPluginWidget::~GtkPluginWidget): 13 (WebCore): 14 * platform/gtk/GtkPluginWidget.h: 15 (GtkPluginWidget): 16 1 17 2012-02-09 Arun Patole <arun.patole@motorola.com> 2 18 -
trunk/Source/WebCore/platform/gtk/GtkPluginWidget.cpp
r89133 r107249 42 42 } 43 43 44 GtkPluginWidget::~GtkPluginWidget() 45 { 46 gtk_container_remove(GTK_CONTAINER(gtk_widget_get_parent(platformWidget())), platformWidget()); 47 } 48 44 49 void GtkPluginWidget::invalidateRect(const IntRect& coreRect) 45 50 { … … 67 72 } 68 73 69 void GtkPluginWidget::paint(GraphicsContext* context, const IntRect& rect)70 {71 if (!context->gdkExposeEvent())72 return;73 74 /* only paint widgets with no window this way */75 if (gtk_widget_get_has_window(platformWidget()))76 return;77 78 GtkWidget* widget = platformWidget();79 ASSERT(!gtk_widget_get_has_window(widget));80 81 GdkEvent* event = gdk_event_new(GDK_EXPOSE);82 event->expose = *context->gdkExposeEvent();83 event->expose.area = static_cast<GdkRectangle>(rect);84 85 IntPoint loc = parent()->contentsToWindow(rect.location());86 87 event->expose.area.x = loc.x();88 event->expose.area.y = loc.y();89 90 #ifdef GTK_API_VERSION_291 event->expose.region = gdk_region_rectangle(&event->expose.area);92 #else93 event->expose.region = cairo_region_create_rectangle(&event->expose.area);94 #endif95 96 /*97 * This will be unref'ed by gdk_event_free.98 */99 g_object_ref(event->expose.window);100 101 /*102 * If we are going to paint do the translation and GtkAllocation manipulation.103 */104 #ifdef GTK_API_VERSION_2105 if (!gdk_region_empty(event->expose.region))106 #else107 if (!cairo_region_is_empty(event->expose.region))108 #endif109 gtk_widget_send_expose(widget, event);110 111 gdk_event_free(event);112 74 } 113 114 } -
trunk/Source/WebCore/platform/gtk/GtkPluginWidget.h
r44183 r107249 34 34 public: 35 35 GtkPluginWidget(GtkWidget*); 36 virtual ~GtkPluginWidget(); 36 37 void invalidateRect(const IntRect&); 37 38 void frameRectsChanged(); 38 void paint(GraphicsContext*, const IntRect&);39 39 }; 40 40 } -
trunk/Source/WebKit/gtk/ChangeLog
r107086 r107249 1 2012-02-08 Dan Vrátil <dvratil@redhat.com>, Milan Crha <mcrha@redhat.com> 2 3 [GTK] Embedded GtkWidgets are not drawn 4 https://bugs.webkit.org/show_bug.cgi?id=63451 5 6 Insert plugin widgets to WebKitWebView container as it's children. 7 Chain up to parent in webkit_web_view_draw() to ensure the child widgets are drawn. 8 9 Reviewed by Martin Robinson. 10 11 * WebCoreSupport/FrameLoaderClientGtk.cpp: 12 (WebKit::FrameLoaderClient::createPlugin): 13 * webkit/webkitwebview.cpp: 14 (webkit_web_view_draw): 15 1 16 2012-02-08 Mario Sanchez Prada <msanchez@igalia.com> 2 17 -
trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
r106467 r107249 483 483 g_signal_emit_by_name(getViewFromFrame(m_frame), "create-plugin-widget", 484 484 mimeTypeString.data(), urlString.data(), hash.get(), >kWidget); 485 if (gtkWidget) 485 if (gtkWidget) { 486 gtk_container_add(GTK_CONTAINER(getViewFromFrame(m_frame)), gtkWidget); 486 487 return adoptRef(new GtkPluginWidget(gtkWidget)); 488 } 487 489 488 490 RefPtr<PluginView> pluginView = PluginView::create(core(m_frame), pluginSize, element, url, paramNames, paramValues, mimeType, loadManually); -
trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp
r106901 r107249 640 640 cr.get(), IntSize(), IntRect(rects.get()[i])); 641 641 } 642 643 // Chaining up to the parent forces child widgets to be drawn. 644 GTK_WIDGET_CLASS(webkit_web_view_parent_class)->expose(widget, event); 642 645 return FALSE; 643 646 } … … 668 671 cairo_rectangle_list_destroy(rectList); 669 672 673 // Chaining up to the parent forces child widgets to be drawn. 674 GTK_WIDGET_CLASS(webkit_web_view_parent_class)->draw(widget, cr); 670 675 return FALSE; 671 676 }
Note: See TracChangeset
for help on using the changeset viewer.