RESOLVED FIXED 126840
[GTK] Make MiniBrowser windows non-transient by default
https://bugs.webkit.org/show_bug.cgi?id=126840
Summary [GTK] Make MiniBrowser windows non-transient by default
Adrian Perez
Reported 2014-01-12 04:34:48 PST
Instead of making new browser windows transient as soon as they are created, do ir later when handling the "run-as-modal" signal. This makes it easier to use the MiniBrowser to do tests involving multiple windows, and will be useful as well when multi-web-process mode is enabled for the GTK port.
Attachments
Patch (2.84 KB, patch)
2014-01-12 04:36 PST, Adrian Perez
no flags
Patch (2.75 KB, patch)
2014-01-12 04:50 PST, Adrian Perez
no flags
Patch (2.67 KB, patch)
2014-01-12 05:07 PST, Adrian Perez
no flags
Patch (3.14 KB, patch)
2014-01-12 08:29 PST, Adrian Perez
no flags
Patch (3.25 KB, patch)
2014-01-12 11:24 PST, Adrian Perez
no flags
Patch (2.89 KB, patch)
2014-01-12 12:04 PST, Adrian Perez
no flags
Adrian Perez
Comment 1 2014-01-12 04:36:43 PST
WebKit Commit Bot
Comment 2 2014-01-12 04:38:48 PST
Attachment 220965 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Tools/ChangeLog', u'Tools/MiniBrowser/gtk/BrowserWindow.c', '--commit-queue']" exit_code: 1 ERROR: Tools/MiniBrowser/gtk/BrowserWindow.c:273: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Tools/MiniBrowser/gtk/BrowserWindow.c:274: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Tools/MiniBrowser/gtk/BrowserWindow.c:706: Declaration has space between * and variable name in GtkWidget* window [whitespace/declaration] [3] ERROR: Tools/MiniBrowser/gtk/BrowserWindow.c:707: When wrapping a line, only indent 4 spaces. [whitespace/indent] [3] Total errors found: 4 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
Adrian Perez
Comment 3 2014-01-12 04:50:23 PST
WebKit Commit Bot
Comment 4 2014-01-12 04:52:21 PST
Attachment 220969 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Tools/ChangeLog', u'Tools/MiniBrowser/gtk/BrowserWindow.c', '--commit-queue']" exit_code: 1 ERROR: Tools/MiniBrowser/gtk/BrowserWindow.c:706: When wrapping a line, only indent 4 spaces. [whitespace/indent] [3] Total errors found: 1 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
Adrian Perez
Comment 5 2014-01-12 05:07:30 PST
Carlos Garcia Campos
Comment 6 2014-01-12 05:24:13 PST
Comment on attachment 220970 [details] Patch I think we can simply make the browser windows independent to each other. If you open two windows, then close the parent, and run-as-modal is emitted on the child window, it will crash because the parent window has already been destroyed.
Adrian Perez
Comment 7 2014-01-12 08:27:22 PST
(In reply to comment #6) > (From update of attachment 220970 [details]) > I think we can simply make the browser windows independent to each other. If you open two windows, then close the parent, and run-as-modal is emitted on the child window, it will crash because the parent window has already been destroyed. Good point, though I think it is more correct to connect to the "destroy" signal of the parent window, and clear the pointer to it in the child window. This way closing parent windows before run-as-modal is emitted will not cause a crash, and the transient-for property is still set when parent windows do exist.
Adrian Perez
Comment 8 2014-01-12 08:29:49 PST
Carlos Garcia Campos
Comment 9 2014-01-12 09:12:48 PST
Comment on attachment 220973 [details] Patch I still think we could just make windows independent to each other, but if we really want to keep the parent window, I think it would be simpler to keep the pointer to the parent window in the BroserWindow struct and use g_object_add_weak_pointer to make sure the parent pointer is NULL when the parent is destroyed.
Adrian Perez
Comment 10 2014-01-12 11:23:47 PST
(In reply to comment #9) > (From update of attachment 220973 [details]) > I still think we could just make windows independent to each other, but if we really want to keep the parent window, I think it would be simpler to keep the pointer to the parent window in the BroserWindow struct and use g_object_add_weak_pointer to make sure the parent pointer is NULL when the parent is destroyed. IMHO it is more correct to try to make the windows set the transient-for when they are meant to be modal. Not that it will matter much for the MiniBrowser, but provided that the fix is easy, I am making the change you suggested to use g_object_add_weak_pointer() and re-upload.
Adrian Perez
Comment 11 2014-01-12 11:24:24 PST
Carlos Garcia Campos
Comment 12 2014-01-12 11:39:37 PST
Comment on attachment 220979 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=220979&action=review > Tools/MiniBrowser/gtk/BrowserWindow.c:704 > +static void parentWindowDestroy(GtkWidget *parent_window, gpointer window) > +{ > + if (window) > + g_object_set_data(G_OBJECT(window), "transient-for", NULL); > +} You forgot to remove this.
Adrian Perez
Comment 13 2014-01-12 12:04:14 PST
Adrian Perez
Comment 14 2014-01-12 12:05:15 PST
(In reply to comment #12) > (From update of attachment 220979 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=220979&action=review > > > Tools/MiniBrowser/gtk/BrowserWindow.c:704 > > +static void parentWindowDestroy(GtkWidget *parent_window, gpointer window) > > +{ > > + if (window) > > + g_object_set_data(G_OBJECT(window), "transient-for", NULL); > > +} > > You forgot to remove this. Certainly, good catch. I have already re-uploaded with this cleaned.
WebKit Commit Bot
Comment 15 2014-01-13 00:08:35 PST
Comment on attachment 220980 [details] Patch Clearing flags on attachment: 220980 Committed r161864: <http://trac.webkit.org/changeset/161864>
WebKit Commit Bot
Comment 16 2014-01-13 00:08:39 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.