summaryrefslogtreecommitdiff
path: root/src/renderers/pieWindow.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2015-09-27 15:05:13 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2015-09-27 15:05:13 +0200
commit16fe2e5d0525422ba6ca5db9e92a93d17caae302 (patch)
treed6f1a9ed22335f6d0b457ccdd560b7525fb38d14 /src/renderers/pieWindow.vala
parent10af7615316fd91eef61cc66a8ede38a2bff3fdc (diff)
Imported Upstream version 0.6.6upstream/0.6.6
Diffstat (limited to 'src/renderers/pieWindow.vala')
-rwxr-xr-xsrc/renderers/pieWindow.vala12
1 files changed, 9 insertions, 3 deletions
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)) {