mirror of
https://github.com/elementary/gala.git
synced 2024-11-24 04:21:04 +03:00
limit rate at which toggling can be spammed
This commit is contained in:
parent
fedd31b2d6
commit
447f0d450e
@ -33,7 +33,8 @@ namespace Gala
|
|||||||
public WindowManager wm { get; construct; }
|
public WindowManager wm { get; construct; }
|
||||||
|
|
||||||
Meta.Screen screen;
|
Meta.Screen screen;
|
||||||
bool opened;
|
bool opened = false;
|
||||||
|
bool animating = false;
|
||||||
|
|
||||||
bool is_smooth_scrolling = false;
|
bool is_smooth_scrolling = false;
|
||||||
|
|
||||||
@ -397,8 +398,12 @@ namespace Gala
|
|||||||
*/
|
*/
|
||||||
public void toggle ()
|
public void toggle ()
|
||||||
{
|
{
|
||||||
opened = !opened;
|
if (animating)
|
||||||
|
return;
|
||||||
|
|
||||||
|
animating = true;
|
||||||
|
|
||||||
|
opened = !opened;
|
||||||
var opening = opened;
|
var opening = opened;
|
||||||
|
|
||||||
foreach (var container in window_containers_monitors) {
|
foreach (var container in window_containers_monitors) {
|
||||||
@ -462,6 +467,13 @@ namespace Gala
|
|||||||
wm.block_keybindings_in_modal = true;
|
wm.block_keybindings_in_modal = true;
|
||||||
wm.end_modal ();
|
wm.end_modal ();
|
||||||
|
|
||||||
|
animating = false;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
Timeout.add (200, () => {
|
||||||
|
animating = false;
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user