From 3d8835ce738f3bb2f7006d3d195723a97170c856 Mon Sep 17 00:00:00 2001 From: "deanm@chromium.org" Date: Sun, 15 Feb 2009 11:46:04 +0000 Subject: Match the Windows plugin moving/sizing behavior on Linux. This keep the sizing operations in WebPluginDelegateImpl, and does the moving in DidMove. This more or less matches what currently happens on Windows. Add a comment explaining this situation better. Add some random comments and small code cleanup. Remove the flash useragent spoofing hack on non-Windows, we don't need to worry about this for now. Review URL: http://codereview.chromium.org/20304 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9843 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/tools/test_shell/test_webview_delegate_gtk.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'webkit/tools') diff --git a/webkit/tools/test_shell/test_webview_delegate_gtk.cc b/webkit/tools/test_shell/test_webview_delegate_gtk.cc index 2564061..c74b64f 100755 --- a/webkit/tools/test_shell/test_webview_delegate_gtk.cc +++ b/webkit/tools/test_shell/test_webview_delegate_gtk.cc @@ -207,11 +207,22 @@ void TestWebViewDelegate::DidMove(WebWidget* webwidget, GtkWidget* widget = move.window; DCHECK(!GTK_WIDGET_NO_WINDOW(widget) && GTK_WIDGET_REALIZED(widget)); + // Update the clipping region on the GdkWindow. GdkRectangle clip_rect = move.clip_rect.ToGdkRectangle(); GdkRegion* clip_region = gdk_region_rectangle(&clip_rect); gfx::SubtractRectanglesFromRegion(clip_region, move.cutout_rects); gdk_window_shape_combine_region(widget->window, clip_region, 0, 0); gdk_region_destroy(clip_region); + + // Update the window position. Resizing is handled by WebPluginDelegate. + // TODO(deanm): Verify that we only need to move and not resize. + // TODO(deanm): Can we avoid the X call if it's already at the right place, + // the GtkFixed knows where the child is, maybe it handles this for us? + WebWidgetHost* host = GetHostForWidget(webwidget); + gtk_fixed_move(GTK_FIXED(host->view_handle()), + widget, + move.window_rect.x(), + move.window_rect.y()); } void TestWebViewDelegate::RunModal(WebWidget* webwidget) { -- cgit v1.1