Changeset 252898 in webkit
- Timestamp:
- Nov 27, 2019 2:19:38 AM (4 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r252893 r252898 1 2019-11-27 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] WebDriver: moving toplevel windows is not supported under wayland 4 https://bugs.webkit.org/show_bug.cgi?id=204614 5 6 Reviewed by Alejandro G. Castro. 7 8 So we can stop trying and simply ignore the requests to move the window. 9 10 * UIProcess/API/glib/WebKitUIClient.cpp: 11 (UIClient::windowConfigureEventCallback): Ensure we only move or resize when actually required and reduce the 12 time we wait for configure events to 200ms (1 second was too long). 13 1 14 2019-11-26 Antti Koivisto <antti@apple.com> 2 15 -
trunk/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp
r252492 r252898 36 36 #include "WebProcessProxy.h" 37 37 #include "WebsiteDataStore.h" 38 #include <WebCore/PlatformDisplay.h> 38 39 #include <wtf/glib/GRefPtr.h> 39 40 #include <wtf/glib/RunLoopSourcePriority.h> … … 143 144 { 144 145 GdkRectangle geometry = { 0, 0, 0, 0 }; 145 gtk_window_get_position(window, &geometry.x, &geometry.y); 146 // Position a toplevel window is not supported under wayland. 147 if (WebCore::PlatformDisplay::sharedDisplay().type() != WebCore::PlatformDisplay::Type::Wayland) { 148 gtk_window_get_position(window, &geometry.x, &geometry.y); 149 if (geometry.x != targetGeometry->x || geometry.y != targetGeometry->y) 150 return FALSE; 151 } 152 146 153 gtk_window_get_size(window, &geometry.width, &geometry.height); 147 if (geometry.x == targetGeometry->x && geometry.y == targetGeometry->y && geometry.width == targetGeometry->width && geometry.height == targetGeometry->height) 148 RunLoop::current().stop(); 149 154 if (geometry.width != targetGeometry->width || geometry.height != targetGeometry->height) 155 return FALSE; 156 157 RunLoop::current().stop(); 150 158 return FALSE; 151 159 } … … 163 171 GtkWidget* window = gtk_widget_get_toplevel(GTK_WIDGET(m_webView)); 164 172 if (webkit_web_view_is_controlled_by_automation(m_webView) && WebCore::widgetIsOnscreenToplevelWindow(window) && gtk_widget_get_visible(window)) { 165 if ((geometry.x < 0 || geometry.y < 0) && (geometry.width <= 0 || geometry.height <= 0)) 173 bool needsMove = false; 174 // Position a toplevel window is not supported under wayland. 175 if (WebCore::PlatformDisplay::sharedDisplay().type() != WebCore::PlatformDisplay::Type::Wayland) { 176 if (geometry.x >= 0 && geometry.y >= 0) { 177 int x, y; 178 gtk_window_get_position(GTK_WINDOW(window), &x, &y); 179 needsMove = x != geometry.x || y != geometry.y; 180 } 181 } 182 183 bool needsResize = false; 184 if (geometry.width > 0 && geometry.height > 0) { 185 int width, height; 186 gtk_window_get_size(GTK_WINDOW(window), &width, &height); 187 needsResize = width != geometry.width || height != geometry.height; 188 } 189 190 if (!needsMove && !needsResize) 166 191 return; 167 192 168 193 auto signalID = g_signal_connect(window, "configure-event", G_CALLBACK(windowConfigureEventCallback), &geometry); 169 if ( geometry.x >= 0 && geometry.y >= 0)194 if (needsMove) 170 195 gtk_window_move(GTK_WINDOW(window), geometry.x, geometry.y); 171 if ( geometry.width > 0 && geometry.height > 0)196 if (needsResize) 172 197 gtk_window_resize(GTK_WINDOW(window), geometry.width, geometry.height); 173 198 174 199 // We need the move/resize to happen synchronously in automation mode, so we use a nested RunLoop 175 // to wait, up top 1 second, for the configure events.200 // to wait, up top 200 milliseconds, for the configure events. 176 201 auto timer = makeUnique<RunLoop::Timer<UIClient>>(RunLoop::main(), this, &UIClient::setWindowFrameTimerFired); 177 202 timer->setPriority(RunLoopSourcePriority::RunLoopTimer); 178 timer->startOneShot( 1_s);203 timer->startOneShot(200_ms); 179 204 RunLoop::run(); 180 205 timer = nullptr;
Note: See TracChangeset
for help on using the changeset viewer.