diff --git a/src/Widgets/WorkspaceView.vala b/src/Widgets/WorkspaceView.vala index 57896e72..0086ed0e 100644 --- a/src/Widgets/WorkspaceView.vala +++ b/src/Widgets/WorkspaceView.vala @@ -29,6 +29,7 @@ namespace Gala Clutter.Actor thumbnails; Clutter.CairoTexture background; Clutter.CairoTexture scroll; + Clutter.Actor click_catcher; //invisible plane that catches clicks outside the view bool animating; // delay closing the popup @@ -61,6 +62,14 @@ namespace Gala scroll.auto_resize = true; scroll.draw.connect (draw_scroll); + click_catcher = new Clutter.Actor (); + click_catcher.reactive = true; + click_catcher.button_release_event.connect ((e) => { + hide (); + return true; + }); + Compositor.get_stage_for_screen (screen).add_child (click_catcher); + add_child (background); add_child (thumbnails); add_child (scroll); @@ -297,6 +306,11 @@ namespace Gala thumbnails.x = 4.0f; } + click_catcher.width = width; + click_catcher.height = area.height - height; + click_catcher.x = 0; + click_catcher.y = 0; + animating = true; Timeout.add (50, () => { animating = false;