diff options
author | Christian Dywan <christian@twotoasts.de> | 2018-09-11 17:59:40 +0200 |
---|---|---|
committer | Christian Dywan <christian@twotoasts.de> | 2018-09-11 17:59:40 +0200 |
commit | 84798b106fecc02680c32c34501cd730a06c2d66 (patch) | |
tree | 5d22d8f4cd192d81ce6694d3c7f4921e9e680fc8 | |
parent | cc50b965145eb068328469a68b16fa9e039e9a53 (diff) | |
download | midori-git-timeout_visible_tab_focus.tar.gz |
Employ 500ms timeout loading tab after switchingtimeout_visible_tab_focus
-rw-r--r-- | core/browser.vala | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/core/browser.vala b/core/browser.vala index 6d04c4a2..07acf920 100644 --- a/core/browser.vala +++ b/core/browser.vala @@ -73,6 +73,7 @@ namespace Midori { Gtk.SearchEntry search_entry; List<Binding> bindings; + uint focus_timeout = 0; construct { overlay.add_events (Gdk.EventMask.ENTER_NOTIFY_MASK); @@ -185,7 +186,15 @@ namespace Midori { bindings.append (tab.bind_property ("link-uri", statusbar, "label")); bindings.append (tab.bind_property ("display-uri", navigationbar.urlbar, "uri")); bindings.append (tab.bind_property ("pinned", navigationbar, "visible", BindingFlags.INVERT_BOOLEAN)); - tab.grab_focus (); + if (focus_timeout > 0) { + Source.remove (focus_timeout); + focus_timeout = 0; + } + focus_timeout = Timeout.add (500, () => { + tab.grab_focus (); + goto_activated (); + return Source.REMOVE; + }, Priority.LOW); } else { var previous_tab = tabs.get_children ().nth_data (0); if (previous_tab == null) |