From 447f0d450e61c97830a9901270e6589f24aa9137 Mon Sep 17 00:00:00 2001 From: Tom Beckmann Date: Thu, 17 Jul 2014 03:00:57 +0200 Subject: [PATCH] limit rate at which toggling can be spammed --- src/Widgets/MultitaskingView.vala | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/Widgets/MultitaskingView.vala b/src/Widgets/MultitaskingView.vala index dac04190..6fc79cda 100644 --- a/src/Widgets/MultitaskingView.vala +++ b/src/Widgets/MultitaskingView.vala @@ -33,7 +33,8 @@ namespace Gala public WindowManager wm { get; construct; } Meta.Screen screen; - bool opened; + bool opened = false; + bool animating = false; bool is_smooth_scrolling = false; @@ -397,8 +398,12 @@ namespace Gala */ public void toggle () { - opened = !opened; + if (animating) + return; + animating = true; + + opened = !opened; var opening = opened; foreach (var container in window_containers_monitors) { @@ -462,6 +467,13 @@ namespace Gala wm.block_keybindings_in_modal = true; wm.end_modal (); + animating = false; + + return false; + }); + } else { + Timeout.add (200, () => { + animating = false; return false; }); }