[epiphany] Focus windows when opening new links in tabs
- From: Xan Lopez <xan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] Focus windows when opening new links in tabs
- Date: Wed, 12 Sep 2012 16:26:21 +0000 (UTC)
commit 90501400ad4d1901cca48c1f4435f1e50f6b851b
Author: Xan Lopez <xan igalia com>
Date: Wed Sep 12 18:06:39 2012 +0200
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
src/ephy-session.c | 3 ++-
src/ephy-shell.c | 3 +++
src/ephy-shell.h | 2 ++
3 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/ephy-session.c b/src/ephy-session.c
index 74b2570..265a867 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 5eb3dfc..7bd305e 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 e7dc5ef..42b83e1 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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]