aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2012-09-13 00:06:39 +0800
committerXan Lopez <xan@igalia.com>2012-09-13 00:26:15 +0800
commit90501400ad4d1901cca48c1f4435f1e50f6b851b (patch)
treec06e6efbb8cbc1e74b16432c04e74b0def0555f4
parent032378d9bb8539d070896b4cc1f16b8c15c8a8fc (diff)
downloadgsoc2013-epiphany-90501400ad4d1901cca48c1f4435f1e50f6b851b.tar.gz
gsoc2013-epiphany-90501400ad4d1901cca48c1f4435f1e50f6b851b.tar.zst
gsoc2013-epiphany-90501400ad4d1901cca48c1f4435f1e50f6b851b.zip
Focus windows when opening new links in tabs
If someone requests a link to be opened by ephy in an already running instance, and that link is opened in a new tab (either because of our settings or because -n/--new-tab was passed), the window where this happened will not be presented, so it might go unnoticed. Fix this by presenting the windows where new tabs are opened through the open_uris mechanism in EphySession. https://bugzilla.gnome.org/show_bug.cgi?id=641949
-rw-r--r--src/ephy-session.c3
-rw-r--r--src/ephy-shell.c3
-rw-r--r--src/ephy-shell.h2
3 files changed, 7 insertions, 1 deletions
diff --git a/src/ephy-session.c b/src/ephy-session.c
index 74b2570f8..265a867c2 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -337,7 +337,8 @@ session_command_open_uris (EphySession *session,
new_windows_in_tabs)
{
flags |= EPHY_NEW_TAB_IN_EXISTING_WINDOW |
- EPHY_NEW_TAB_JUMP;
+ EPHY_NEW_TAB_JUMP |
+ EPHY_NEW_TAB_PRESENT_WINDOW;
}
for (i = 0; uris[i] != NULL; ++i)
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index 5eb3dfc5e..7bd305ea2 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -821,6 +821,9 @@ ephy_shell_new_tab_full (EphyShell *shell,
}
}
+ if (flags & EPHY_NEW_TAB_PRESENT_WINDOW)
+ gtk_window_present_with_time (GTK_WINDOW (window), user_time);
+
return embed;
}
diff --git a/src/ephy-shell.h b/src/ephy-shell.h
index e7dc5efa1..42b83e18b 100644
--- a/src/ephy-shell.h
+++ b/src/ephy-shell.h
@@ -77,6 +77,7 @@ extern EphyShell *ephy_shell;
* blank.
* @EPHY_NEW_TAB_DONT_COPY_HISTORY: do not copy the back-forward history
* from the current active tab to the new one.
+ * @EPHY_NEW_TAB_PRESENT_WINDOW: present the active window.
*
* Controls how new tabs/windows are created and handled.
*/
@@ -89,6 +90,7 @@ typedef enum {
/* Page mode */
EPHY_NEW_TAB_FULLSCREEN_MODE = 1 << 4,
EPHY_NEW_TAB_DONT_SHOW_WINDOW = 1 << 5,
+ EPHY_NEW_TAB_PRESENT_WINDOW = 1 << 6,
/* Tabs */
EPHY_NEW_TAB_APPEND_LAST = 1 << 7,