diff options
author | Christiam Dywan <christian@twotoasts.de> | 2019-03-04 22:18:20 +0100 |
---|---|---|
committer | Christiam Dywan <christian@twotoasts.de> | 2019-03-04 22:18:20 +0100 |
commit | 609614c28b37327b5278d175a07e8aa0a7aaad68 (patch) | |
tree | 9d3c560bad5281475f6321df59d51df0383fc5a2 | |
parent | 0c5820ffe24295c0550a27537fe34ebc9ae447e8 (diff) | |
download | midori-git-browser_tabs_visible_child.tar.gz |
Show re-opened tabs and links in new tabs correctlybrowser_tabs_visible_child
- 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 73d4e008..91d52863 100644 --- a/core/browser.vala +++ b/core/browser.vala @@ -476,7 +476,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); } } @@ -723,6 +725,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 815c5be5..575f7688 100644 --- a/core/tab.vala +++ b/core/tab.vala @@ -410,7 +410,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: |