diff options
-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: |