[epiphany] ephy-shell: Always focus the main window when loading tabs in Wayland



commit af6a08f1c4feea2a1e1824c1cb714842764918ae
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Mon May 16 22:03:51 2016 -0500

    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

 src/ephy-shell.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index e050180..e8b890b 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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]