summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@igalia.com>2016-05-16 22:03:51 -0500
committerMichael Catanzaro <mcatanzaro@igalia.com>2016-05-16 22:05:28 -0500
commitaf6a08f1c4feea2a1e1824c1cb714842764918ae (patch)
tree556de7f0fd1b5c66301cdb4d26a3db99195a5f3a
parent3634aaedc798e5e088634d3d26a1c9697ed6d4c8 (diff)
downloadepiphany-af6a08f1c4feea2a1e1824c1cb714842764918ae.tar.gz
ephy-shell: Always focus the main window when loading tabs in Wayland
Else the window will never get focused, because most apps don't set DESKTOP_STARTUP_ID when launching Epiphany and therefore we have no plausible time to pass to gtk_window_present_with_time(). Note that gtk_window_present() on its own seems to do nothing. https://bugzilla.gnome.org/show_bug.cgi?id=766284
-rw-r--r--src/ephy-shell.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index e0501804a..e8b890be9 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -977,8 +977,12 @@ ephy_shell_open_uris_idle (OpenURIsData *data)
if (reusing_empty_tab || data->flags & EPHY_NEW_TAB_JUMP)
gtk_widget_grab_focus (GTK_WIDGET (embed));
- if (data->flags & EPHY_NEW_TAB_JUMP && ephy_embed_shell_get_mode (EPHY_EMBED_SHELL (data->shell)) != EPHY_EMBED_SHELL_MODE_TEST)
- gtk_window_present_with_time (GTK_WINDOW (data->window), data->user_time);
+ if (data->flags & EPHY_NEW_TAB_JUMP && ephy_embed_shell_get_mode (EPHY_EMBED_SHELL (data->shell)) != EPHY_EMBED_SHELL_MODE_TEST) {
+ if (data->user_time)
+ gtk_window_present_with_time (GTK_WINDOW (data->window), data->user_time);
+ else
+ gtk_window_present_with_time (GTK_WINDOW (data->window), time (NULL));
+ }
} else {
ephy_web_view_load_homepage (ephy_embed_get_web_view (embed));
ephy_window_activate_location (data->window);