Title: [161864] trunk/Tools
- Revision
- 161864
- Author
- [email protected]
- Date
- 2014-01-13 00:12:36 -0800 (Mon, 13 Jan 2014)
Log Message
[GTK] Make MiniBrowser windows non-transient by default
https://bugs.webkit.org/show_bug.cgi?id=126840
Patch by Adrian Perez de Castro <[email protected]> on 2014-01-13
Reviewed by Carlos Garcia Campos.
Instead of making new browser windows transient as soon as they are
created, save the pointer to the parent window and set the transient
state later on 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.
* MiniBrowser/gtk/BrowserWindow.c:
(webViewRunAsModal): Set the parent window using
gtk_window_set_transient_for() using the saved parent
window.
(browser_window_new): Save the parent window using
g_object_set_data() instead of making the new window
transient immediately.
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (161863 => 161864)
--- trunk/Tools/ChangeLog 2014-01-13 07:20:55 UTC (rev 161863)
+++ trunk/Tools/ChangeLog 2014-01-13 08:12:36 UTC (rev 161864)
@@ -1,3 +1,25 @@
+2014-01-13 Adrian Perez de Castro <[email protected]>
+
+ [GTK] Make MiniBrowser windows non-transient by default
+ https://bugs.webkit.org/show_bug.cgi?id=126840
+
+ Reviewed by Carlos Garcia Campos.
+
+ Instead of making new browser windows transient as soon as they are
+ created, save the pointer to the parent window and set the transient
+ state later on 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.
+
+ * MiniBrowser/gtk/BrowserWindow.c:
+ (webViewRunAsModal): Set the parent window using
+ gtk_window_set_transient_for() using the saved parent
+ window.
+ (browser_window_new): Save the parent window using
+ g_object_set_data() instead of making the new window
+ transient immediately.
+
2014-01-12 Sergio Correia <[email protected]>
[EFL][WK2] Make API tests work again
Modified: trunk/Tools/MiniBrowser/gtk/BrowserWindow.c (161863 => 161864)
--- trunk/Tools/MiniBrowser/gtk/BrowserWindow.c 2014-01-13 07:20:55 UTC (rev 161863)
+++ trunk/Tools/MiniBrowser/gtk/BrowserWindow.c 2014-01-13 08:12:36 UTC (rev 161864)
@@ -59,6 +59,7 @@
GdkPixbuf *favicon;
GtkWidget *reloadOrStopButton;
GtkWidget *fullScreenMessageLabel;
+ GtkWindow *parentWindow;
guint fullScreenMessageLabelId;
};
@@ -269,6 +270,7 @@
static void webViewRunAsModal(WebKitWebView *webView, BrowserWindow *window)
{
gtk_window_set_modal(GTK_WINDOW(window), TRUE);
+ gtk_window_set_transient_for(GTK_WINDOW(window), window->parentWindow);
}
static void webViewReadyToShow(WebKitWebView *webView, BrowserWindow *window)
@@ -700,10 +702,15 @@
{
g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(view), 0);
- return GTK_WIDGET(g_object_new(BROWSER_TYPE_WINDOW,
- "transient-for", parent,
- "type", GTK_WINDOW_TOPLEVEL,
- "view", view, NULL));
+ BrowserWindow *window = BROWSER_WINDOW(g_object_new(BROWSER_TYPE_WINDOW,
+ "type", GTK_WINDOW_TOPLEVEL, "view", view, NULL));
+
+ if (parent) {
+ window->parentWindow = parent;
+ g_object_add_weak_pointer(G_OBJECT(parent), &window->parentWindow);
+ }
+
+ return GTK_WIDGET(window);
}
WebKitWebView *browser_window_get_view(BrowserWindow *window)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes