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:07:18 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2015-09-27 15:07:18 +0200
commite5da485f77b3b8cd3bc32c13e4497a64a2ad10c3 (patch)
treeb7351c6674108ea5746d70fdc2ff6c59bdc84595 /src/renderers/pieWindow.vala
parentbbabe0f4e471dd984a1c01353c44d4eb1f336473 (diff)
parent16fe2e5d0525422ba6ca5db9e92a93d17caae302 (diff)
Merge new upstream release
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)) {