diff options
author | Christian Dywan <christian@twotoasts.de> | 2019-03-07 19:29:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-07 19:29:47 +0100 |
commit | 501340375838c8dee8a9e654a380a8ff045b9165 (patch) | |
tree | b876d6f3b677757852e04ffe99b94395424ceb81 | |
parent | a90a955613e18a988e08891a9da0ac2b3680229f (diff) | |
download | midori-git-501340375838c8dee8a9e654a380a8ff045b9165.tar.gz |
Show re-opened tabs and links in new tabs correctly (#291)
- Tabs restored from the trash via ^T need to be made visible.
- Tabs opening in new windows need to be shown correctly.
-rw-r--r-- | core/browser.vala | 7 | ||||
-rw-r--r-- | core/tab.vala | 5 |
2 files changed, 10 insertions, 2 deletions
diff --git a/core/browser.vala b/core/browser.vala index 31651e87..b2b4361f 100644 --- a/core/browser.vala +++ b/core/browser.vala @@ -479,7 +479,9 @@ namespace Midori { uint index = trash.get_n_items (); if (index > 0) { var item = trash.get_object (index - 1) as DatabaseItem; - add (new Tab (null, web_context, item.uri, item.title)); + var tab = new Tab (null, web_context, item.uri, item.title); + tab.set_data<bool> ("foreground", true); + add (tab); trash.remove (index - 1); } } @@ -726,6 +728,9 @@ namespace Midori { tabs.child_set (tab, "title", tab.display_title); }); tabs.add_titled (tab, tab.id, tab.display_title); + if (tab.get_data<bool> ("foreground")) { + tabs.visible_child = tab; + } } void clear_private_data_activated () { diff --git a/core/tab.vala b/core/tab.vala index 7e9f4137..2927dcb6 100644 --- a/core/tab.vala +++ b/core/tab.vala @@ -412,7 +412,10 @@ namespace Midori { break; case WebKit.PolicyDecisionType.NEW_WINDOW_ACTION: var action = ((WebKit.NavigationPolicyDecision)decision).navigation_action; - create (action); + var tab = ((Tab)create (action)); + tab.set_data<bool> ("foreground", true); + tab.load_request (action.get_request ()); + tab.ready_to_show (); decision.ignore (); return true; case WebKit.PolicyDecisionType.RESPONSE: |