From 16fe2e5d0525422ba6ca5db9e92a93d17caae302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 27 Sep 2015 15:05:13 +0200 Subject: Imported Upstream version 0.6.6 --- src/renderers/pieWindow.vala | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/renderers/pieWindow.vala') diff --git a/src/renderers/pieWindow.vala b/src/renderers/pieWindow.vala index a49813a..c1d70b7 100755 --- a/src/renderers/pieWindow.vala +++ b/src/renderers/pieWindow.vala @@ -149,10 +149,12 @@ public class PieWindow : Gtk.Window { // remember last pressed key in order to disable key repeat uint last_key = 0; + uint32 last_time_stamp = 0; this.key_press_event.connect((e) => { if (e.keyval != last_key) { - last_key = e.keyval; - this.handle_key_press(e.keyval, e.time, e.str); + this.handle_key_press(e.keyval, e.time, last_time_stamp, e.str); + last_key = e.keyval; + last_time_stamp = e.time; } return true; }); @@ -436,7 +438,11 @@ public class PieWindow : Gtk.Window { /// Do some useful stuff when keys are pressed. ///////////////////////////////////////////////////////////////////// - private void handle_key_press(uint key, uint32 time_stamp, string text) { + private void handle_key_press(uint key, uint32 time_stamp, uint32 last_time_stamp, string text) { + if (last_time_stamp + 1000 < time_stamp) { + this.search_string = ""; + } + if (Gdk.keyval_name(key) == "Escape") this.cancel(); else if (Gdk.keyval_name(key) == "Return") this.activate_slice(time_stamp); else if (!PieManager.get_is_turbo(this.renderer.id)) { -- cgit v1.2.3