Bug 29693

Summary: [GTK] DRT must display window instead of just realizing, to enable synthesizing events correctly
Product: WebKit Reporter: Gustavo Noronha (kov) <gustavo>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Severity: Normal CC: eric, evan, tony
Priority: P2 Keywords: Gtk
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Bug Depends on:    
Bug Blocks: 29348    
Description Flags
show window instead of realizing only jmalonzo: review+, gustavo: commit-queue-

Description Gustavo Noronha (kov) 2009-09-23 13:53:42 PDT
To correctly synthesize events using gtk_main_do_event we need the window to be shown, or GTK+ throws the events away.
We want this for our EventSender. See https://bugs.webkit.org/show_bug.cgi?id=29348.
Comment 1 Gustavo Noronha (kov) 2009-09-23 14:04:22 PDT
Created attachment 40015 [details]
show window instead of realizing only
Comment 2 Eric Seidel (no email) 2009-09-23 17:49:47 PDT
Really?  This is so sad.  I wonder how Chromium test_shell handles this.
Comment 3 Tony Chang 2009-09-23 18:02:59 PDT
test_shell on all platforms shows the window.  On Linux, we run our tests in a virtual X server (Xvfb) so it doesn't really matter.
Comment 4 Eric Seidel (no email) 2009-09-23 18:05:50 PDT
Interesting.  DumpRenderTree on Mac does not show a window.  I don't believe it does on Windows either.
Comment 5 Gustavo Noronha (kov) 2009-09-23 20:24:24 PDT
Yeah, that's a limitation in GTK+ - it explicitely checks if the window is visible to decide whether it will propagate the event or not, so to synthesize the events with maximum fidelity, that is, not only emitting signals, but causing GTK+ to do whatever it always does when the event happens, we'll need to show the window. Most people will run the tests inside Xvfb, so it should be a non-issue, as Tony pointed out.
Comment 6 Jan Alonzo 2009-09-24 05:35:40 PDT
Comment on attachment 40015 [details]
show window instead of realizing only

> +    gtk_window_resize(GTK_WINDOW(window), size.width, size.height);
>      gtk_widget_size_allocate(container, &size);

Is this part of the patch?
Comment 7 Jan Alonzo 2009-09-24 05:36:36 PDT
Comment on attachment 40015 [details]
show window instead of realizing only

Comment 8 Gustavo Noronha (kov) 2009-09-24 07:16:15 PDT
Landed as r48721, thanks.