summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Dywan <christian@twotoasts.de>2019-03-07 19:29:47 +0100
committerGitHub <noreply@github.com>2019-03-07 19:29:47 +0100
commit501340375838c8dee8a9e654a380a8ff045b9165 (patch)
treeb876d6f3b677757852e04ffe99b94395424ceb81
parenta90a955613e18a988e08891a9da0ac2b3680229f (diff)
downloadmidori-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.vala7
-rw-r--r--core/tab.vala5
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: