diff options
| author | jassmith@gmail.com <> | 2010-07-23 09:12:26 -0400 |
|---|---|---|
| committer | jassmith@gmail.com <> | 2010-07-23 09:12:26 -0400 |
| commit | 05d34098ccb9a2c7c0d58809d5adeda7f82264e8 (patch) | |
| tree | 8ed83a51f4d25511f34752297204c8b5715d8c21 | |
| parent | 2e8c6a449fab6a144bbd3dfd6b2d7d3e02f21691 (diff) | |
Check spacing on expose
Make workspace overview close on click Make workspace overview use background texture instead of DESKTOP window (bzr r402.2.1)
| -rw-r--r-- | targets/mutter/plugin.vala | 6 | ||||
| -rw-r--r-- | targets/mutter/spaces-manager.vala | 52 |
2 files changed, 34 insertions, 24 deletions
diff --git a/targets/mutter/plugin.vala b/targets/mutter/plugin.vala index a9ec74ccc..a2e3e5075 100644 --- a/targets/mutter/plugin.vala +++ b/targets/mutter/plugin.vala @@ -108,6 +108,7 @@ namespace Unity } public ExposeManager expose_manager { get; private set; } + public Background background { get; private set; } public bool menus_swallow_events { get { return false; } } @@ -122,7 +123,6 @@ namespace Unity private Maximus maximus; /* Unity Components */ - private Background background; private SpacesManager spaces_manager; private Launcher.Launcher launcher; private Places.Controller places_controller; @@ -515,7 +515,7 @@ namespace Unity } } - expose_windows (windows); + expose_windows (windows, get_launcher_width_foobar () + 10); } public void stop_expose () @@ -560,7 +560,7 @@ namespace Unity } public void expose_windows (GLib.SList<Clutter.Actor> windows, - int left_buffer = 250) + int left_buffer = 75) { expose_manager.left_buffer = left_buffer; expose_manager.start_expose (windows); diff --git a/targets/mutter/spaces-manager.vala b/targets/mutter/spaces-manager.vala index 9b1b61b57..e13177e4e 100644 --- a/targets/mutter/spaces-manager.vala +++ b/targets/mutter/spaces-manager.vala @@ -40,7 +40,10 @@ namespace Unity { public override void activate () { - parent.show_spaces_picker (); + if (parent.showing) + parent.hide_spaces_picker (); + else + parent.show_spaces_picker (); } } @@ -98,6 +101,10 @@ namespace Unity { bottom_padding = bottom; } + public void hide_spaces_picker () { + select_workspace (null); + } + public void show_spaces_picker () { if (showing) return; @@ -105,6 +112,9 @@ namespace Unity { showing = true; plugin.add_fullscreen_request (this); + if (background is Clutter.Actor) + background.destroy (); + background = new Clutter.Rectangle.with_color ({0, 0, 0, 255}); unowned Mutter.MetaScreen screen = plugin.plugin.get_screen (); unowned GLib.List<Mutter.MetaWorkspace> workspaces = Mutter.MetaScreen.get_workspaces (screen); @@ -140,7 +150,12 @@ namespace Unity { } } - private void select_workspace (Mutter.MetaWorkspace workspace) { + private void select_workspace (Mutter.MetaWorkspace? workspace) { + if (workspace == null) + { + workspace = Mutter.MetaScreen.get_active_workspace (plugin.plugin.get_screen ()); + } + unlayout_workspaces (clones, plugin.plugin.get_screen (), Mutter.MetaWorkspace.index (workspace)); clones = null; @@ -152,51 +167,46 @@ namespace Unity { private Clutter.Actor workspace_clone (Mutter.MetaWorkspace workspace) { Clutter.Group wsp; - GLib.List<weak Mutter.Window> windows = (GLib.List<weak Mutter.Window>) plugin.plugin.get_windows ().copy (); + unowned GLib.List<Mutter.Window> windows; + windows = plugin.plugin.get_windows (); wsp = new Clutter.Group (); List<Clutter.Actor> toplevel_windows = new List<Clutter.Actor> (); int active_workspace = Mutter.MetaScreen.get_active_workspace_index (plugin.plugin.get_screen ()); - Clutter.Actor last = null, wspclone = null; - foreach (Mutter.Window window in windows) { if (Mutter.MetaWindow.is_on_all_workspaces (window.get_meta_window ()) || - window.get_window_type () == Mutter.MetaCompWindowType.DESKTOP || window.get_workspace () == Mutter.MetaWorkspace.index (workspace)) { - if (window.get_window_type () == Mutter.MetaCompWindowType.DOCK) + if (!(window.get_window_type () == Mutter.MetaCompWindowType.NORMAL || + window.get_window_type () == Mutter.MetaCompWindowType.DIALOG || + window.get_window_type () == Mutter.MetaCompWindowType.MODAL_DIALOG || + window.get_window_type () == Mutter.MetaCompWindowType.UTILITY)) continue; ExposeClone clone = new ExposeClone (window); clone.fade_on_close = false; wsp.add_actor (clone); + toplevel_windows.prepend (clone); clone.set_size (window.width, window.height); clone.set_position (window.x, window.y); clone.show (); - - if (window.get_window_type () == Mutter.MetaCompWindowType.DESKTOP) - { - wspclone = clone; - clone.lower_bottom (); - } - else - { - last = clone; - toplevel_windows.prepend (clone); - } } } - - if (last != null && wspclone != null && active_workspace != Mutter.MetaWorkspace.index (workspace)) - last.raise (wspclone); + + ExposeClone background_clone = new ExposeClone (plugin.background); + background_clone.fade_on_close = false; + + wsp.add_actor (background_clone); + background_clone.lower_bottom (); + background_clone.show (); plugin.expose_manager.position_windows_on_grid (toplevel_windows, 50, 50, 50, 50); |
