mirror of
https://github.com/elementary/gala.git
synced 2024-11-26 23:05:09 +03:00
Use explicit Clutter and Meta namespaces
This commit is contained in:
parent
695346006f
commit
9d3adf507e
@ -4,7 +4,7 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class Gala.Plugins.PIP.ShadowEffect : Clutter.Effect {
|
public class Gala.Plugins.PIP.ShadowEffect : Clutter.Effect {
|
||||||
private class Shadow {
|
private class Shadow {
|
||||||
public int users;
|
public int users;
|
||||||
public Cogl.Texture texture;
|
public Cogl.Texture texture;
|
||||||
|
@ -15,8 +15,6 @@
|
|||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
//
|
//
|
||||||
|
|
||||||
using Meta;
|
|
||||||
|
|
||||||
namespace Gala {
|
namespace Gala {
|
||||||
public enum InputArea {
|
public enum InputArea {
|
||||||
NONE,
|
NONE,
|
||||||
@ -26,8 +24,8 @@ namespace Gala {
|
|||||||
|
|
||||||
public class InternalUtils {
|
public class InternalUtils {
|
||||||
public static bool workspaces_only_on_primary () {
|
public static bool workspaces_only_on_primary () {
|
||||||
return Prefs.get_dynamic_workspaces ()
|
return Meta.Prefs.get_dynamic_workspaces ()
|
||||||
&& Prefs.get_workspaces_only_on_primary ();
|
&& Meta.Prefs.get_workspaces_only_on_primary ();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static GLib.Settings? shadow_settings = null;
|
private static GLib.Settings? shadow_settings = null;
|
||||||
@ -38,7 +36,7 @@ namespace Gala {
|
|||||||
if (shadow_settings == null) {
|
if (shadow_settings == null) {
|
||||||
shadow_settings = new GLib.Settings (Config.SCHEMA + ".shadows");
|
shadow_settings = new GLib.Settings (Config.SCHEMA + ".shadows");
|
||||||
}
|
}
|
||||||
var factory = ShadowFactory.get_default ();
|
var factory = Meta.ShadowFactory.get_default ();
|
||||||
Meta.ShadowParams shadow;
|
Meta.ShadowParams shadow;
|
||||||
|
|
||||||
//normal focused
|
//normal focused
|
||||||
@ -91,7 +89,7 @@ namespace Gala {
|
|||||||
/**
|
/**
|
||||||
* set the area where clutter can receive events
|
* set the area where clutter can receive events
|
||||||
**/
|
**/
|
||||||
public static void set_input_area (Display display, InputArea area) {
|
public static void set_input_area (Meta.Display display, InputArea area) {
|
||||||
if (Meta.Util.is_wayland_compositor ()) {
|
if (Meta.Util.is_wayland_compositor ()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -147,13 +145,13 @@ namespace Gala {
|
|||||||
* @param index The index at which to insert the workspace
|
* @param index The index at which to insert the workspace
|
||||||
* @param new_window A window that should be moved to the new workspace
|
* @param new_window A window that should be moved to the new workspace
|
||||||
*/
|
*/
|
||||||
public static void insert_workspace_with_window (int index, Window new_window) {
|
public static void insert_workspace_with_window (int index, Meta.Window new_window) {
|
||||||
unowned WorkspaceManager workspace_manager = WorkspaceManager.get_default ();
|
unowned WorkspaceManager workspace_manager = WorkspaceManager.get_default ();
|
||||||
workspace_manager.freeze_remove ();
|
workspace_manager.freeze_remove ();
|
||||||
|
|
||||||
new_window.change_workspace_by_index (index, false);
|
new_window.change_workspace_by_index (index, false);
|
||||||
|
|
||||||
unowned List<WindowActor> actors = new_window.get_display ().get_window_actors ();
|
unowned List<Meta.WindowActor> actors = new_window.get_display ().get_window_actors ();
|
||||||
foreach (unowned Meta.WindowActor actor in actors) {
|
foreach (unowned Meta.WindowActor actor in actors) {
|
||||||
if (actor.is_destroyed ())
|
if (actor.is_destroyed ())
|
||||||
continue;
|
continue;
|
||||||
|
@ -4,16 +4,13 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using Clutter;
|
|
||||||
using Meta;
|
|
||||||
|
|
||||||
namespace Gala {
|
namespace Gala {
|
||||||
/**
|
/**
|
||||||
* Container for WindowIconActors which takes care of the scaling and positioning.
|
* Container for WindowIconActors which takes care of the scaling and positioning.
|
||||||
* It also decides whether to draw the container shape, a plus sign or an ellipsis.
|
* It also decides whether to draw the container shape, a plus sign or an ellipsis.
|
||||||
* Lastly it also includes the drawing code for the active highlight.
|
* Lastly it also includes the drawing code for the active highlight.
|
||||||
*/
|
*/
|
||||||
public class IconGroup : Actor {
|
public class IconGroup : Clutter.Actor {
|
||||||
public const int SIZE = 64;
|
public const int SIZE = 64;
|
||||||
|
|
||||||
const int PLUS_SIZE = 8;
|
const int PLUS_SIZE = 8;
|
||||||
@ -59,7 +56,7 @@ namespace Gala {
|
|||||||
|
|
||||||
_active = value;
|
_active = value;
|
||||||
|
|
||||||
var transition = new PropertyTransition ("backdrop-opacity") {
|
var transition = new Clutter.PropertyTransition ("backdrop-opacity") {
|
||||||
duration = 300,
|
duration = 300,
|
||||||
remove_on_complete = true
|
remove_on_complete = true
|
||||||
};
|
};
|
||||||
@ -72,20 +69,20 @@ namespace Gala {
|
|||||||
|
|
||||||
DragDropAction drag_action;
|
DragDropAction drag_action;
|
||||||
|
|
||||||
public Workspace workspace { get; construct; }
|
public Meta.Workspace workspace { get; construct; }
|
||||||
|
|
||||||
Actor? prev_parent = null;
|
Clutter.Actor? prev_parent = null;
|
||||||
Actor close_button;
|
Clutter.Actor close_button;
|
||||||
Actor icon_container;
|
Clutter.Actor icon_container;
|
||||||
|
|
||||||
public IconGroup (Workspace workspace) {
|
public IconGroup (Meta.Workspace workspace) {
|
||||||
Object (workspace: workspace);
|
Object (workspace: workspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
construct {
|
construct {
|
||||||
reactive = true;
|
reactive = true;
|
||||||
|
|
||||||
var canvas = new Canvas ();
|
var canvas = new Clutter.Canvas ();
|
||||||
canvas.draw.connect (draw);
|
canvas.draw.connect (draw);
|
||||||
content = canvas;
|
content = canvas;
|
||||||
|
|
||||||
@ -97,7 +94,7 @@ namespace Gala {
|
|||||||
drag_action.notify["dragging"].connect (redraw);
|
drag_action.notify["dragging"].connect (redraw);
|
||||||
add_action (drag_action);
|
add_action (drag_action);
|
||||||
|
|
||||||
icon_container = new Actor ();
|
icon_container = new Clutter.Actor ();
|
||||||
icon_container.width = width;
|
icon_container.width = width;
|
||||||
icon_container.height = height;
|
icon_container.height = height;
|
||||||
|
|
||||||
@ -118,7 +115,7 @@ namespace Gala {
|
|||||||
|
|
||||||
add_child (close_button);
|
add_child (close_button);
|
||||||
|
|
||||||
var close_click = new ClickAction ();
|
var close_click = new Clutter.ClickAction ();
|
||||||
close_click.clicked.connect (close);
|
close_click.clicked.connect (close);
|
||||||
close_button.add_action (close_click);
|
close_button.add_action (close_click);
|
||||||
|
|
||||||
@ -129,13 +126,13 @@ namespace Gala {
|
|||||||
icon_container.actor_removed.disconnect (redraw);
|
icon_container.actor_removed.disconnect (redraw);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool enter_event (CrossingEvent event) {
|
public override bool enter_event (Clutter.CrossingEvent event) {
|
||||||
toggle_close_button (true);
|
toggle_close_button (true);
|
||||||
|
|
||||||
return Gdk.EVENT_PROPAGATE;
|
return Gdk.EVENT_PROPAGATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool leave_event (CrossingEvent event) {
|
public override bool leave_event (Clutter.CrossingEvent event) {
|
||||||
if (!contains (event.related)) {
|
if (!contains (event.related)) {
|
||||||
toggle_close_button (false);
|
toggle_close_button (false);
|
||||||
}
|
}
|
||||||
@ -156,7 +153,7 @@ namespace Gala {
|
|||||||
// or when there are no windows on us. For one, our method for closing
|
// or when there are no windows on us. For one, our method for closing
|
||||||
// wouldn't work anyway without windows and it's also the last workspace
|
// wouldn't work anyway without windows and it's also the last workspace
|
||||||
// which we don't want to have closed if everything went correct
|
// which we don't want to have closed if everything went correct
|
||||||
if (!Prefs.get_dynamic_workspaces () || icon_container.get_n_children () < 1 || drag_action.dragging) {
|
if (!Meta.Prefs.get_dynamic_workspaces () || icon_container.get_n_children () < 1 || drag_action.dragging) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -189,7 +186,7 @@ namespace Gala {
|
|||||||
width = size;
|
width = size;
|
||||||
height = size;
|
height = size;
|
||||||
|
|
||||||
return ((Canvas) content).set_size (size, size);
|
return ((Clutter.Canvas) content).set_size (size, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void place_close_button () {
|
void place_close_button () {
|
||||||
@ -243,7 +240,7 @@ namespace Gala {
|
|||||||
* @param temporary Mark the WindowIconActor as temporary. Used for windows dragged over
|
* @param temporary Mark the WindowIconActor as temporary. Used for windows dragged over
|
||||||
* the group.
|
* the group.
|
||||||
*/
|
*/
|
||||||
public void add_window (Window window, bool no_redraw = false, bool temporary = false) {
|
public void add_window (Meta.Window window, bool no_redraw = false, bool temporary = false) {
|
||||||
var new_window = new WindowIconActor (window);
|
var new_window = new WindowIconActor (window);
|
||||||
|
|
||||||
new_window.save_easing_state ();
|
new_window.save_easing_state ();
|
||||||
@ -263,12 +260,12 @@ namespace Gala {
|
|||||||
*
|
*
|
||||||
* @param animate Whether to fade the icon out before removing it
|
* @param animate Whether to fade the icon out before removing it
|
||||||
*/
|
*/
|
||||||
public void remove_window (Window window, bool animate = true) {
|
public void remove_window (Meta.Window window, bool animate = true) {
|
||||||
foreach (var child in icon_container.get_children ()) {
|
foreach (var child in icon_container.get_children ()) {
|
||||||
unowned WindowIconActor w = (WindowIconActor) child;
|
unowned WindowIconActor w = (WindowIconActor) child;
|
||||||
if (w.window == window) {
|
if (w.window == window) {
|
||||||
if (animate) {
|
if (animate) {
|
||||||
w.set_easing_mode (AnimationMode.LINEAR);
|
w.set_easing_mode (Clutter.AnimationMode.LINEAR);
|
||||||
w.set_easing_duration (200);
|
w.set_easing_duration (200);
|
||||||
w.opacity = 0;
|
w.opacity = 0;
|
||||||
|
|
||||||
@ -293,7 +290,7 @@ namespace Gala {
|
|||||||
/**
|
/**
|
||||||
* Sets a hovered actor for the drag action.
|
* Sets a hovered actor for the drag action.
|
||||||
*/
|
*/
|
||||||
public void set_hovered_actor (Actor actor) {
|
public void set_hovered_actor (Clutter.Actor actor) {
|
||||||
drag_action.hovered = actor;
|
drag_action.hovered = actor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -315,8 +312,8 @@ namespace Gala {
|
|||||||
var time = workspace.get_display ().get_current_time ();
|
var time = workspace.get_display ().get_current_time ();
|
||||||
foreach (var window in workspace.list_windows ()) {
|
foreach (var window in workspace.list_windows ()) {
|
||||||
var type = window.window_type;
|
var type = window.window_type;
|
||||||
if (!window.is_on_all_workspaces () && (type == WindowType.NORMAL
|
if (!window.is_on_all_workspaces () && (type == Meta.WindowType.NORMAL
|
||||||
|| type == WindowType.DIALOG || type == WindowType.MODAL_DIALOG))
|
|| type == Meta.WindowType.DIALOG || type == Meta.WindowType.MODAL_DIALOG))
|
||||||
window.@delete (time);
|
window.@delete (time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -394,7 +391,7 @@ namespace Gala {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (n_windows < 1) {
|
if (n_windows < 1) {
|
||||||
if (!Prefs.get_dynamic_workspaces ()
|
if (!Meta.Prefs.get_dynamic_workspaces ()
|
||||||
|| workspace_index != manager.get_n_workspaces () - 1)
|
|| workspace_index != manager.get_n_workspaces () - 1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -489,12 +486,12 @@ namespace Gala {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Actor? drag_begin (float click_x, float click_y) {
|
Clutter.Actor? drag_begin (float click_x, float click_y) {
|
||||||
toggle_close_button (false);
|
toggle_close_button (false);
|
||||||
|
|
||||||
unowned Meta.WorkspaceManager manager = workspace.get_display ().get_workspace_manager ();
|
unowned Meta.WorkspaceManager manager = workspace.get_display ().get_workspace_manager ();
|
||||||
if (icon_container.get_n_children () < 1 &&
|
if (icon_container.get_n_children () < 1 &&
|
||||||
Prefs.get_dynamic_workspaces () &&
|
Meta.Prefs.get_dynamic_workspaces () &&
|
||||||
workspace.index () == manager.get_n_workspaces () - 1) {
|
workspace.index () == manager.get_n_workspaces () - 1) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -524,7 +521,7 @@ namespace Gala {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void drag_end (Actor destination) {
|
void drag_end (Clutter.Actor destination) {
|
||||||
if (destination is WorkspaceInsertThumb) {
|
if (destination is WorkspaceInsertThumb) {
|
||||||
get_parent ().remove_child (this);
|
get_parent ().remove_child (this);
|
||||||
|
|
||||||
|
@ -15,16 +15,13 @@
|
|||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
//
|
//
|
||||||
|
|
||||||
using Clutter;
|
|
||||||
using Meta;
|
|
||||||
|
|
||||||
namespace Gala {
|
namespace Gala {
|
||||||
/**
|
/**
|
||||||
* This class contains the icon groups at the bottom and will take
|
* This class contains the icon groups at the bottom and will take
|
||||||
* care of displaying actors for inserting windows between the groups
|
* care of displaying actors for inserting windows between the groups
|
||||||
* once implemented
|
* once implemented
|
||||||
*/
|
*/
|
||||||
public class IconGroupContainer : Actor {
|
public class IconGroupContainer : Clutter.Actor {
|
||||||
public const int SPACING = 48;
|
public const int SPACING = 48;
|
||||||
public const int GROUP_WIDTH = 64;
|
public const int GROUP_WIDTH = 64;
|
||||||
|
|
||||||
@ -35,7 +32,7 @@ namespace Gala {
|
|||||||
public IconGroupContainer (Meta.Display display) {
|
public IconGroupContainer (Meta.Display display) {
|
||||||
Object (display: display);
|
Object (display: display);
|
||||||
|
|
||||||
layout_manager = new BoxLayout ();
|
layout_manager = new Clutter.BoxLayout ();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void add_group (IconGroup group) {
|
public void add_group (IconGroup group) {
|
||||||
|
@ -15,9 +15,6 @@
|
|||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
//
|
//
|
||||||
|
|
||||||
using Clutter;
|
|
||||||
using Meta;
|
|
||||||
|
|
||||||
namespace Gala {
|
namespace Gala {
|
||||||
/**
|
/**
|
||||||
* More or less utility class to contain a WindowCloneContainer for each
|
* More or less utility class to contain a WindowCloneContainer for each
|
||||||
@ -26,8 +23,8 @@ namespace Gala {
|
|||||||
* as the WindowGroup is hidden while the view is active. Only used when
|
* as the WindowGroup is hidden while the view is active. Only used when
|
||||||
* workspaces-only-on-primary is set to true.
|
* workspaces-only-on-primary is set to true.
|
||||||
*/
|
*/
|
||||||
public class MonitorClone : Actor {
|
public class MonitorClone : Clutter.Actor {
|
||||||
public signal void window_selected (Window window);
|
public signal void window_selected (Meta.Window window);
|
||||||
|
|
||||||
public Meta.Display display { get; construct; }
|
public Meta.Display display { get; construct; }
|
||||||
public int monitor { get; construct; }
|
public int monitor { get; construct; }
|
||||||
@ -106,15 +103,15 @@ namespace Gala {
|
|||||||
background.opacity = 255;
|
background.opacity = 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
void window_left (int window_monitor, Window window) {
|
void window_left (int window_monitor, Meta.Window window) {
|
||||||
if (window_monitor != monitor)
|
if (window_monitor != monitor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
window_container.remove_window (window);
|
window_container.remove_window (window);
|
||||||
}
|
}
|
||||||
|
|
||||||
void window_entered (int window_monitor, Window window) {
|
void window_entered (int window_monitor, Meta.Window window) {
|
||||||
if (window_monitor != monitor || window.window_type != WindowType.NORMAL)
|
if (window_monitor != monitor || window.window_type != Meta.WindowType.NORMAL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
window_container.add_window (window);
|
window_container.add_window (window);
|
||||||
|
@ -15,16 +15,13 @@
|
|||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
//
|
//
|
||||||
|
|
||||||
using Clutter;
|
|
||||||
using Meta;
|
|
||||||
|
|
||||||
namespace Gala {
|
namespace Gala {
|
||||||
/**
|
/**
|
||||||
* The central class for the MultitaskingView which takes care of
|
* The central class for the MultitaskingView which takes care of
|
||||||
* preparing the wm, opening the components and holds containers for
|
* preparing the wm, opening the components and holds containers for
|
||||||
* the icon groups, the WorkspaceClones and the MonitorClones.
|
* the icon groups, the WorkspaceClones and the MonitorClones.
|
||||||
*/
|
*/
|
||||||
public class MultitaskingView : Actor, ActivatableComponent {
|
public class MultitaskingView : Clutter.Actor, ActivatableComponent {
|
||||||
public const int ANIMATION_DURATION = 250;
|
public const int ANIMATION_DURATION = 250;
|
||||||
private const string OPEN_MULTITASKING_VIEW = "dbus-send --session --dest=org.pantheon.gala --print-reply /org/pantheon/gala org.pantheon.gala.PerformAction int32:1";
|
private const string OPEN_MULTITASKING_VIEW = "dbus-send --session --dest=org.pantheon.gala --print-reply /org/pantheon/gala org.pantheon.gala.PerformAction int32:1";
|
||||||
|
|
||||||
@ -43,8 +40,8 @@ namespace Gala {
|
|||||||
List<MonitorClone> window_containers_monitors;
|
List<MonitorClone> window_containers_monitors;
|
||||||
|
|
||||||
IconGroupContainer icon_groups;
|
IconGroupContainer icon_groups;
|
||||||
Actor workspaces;
|
Clutter.Actor workspaces;
|
||||||
Actor dock_clones;
|
Clutter.Actor dock_clones;
|
||||||
|
|
||||||
private GLib.Settings gala_behavior_settings;
|
private GLib.Settings gala_behavior_settings;
|
||||||
|
|
||||||
@ -71,12 +68,12 @@ namespace Gala {
|
|||||||
workspace_gesture_tracker.enable_scroll (this, Clutter.Orientation.HORIZONTAL);
|
workspace_gesture_tracker.enable_scroll (this, Clutter.Orientation.HORIZONTAL);
|
||||||
workspace_gesture_tracker.on_gesture_detected.connect (on_workspace_gesture_detected);
|
workspace_gesture_tracker.on_gesture_detected.connect (on_workspace_gesture_detected);
|
||||||
|
|
||||||
workspaces = new Actor ();
|
workspaces = new Clutter.Actor ();
|
||||||
workspaces.set_easing_mode (AnimationMode.EASE_OUT_QUAD);
|
workspaces.set_easing_mode (Clutter.AnimationMode.EASE_OUT_QUAD);
|
||||||
|
|
||||||
icon_groups = new IconGroupContainer (display);
|
icon_groups = new IconGroupContainer (display);
|
||||||
|
|
||||||
dock_clones = new Actor ();
|
dock_clones = new Clutter.Actor ();
|
||||||
|
|
||||||
add_child (icon_groups);
|
add_child (icon_groups);
|
||||||
add_child (workspaces);
|
add_child (workspaces);
|
||||||
@ -98,18 +95,18 @@ namespace Gala {
|
|||||||
update_monitors ();
|
update_monitors ();
|
||||||
Meta.MonitorManager.@get ().monitors_changed.connect (update_monitors);
|
Meta.MonitorManager.@get ().monitors_changed.connect (update_monitors);
|
||||||
|
|
||||||
Prefs.add_listener ((pref) => {
|
Meta.Prefs.add_listener ((pref) => {
|
||||||
if (pref == Preference.WORKSPACES_ONLY_ON_PRIMARY) {
|
if (pref == Meta.Preference.WORKSPACES_ONLY_ON_PRIMARY) {
|
||||||
update_monitors ();
|
update_monitors ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Prefs.get_dynamic_workspaces () ||
|
if (Meta.Prefs.get_dynamic_workspaces () ||
|
||||||
(pref != Preference.DYNAMIC_WORKSPACES && pref != Preference.NUM_WORKSPACES))
|
(pref != Meta.Preference.DYNAMIC_WORKSPACES && pref != Meta.Preference.NUM_WORKSPACES))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Idle.add (() => {
|
Idle.add (() => {
|
||||||
unowned List<Workspace> existing_workspaces = null;
|
unowned List<Meta.Workspace> existing_workspaces = null;
|
||||||
for (int i = 0; i < manager.get_n_workspaces (); i++) {
|
for (int i = 0; i < manager.get_n_workspaces (); i++) {
|
||||||
existing_workspaces.append (manager.get_workspace_by_index (i));
|
existing_workspaces.append (manager.get_workspace_by_index (i));
|
||||||
}
|
}
|
||||||
@ -173,27 +170,27 @@ namespace Gala {
|
|||||||
* Scroll through workspaces with the mouse wheel. Smooth scrolling is handled by
|
* Scroll through workspaces with the mouse wheel. Smooth scrolling is handled by
|
||||||
* GestureTracker.
|
* GestureTracker.
|
||||||
*/
|
*/
|
||||||
public override bool scroll_event (ScrollEvent scroll_event) {
|
public override bool scroll_event (Clutter.ScrollEvent scroll_event) {
|
||||||
if (!opened) {
|
if (!opened) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scroll_event.direction == ScrollDirection.SMOOTH ||
|
if (scroll_event.direction == Clutter.ScrollDirection.SMOOTH ||
|
||||||
scroll_event.scroll_source == ScrollSource.FINGER ||
|
scroll_event.scroll_source == Clutter.ScrollSource.FINGER ||
|
||||||
scroll_event.get_source_device ().get_device_type () == Clutter.InputDeviceType.TOUCHPAD_DEVICE) {
|
scroll_event.get_source_device ().get_device_type () == Clutter.InputDeviceType.TOUCHPAD_DEVICE) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Meta.MotionDirection direction;
|
Meta.MotionDirection direction;
|
||||||
switch (scroll_event.direction) {
|
switch (scroll_event.direction) {
|
||||||
case ScrollDirection.UP:
|
case Clutter.ScrollDirection.UP:
|
||||||
case ScrollDirection.LEFT:
|
case Clutter.ScrollDirection.LEFT:
|
||||||
direction = MotionDirection.LEFT;
|
direction = Meta.MotionDirection.LEFT;
|
||||||
break;
|
break;
|
||||||
case ScrollDirection.DOWN:
|
case Clutter.ScrollDirection.DOWN:
|
||||||
case ScrollDirection.RIGHT:
|
case Clutter.ScrollDirection.RIGHT:
|
||||||
default:
|
default:
|
||||||
direction = MotionDirection.RIGHT;
|
direction = Meta.MotionDirection.RIGHT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -387,7 +384,7 @@ namespace Gala {
|
|||||||
|
|
||||||
if (animate) {
|
if (animate) {
|
||||||
icon_groups.save_easing_state ();
|
icon_groups.save_easing_state ();
|
||||||
icon_groups.set_easing_mode (AnimationMode.EASE_OUT_QUAD);
|
icon_groups.set_easing_mode (Clutter.AnimationMode.EASE_OUT_QUAD);
|
||||||
icon_groups.set_easing_duration (200);
|
icon_groups.set_easing_duration (200);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -424,7 +421,7 @@ namespace Gala {
|
|||||||
|
|
||||||
// FIXME is there a better way to get the removed workspace?
|
// FIXME is there a better way to get the removed workspace?
|
||||||
unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
|
unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
|
||||||
List<Workspace> existing_workspaces = null;
|
List<Meta.Workspace> existing_workspaces = null;
|
||||||
for (int i = 0; i < manager.get_n_workspaces (); i++) {
|
for (int i = 0; i < manager.get_n_workspaces (); i++) {
|
||||||
existing_workspaces.append (manager.get_workspace_by_index (i));
|
existing_workspaces.append (manager.get_workspace_by_index (i));
|
||||||
}
|
}
|
||||||
@ -483,16 +480,16 @@ namespace Gala {
|
|||||||
toggle ();
|
toggle ();
|
||||||
break;
|
break;
|
||||||
case Clutter.Key.Down:
|
case Clutter.Key.Down:
|
||||||
select_window (MotionDirection.DOWN);
|
select_window (Meta.MotionDirection.DOWN);
|
||||||
break;
|
break;
|
||||||
case Clutter.Key.Up:
|
case Clutter.Key.Up:
|
||||||
select_window (MotionDirection.UP);
|
select_window (Meta.MotionDirection.UP);
|
||||||
break;
|
break;
|
||||||
case Clutter.Key.Left:
|
case Clutter.Key.Left:
|
||||||
select_window (MotionDirection.LEFT);
|
select_window (Meta.MotionDirection.LEFT);
|
||||||
break;
|
break;
|
||||||
case Clutter.Key.Right:
|
case Clutter.Key.Right:
|
||||||
select_window (MotionDirection.RIGHT);
|
select_window (Meta.MotionDirection.RIGHT);
|
||||||
break;
|
break;
|
||||||
case Clutter.Key.Return:
|
case Clutter.Key.Return:
|
||||||
case Clutter.Key.KP_Enter:
|
case Clutter.Key.KP_Enter:
|
||||||
@ -512,7 +509,7 @@ namespace Gala {
|
|||||||
*
|
*
|
||||||
* @param direction The direction in which to move the focus to
|
* @param direction The direction in which to move the focus to
|
||||||
*/
|
*/
|
||||||
void select_window (MotionDirection direction) {
|
void select_window (Meta.MotionDirection direction) {
|
||||||
get_active_workspace_clone ().window_container.select_next_window (direction);
|
get_active_workspace_clone ().window_container.select_next_window (direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -697,7 +694,7 @@ namespace Gala {
|
|||||||
unowned Meta.Window window = actor.get_meta_window ();
|
unowned Meta.Window window = actor.get_meta_window ();
|
||||||
var monitor = window.get_monitor ();
|
var monitor = window.get_monitor ();
|
||||||
|
|
||||||
if (window.window_type != WindowType.DOCK)
|
if (window.window_type != Meta.WindowType.DOCK)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (display.get_monitor_in_fullscreen (monitor))
|
if (display.get_monitor_in_fullscreen (monitor))
|
||||||
@ -723,7 +720,7 @@ namespace Gala {
|
|||||||
|
|
||||||
GestureTracker.OnBegin on_animation_begin = () => {
|
GestureTracker.OnBegin on_animation_begin = () => {
|
||||||
clone.set_position (initial_x, initial_y);
|
clone.set_position (initial_x, initial_y);
|
||||||
clone.set_easing_mode (AnimationMode.LINEAR);
|
clone.set_easing_mode (Clutter.AnimationMode.LINEAR);
|
||||||
};
|
};
|
||||||
|
|
||||||
GestureTracker.OnUpdate on_animation_update = (percentage) => {
|
GestureTracker.OnUpdate on_animation_update = (percentage) => {
|
||||||
@ -732,7 +729,7 @@ namespace Gala {
|
|||||||
};
|
};
|
||||||
|
|
||||||
GestureTracker.OnEnd on_animation_end = (percentage, cancel_action) => {
|
GestureTracker.OnEnd on_animation_end = (percentage, cancel_action) => {
|
||||||
clone.set_easing_mode (AnimationMode.EASE_OUT_QUAD);
|
clone.set_easing_mode (Clutter.AnimationMode.EASE_OUT_QUAD);
|
||||||
|
|
||||||
if (cancel_action) {
|
if (cancel_action) {
|
||||||
return;
|
return;
|
||||||
@ -753,7 +750,7 @@ namespace Gala {
|
|||||||
|
|
||||||
void hide_docks (bool with_gesture, bool is_cancel_animation) {
|
void hide_docks (bool with_gesture, bool is_cancel_animation) {
|
||||||
foreach (var child in dock_clones.get_children ()) {
|
foreach (var child in dock_clones.get_children ()) {
|
||||||
var dock = (Clone) child;
|
var dock = (Clutter.Clone) child;
|
||||||
var initial_y = dock.y;
|
var initial_y = dock.y;
|
||||||
var target_y = dock.source.y;
|
var target_y = dock.source.y;
|
||||||
|
|
||||||
@ -768,7 +765,7 @@ namespace Gala {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dock.set_easing_duration (ANIMATION_DURATION);
|
dock.set_easing_duration (ANIMATION_DURATION);
|
||||||
dock.set_easing_mode (AnimationMode.EASE_OUT_QUAD);
|
dock.set_easing_mode (Clutter.AnimationMode.EASE_OUT_QUAD);
|
||||||
dock.y = target_y;
|
dock.y = target_y;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -780,32 +777,32 @@ namespace Gala {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool keybinding_filter (KeyBinding binding) {
|
private bool keybinding_filter (Meta.KeyBinding binding) {
|
||||||
var action = Prefs.get_keybinding_action (binding.get_name ());
|
var action = Meta.Prefs.get_keybinding_action (binding.get_name ());
|
||||||
|
|
||||||
// allow super key only when it toggles multitasking view
|
// allow super key only when it toggles multitasking view
|
||||||
if (action == KeyBindingAction.OVERLAY_KEY &&
|
if (action == Meta.KeyBindingAction.OVERLAY_KEY &&
|
||||||
gala_behavior_settings.get_string ("overlay-action") == OPEN_MULTITASKING_VIEW) {
|
gala_behavior_settings.get_string ("overlay-action") == OPEN_MULTITASKING_VIEW) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case KeyBindingAction.WORKSPACE_1:
|
case Meta.KeyBindingAction.WORKSPACE_1:
|
||||||
case KeyBindingAction.WORKSPACE_2:
|
case Meta.KeyBindingAction.WORKSPACE_2:
|
||||||
case KeyBindingAction.WORKSPACE_3:
|
case Meta.KeyBindingAction.WORKSPACE_3:
|
||||||
case KeyBindingAction.WORKSPACE_4:
|
case Meta.KeyBindingAction.WORKSPACE_4:
|
||||||
case KeyBindingAction.WORKSPACE_5:
|
case Meta.KeyBindingAction.WORKSPACE_5:
|
||||||
case KeyBindingAction.WORKSPACE_6:
|
case Meta.KeyBindingAction.WORKSPACE_6:
|
||||||
case KeyBindingAction.WORKSPACE_7:
|
case Meta.KeyBindingAction.WORKSPACE_7:
|
||||||
case KeyBindingAction.WORKSPACE_8:
|
case Meta.KeyBindingAction.WORKSPACE_8:
|
||||||
case KeyBindingAction.WORKSPACE_9:
|
case Meta.KeyBindingAction.WORKSPACE_9:
|
||||||
case KeyBindingAction.WORKSPACE_10:
|
case Meta.KeyBindingAction.WORKSPACE_10:
|
||||||
case KeyBindingAction.WORKSPACE_11:
|
case Meta.KeyBindingAction.WORKSPACE_11:
|
||||||
case KeyBindingAction.WORKSPACE_12:
|
case Meta.KeyBindingAction.WORKSPACE_12:
|
||||||
case KeyBindingAction.WORKSPACE_LEFT:
|
case Meta.KeyBindingAction.WORKSPACE_LEFT:
|
||||||
case KeyBindingAction.WORKSPACE_RIGHT:
|
case Meta.KeyBindingAction.WORKSPACE_RIGHT:
|
||||||
case KeyBindingAction.SHOW_DESKTOP:
|
case Meta.KeyBindingAction.SHOW_DESKTOP:
|
||||||
case KeyBindingAction.NONE:
|
case Meta.KeyBindingAction.NONE:
|
||||||
return false;
|
return false;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -15,8 +15,6 @@
|
|||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
//
|
//
|
||||||
|
|
||||||
using Meta;
|
|
||||||
|
|
||||||
namespace Gala {
|
namespace Gala {
|
||||||
/**
|
/**
|
||||||
* A clone for a MetaWindowActor that will guard against the
|
* A clone for a MetaWindowActor that will guard against the
|
||||||
@ -24,7 +22,7 @@ namespace Gala {
|
|||||||
* as soon as it gets unavailable.
|
* as soon as it gets unavailable.
|
||||||
*/
|
*/
|
||||||
public class SafeWindowClone : Clutter.Clone {
|
public class SafeWindowClone : Clutter.Clone {
|
||||||
public Window window { get; construct; }
|
public Meta.Window window { get; construct; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If set to true, the SafeWindowClone will destroy itself when the connected
|
* If set to true, the SafeWindowClone will destroy itself when the connected
|
||||||
@ -38,8 +36,8 @@ namespace Gala {
|
|||||||
* @param window The window to clone from
|
* @param window The window to clone from
|
||||||
* @param destroy_on_unmanaged see destroy_on_unmanaged property
|
* @param destroy_on_unmanaged see destroy_on_unmanaged property
|
||||||
*/
|
*/
|
||||||
public SafeWindowClone (Window window, bool destroy_on_unmanaged = false) {
|
public SafeWindowClone (Meta.Window window, bool destroy_on_unmanaged = false) {
|
||||||
var actor = (WindowActor) window.get_compositor_private ();
|
var actor = (Meta.WindowActor) window.get_compositor_private ();
|
||||||
|
|
||||||
Object (window: window,
|
Object (window: window,
|
||||||
source: actor,
|
source: actor,
|
||||||
|
@ -15,15 +15,12 @@
|
|||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
//
|
//
|
||||||
|
|
||||||
using Clutter;
|
|
||||||
using Meta;
|
|
||||||
|
|
||||||
namespace Gala {
|
namespace Gala {
|
||||||
/**
|
/**
|
||||||
* Container which controls the layout of a set of WindowClones.
|
* Container which controls the layout of a set of WindowClones.
|
||||||
*/
|
*/
|
||||||
public class WindowCloneContainer : Actor {
|
public class WindowCloneContainer : Clutter.Actor {
|
||||||
public signal void window_selected (Window window);
|
public signal void window_selected (Meta.Window window);
|
||||||
|
|
||||||
public int padding_top { get; set; default = 12; }
|
public int padding_top { get; set; default = 12; }
|
||||||
public int padding_left { get; set; default = 12; }
|
public int padding_left { get; set; default = 12; }
|
||||||
@ -55,12 +52,12 @@ namespace Gala {
|
|||||||
*
|
*
|
||||||
* @param window The window for which to create the WindowClone for
|
* @param window The window for which to create the WindowClone for
|
||||||
*/
|
*/
|
||||||
public void add_window (Window window) {
|
public void add_window (Meta.Window window) {
|
||||||
unowned Meta.Display display = window.get_display ();
|
unowned Meta.Display display = window.get_display ();
|
||||||
var children = get_children ();
|
var children = get_children ();
|
||||||
|
|
||||||
GLib.SList<Meta.Window> windows = new GLib.SList<Meta.Window> ();
|
GLib.SList<Meta.Window> windows = new GLib.SList<Meta.Window> ();
|
||||||
foreach (unowned Actor child in children) {
|
foreach (unowned Clutter.Actor child in children) {
|
||||||
unowned WindowClone tw = (WindowClone) child;
|
unowned WindowClone tw = (WindowClone) child;
|
||||||
windows.prepend (tw.window);
|
windows.prepend (tw.window);
|
||||||
}
|
}
|
||||||
@ -85,7 +82,7 @@ namespace Gala {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (unowned Actor child in children) {
|
foreach (unowned Clutter.Actor child in children) {
|
||||||
unowned WindowClone tw = (WindowClone) child;
|
unowned WindowClone tw = (WindowClone) child;
|
||||||
if (target == tw.window) {
|
if (target == tw.window) {
|
||||||
insert_child_above (new_window, tw);
|
insert_child_above (new_window, tw);
|
||||||
@ -104,7 +101,7 @@ namespace Gala {
|
|||||||
/**
|
/**
|
||||||
* Find and remove the WindowClone for a MetaWindow
|
* Find and remove the WindowClone for a MetaWindow
|
||||||
*/
|
*/
|
||||||
public void remove_window (Window window) {
|
public void remove_window (Meta.Window window) {
|
||||||
foreach (var child in get_children ()) {
|
foreach (var child in get_children ()) {
|
||||||
if (((WindowClone) child).window == window) {
|
if (((WindowClone) child).window == window) {
|
||||||
remove_child (child);
|
remove_child (child);
|
||||||
@ -118,7 +115,7 @@ namespace Gala {
|
|||||||
window_selected (tiled.window);
|
window_selected (tiled.window);
|
||||||
}
|
}
|
||||||
|
|
||||||
void window_destroyed (Actor actor) {
|
void window_destroyed (Clutter.Actor actor) {
|
||||||
var window = actor as WindowClone;
|
var window = actor as WindowClone;
|
||||||
if (window == null)
|
if (window == null)
|
||||||
return;
|
return;
|
||||||
@ -140,7 +137,7 @@ namespace Gala {
|
|||||||
var children = get_children ();
|
var children = get_children ();
|
||||||
|
|
||||||
GLib.SList<Meta.Window> windows = new GLib.SList<Meta.Window> ();
|
GLib.SList<Meta.Window> windows = new GLib.SList<Meta.Window> ();
|
||||||
foreach (unowned Actor child in children) {
|
foreach (unowned Clutter.Actor child in children) {
|
||||||
unowned WindowClone tw = (WindowClone) child;
|
unowned WindowClone tw = (WindowClone) child;
|
||||||
windows.prepend (tw.window);
|
windows.prepend (tw.window);
|
||||||
}
|
}
|
||||||
@ -150,7 +147,7 @@ namespace Gala {
|
|||||||
|
|
||||||
foreach (unowned Meta.Window window in windows_ordered) {
|
foreach (unowned Meta.Window window in windows_ordered) {
|
||||||
var i = 0;
|
var i = 0;
|
||||||
foreach (unowned Actor child in children) {
|
foreach (unowned Clutter.Actor child in children) {
|
||||||
if (((WindowClone) child).window == window) {
|
if (((WindowClone) child).window == window) {
|
||||||
set_child_at_index (child, i);
|
set_child_at_index (child, i);
|
||||||
children.remove (child);
|
children.remove (child);
|
||||||
@ -209,7 +206,7 @@ namespace Gala {
|
|||||||
*
|
*
|
||||||
* @param direction The MetaMotionDirection in which to search for windows for.
|
* @param direction The MetaMotionDirection in which to search for windows for.
|
||||||
*/
|
*/
|
||||||
public void select_next_window (MotionDirection direction) {
|
public void select_next_window (Meta.MotionDirection direction) {
|
||||||
if (get_n_children () < 1)
|
if (get_n_children () < 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -228,7 +225,7 @@ namespace Gala {
|
|||||||
var window_rect = ((WindowClone) window).slot;
|
var window_rect = ((WindowClone) window).slot;
|
||||||
|
|
||||||
switch (direction) {
|
switch (direction) {
|
||||||
case MotionDirection.LEFT:
|
case Meta.MotionDirection.LEFT:
|
||||||
if (window_rect.x > current_rect.x)
|
if (window_rect.x > current_rect.x)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -241,7 +238,7 @@ namespace Gala {
|
|||||||
closest = (WindowClone) window;
|
closest = (WindowClone) window;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MotionDirection.RIGHT:
|
case Meta.MotionDirection.RIGHT:
|
||||||
if (window_rect.x < current_rect.x)
|
if (window_rect.x < current_rect.x)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -254,7 +251,7 @@ namespace Gala {
|
|||||||
closest = (WindowClone) window;
|
closest = (WindowClone) window;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MotionDirection.UP:
|
case Meta.MotionDirection.UP:
|
||||||
if (window_rect.y > current_rect.y)
|
if (window_rect.y > current_rect.y)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -267,7 +264,7 @@ namespace Gala {
|
|||||||
closest = (WindowClone) window;
|
closest = (WindowClone) window;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MotionDirection.DOWN:
|
case Meta.MotionDirection.DOWN:
|
||||||
if (window_rect.y < current_rect.y)
|
if (window_rect.y < current_rect.y)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -308,7 +305,7 @@ namespace Gala {
|
|||||||
/**
|
/**
|
||||||
* When opened the WindowClones are animated to a tiled layout
|
* When opened the WindowClones are animated to a tiled layout
|
||||||
*/
|
*/
|
||||||
public void open (Window? selected_window = null, bool with_gesture = false, bool is_cancel_animation = false) {
|
public void open (Meta.Window? selected_window = null, bool with_gesture = false, bool is_cancel_animation = false) {
|
||||||
if (opened) {
|
if (opened) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -15,17 +15,14 @@
|
|||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
//
|
//
|
||||||
|
|
||||||
using Clutter;
|
|
||||||
using Meta;
|
|
||||||
|
|
||||||
namespace Gala {
|
namespace Gala {
|
||||||
/**
|
/**
|
||||||
* Private class which is basically just a container for the actual
|
* Private class which is basically just a container for the actual
|
||||||
* icon and takes care of blending the same icon in different sizes
|
* icon and takes care of blending the same icon in different sizes
|
||||||
* over each other and various animations related to the icons
|
* over each other and various animations related to the icons
|
||||||
*/
|
*/
|
||||||
public class WindowIconActor : Actor {
|
public class WindowIconActor : Clutter.Actor {
|
||||||
public Window window { get; construct; }
|
public Meta.Window window { get; construct; }
|
||||||
|
|
||||||
int icon_scale;
|
int icon_scale;
|
||||||
|
|
||||||
@ -68,24 +65,24 @@ namespace Gala {
|
|||||||
if (_temporary && !value) {
|
if (_temporary && !value) {
|
||||||
remove_transition ("pulse");
|
remove_transition ("pulse");
|
||||||
} else if (!_temporary && value) {
|
} else if (!_temporary && value) {
|
||||||
var transition = new TransitionGroup () {
|
var transition = new Clutter.TransitionGroup () {
|
||||||
duration = 800,
|
duration = 800,
|
||||||
auto_reverse = true,
|
auto_reverse = true,
|
||||||
repeat_count = -1,
|
repeat_count = -1,
|
||||||
progress_mode = AnimationMode.LINEAR
|
progress_mode = Clutter.AnimationMode.LINEAR
|
||||||
};
|
};
|
||||||
|
|
||||||
var opacity_transition = new PropertyTransition ("opacity");
|
var opacity_transition = new Clutter.PropertyTransition ("opacity");
|
||||||
opacity_transition.set_from_value (100);
|
opacity_transition.set_from_value (100);
|
||||||
opacity_transition.set_to_value (255);
|
opacity_transition.set_to_value (255);
|
||||||
opacity_transition.auto_reverse = true;
|
opacity_transition.auto_reverse = true;
|
||||||
|
|
||||||
var scale_x_transition = new PropertyTransition ("scale-x");
|
var scale_x_transition = new Clutter.PropertyTransition ("scale-x");
|
||||||
scale_x_transition.set_from_value (0.8);
|
scale_x_transition.set_from_value (0.8);
|
||||||
scale_x_transition.set_to_value (1.1);
|
scale_x_transition.set_to_value (1.1);
|
||||||
scale_x_transition.auto_reverse = true;
|
scale_x_transition.auto_reverse = true;
|
||||||
|
|
||||||
var scale_y_transition = new PropertyTransition ("scale-y");
|
var scale_y_transition = new Clutter.PropertyTransition ("scale-y");
|
||||||
scale_y_transition.set_from_value (0.8);
|
scale_y_transition.set_from_value (0.8);
|
||||||
scale_y_transition.set_to_value (1.1);
|
scale_y_transition.set_to_value (1.1);
|
||||||
scale_y_transition.auto_reverse = true;
|
scale_y_transition.auto_reverse = true;
|
||||||
@ -106,13 +103,13 @@ namespace Gala {
|
|||||||
WindowIcon? icon = null;
|
WindowIcon? icon = null;
|
||||||
WindowIcon? old_icon = null;
|
WindowIcon? old_icon = null;
|
||||||
|
|
||||||
public WindowIconActor (Window window) {
|
public WindowIconActor (Meta.Window window) {
|
||||||
Object (window: window);
|
Object (window: window);
|
||||||
}
|
}
|
||||||
|
|
||||||
construct {
|
construct {
|
||||||
set_pivot_point (0.5f, 0.5f);
|
set_pivot_point (0.5f, 0.5f);
|
||||||
set_easing_mode (AnimationMode.EASE_OUT_ELASTIC);
|
set_easing_mode (Clutter.AnimationMode.EASE_OUT_ELASTIC);
|
||||||
set_easing_duration (800);
|
set_easing_duration (800);
|
||||||
|
|
||||||
window.notify["on-all-workspaces"].connect (on_all_workspaces_changed);
|
window.notify["on-all-workspaces"].connect (on_all_workspaces_changed);
|
||||||
@ -157,12 +154,12 @@ namespace Gala {
|
|||||||
void fade_new_icon () {
|
void fade_new_icon () {
|
||||||
var scale = InternalUtils.get_ui_scaling_factor ();
|
var scale = InternalUtils.get_ui_scaling_factor ();
|
||||||
var new_icon = new WindowIcon (window, icon_size, scale);
|
var new_icon = new WindowIcon (window, icon_size, scale);
|
||||||
new_icon.add_constraint (new BindConstraint (this, BindCoordinate.SIZE, 0));
|
new_icon.add_constraint (new Clutter.BindConstraint (this, Clutter.BindCoordinate.SIZE, 0));
|
||||||
new_icon.opacity = 0;
|
new_icon.opacity = 0;
|
||||||
|
|
||||||
add_child (new_icon);
|
add_child (new_icon);
|
||||||
|
|
||||||
new_icon.set_easing_mode (AnimationMode.EASE_OUT_QUAD);
|
new_icon.set_easing_mode (Clutter.AnimationMode.EASE_OUT_QUAD);
|
||||||
new_icon.set_easing_duration (500);
|
new_icon.set_easing_duration (500);
|
||||||
|
|
||||||
if (icon == null) {
|
if (icon == null) {
|
||||||
|
@ -15,9 +15,6 @@
|
|||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
//
|
//
|
||||||
|
|
||||||
using Meta;
|
|
||||||
using Clutter;
|
|
||||||
|
|
||||||
namespace Gala {
|
namespace Gala {
|
||||||
|
|
||||||
public enum WindowOverviewType {
|
public enum WindowOverviewType {
|
||||||
@ -25,9 +22,9 @@ namespace Gala {
|
|||||||
NATURAL
|
NATURAL
|
||||||
}
|
}
|
||||||
|
|
||||||
public delegate void WindowPlacer (Actor window, Meta.Rectangle rect);
|
public delegate void WindowPlacer (Clutter.Actor window, Meta.Rectangle rect);
|
||||||
|
|
||||||
public class WindowOverview : Actor, ActivatableComponent {
|
public class WindowOverview : Clutter.Actor, ActivatableComponent {
|
||||||
const int BORDER = 10;
|
const int BORDER = 10;
|
||||||
const int TOP_GAP = 30;
|
const int TOP_GAP = 30;
|
||||||
const int BOTTOM_GAP = 100;
|
const int BOTTOM_GAP = 100;
|
||||||
@ -39,7 +36,7 @@ namespace Gala {
|
|||||||
bool ready;
|
bool ready;
|
||||||
|
|
||||||
// the workspaces which we expose right now
|
// the workspaces which we expose right now
|
||||||
List<Workspace> workspaces;
|
List<Meta.Workspace> workspaces;
|
||||||
|
|
||||||
public WindowOverview (WindowManager wm) {
|
public WindowOverview (WindowManager wm) {
|
||||||
Object (wm : wm);
|
Object (wm : wm);
|
||||||
@ -103,9 +100,9 @@ namespace Gala {
|
|||||||
|
|
||||||
var all_windows = hints != null && "all-windows" in hints;
|
var all_windows = hints != null && "all-windows" in hints;
|
||||||
|
|
||||||
var used_windows = new SList<Window> ();
|
var used_windows = new SList<Meta.Window> ();
|
||||||
|
|
||||||
workspaces = new List<Workspace> ();
|
workspaces = new List<Meta.Workspace> ();
|
||||||
|
|
||||||
unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
|
unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
|
||||||
if (all_windows) {
|
if (all_windows) {
|
||||||
@ -118,16 +115,16 @@ namespace Gala {
|
|||||||
|
|
||||||
foreach (var workspace in workspaces) {
|
foreach (var workspace in workspaces) {
|
||||||
foreach (var window in workspace.list_windows ()) {
|
foreach (var window in workspace.list_windows ()) {
|
||||||
if (window.window_type != WindowType.NORMAL &&
|
if (window.window_type != Meta.WindowType.NORMAL &&
|
||||||
window.window_type != WindowType.DOCK &&
|
window.window_type != Meta.WindowType.DOCK &&
|
||||||
window.window_type != WindowType.DIALOG ||
|
window.window_type != Meta.WindowType.DIALOG ||
|
||||||
window.is_attached_dialog ()) {
|
window.is_attached_dialog ()) {
|
||||||
var actor = window.get_compositor_private () as WindowActor;
|
var actor = window.get_compositor_private () as Meta.WindowActor;
|
||||||
if (actor != null)
|
if (actor != null)
|
||||||
actor.hide ();
|
actor.hide ();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (window.window_type == WindowType.DOCK)
|
if (window.window_type == Meta.WindowType.DOCK)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// skip windows that are on all workspace except we're currently
|
// skip windows that are on all workspace except we're currently
|
||||||
@ -179,7 +176,7 @@ namespace Gala {
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach (var window in windows) {
|
foreach (var window in windows) {
|
||||||
unowned WindowActor actor = window.get_compositor_private () as WindowActor;
|
unowned Meta.WindowActor actor = window.get_compositor_private () as Meta.WindowActor;
|
||||||
if (actor != null)
|
if (actor != null)
|
||||||
actor.hide ();
|
actor.hide ();
|
||||||
|
|
||||||
@ -196,17 +193,17 @@ namespace Gala {
|
|||||||
ready = true;
|
ready = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool keybinding_filter (KeyBinding binding) {
|
bool keybinding_filter (Meta.KeyBinding binding) {
|
||||||
var name = binding.get_name ();
|
var name = binding.get_name ();
|
||||||
return (name != "expose-windows" && name != "expose-all-windows");
|
return (name != "expose-windows" && name != "expose-all-windows");
|
||||||
}
|
}
|
||||||
|
|
||||||
void restack_windows (Display display) {
|
void restack_windows (Meta.Display display) {
|
||||||
foreach (var child in get_children ())
|
foreach (var child in get_children ())
|
||||||
((WindowCloneContainer) child).restack_windows (display);
|
((WindowCloneContainer) child).restack_windows (display);
|
||||||
}
|
}
|
||||||
|
|
||||||
void window_left_monitor (int num, Window window) {
|
void window_left_monitor (int num, Meta.Window window) {
|
||||||
unowned WindowCloneContainer container = get_child_at_index (num) as WindowCloneContainer;
|
unowned WindowCloneContainer container = get_child_at_index (num) as WindowCloneContainer;
|
||||||
if (container == null)
|
if (container == null)
|
||||||
return;
|
return;
|
||||||
@ -219,9 +216,9 @@ namespace Gala {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void add_window (Window window) {
|
void add_window (Meta.Window window) {
|
||||||
if (!visible
|
if (!visible
|
||||||
|| (window.window_type != WindowType.NORMAL && window.window_type != WindowType.DIALOG))
|
|| (window.window_type != Meta.WindowType.NORMAL && window.window_type != Meta.WindowType.DIALOG))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
unowned WindowCloneContainer container = get_child_at_index (window.get_monitor ()) as WindowCloneContainer;
|
unowned WindowCloneContainer container = get_child_at_index (window.get_monitor ()) as WindowCloneContainer;
|
||||||
@ -236,7 +233,7 @@ namespace Gala {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void remove_window (Window window) {
|
void remove_window (Meta.Window window) {
|
||||||
unowned WindowCloneContainer container = get_child_at_index (window.get_monitor ()) as WindowCloneContainer;
|
unowned WindowCloneContainer container = get_child_at_index (window.get_monitor ()) as WindowCloneContainer;
|
||||||
if (container == null)
|
if (container == null)
|
||||||
return;
|
return;
|
||||||
@ -244,7 +241,7 @@ namespace Gala {
|
|||||||
container.remove_window (window);
|
container.remove_window (window);
|
||||||
}
|
}
|
||||||
|
|
||||||
void thumb_selected (Window window) {
|
void thumb_selected (Meta.Window window) {
|
||||||
if (window.get_workspace () == display.get_workspace_manager ().get_active_workspace ()) {
|
if (window.get_workspace () == display.get_workspace_manager ().get_active_workspace ()) {
|
||||||
window.activate (display.get_current_time ());
|
window.activate (display.get_current_time ());
|
||||||
close ();
|
close ();
|
||||||
@ -292,7 +289,7 @@ namespace Gala {
|
|||||||
|
|
||||||
foreach (var window in display.get_workspace_manager ().get_active_workspace ().list_windows ())
|
foreach (var window in display.get_workspace_manager ().get_active_workspace ().list_windows ())
|
||||||
if (window.showing_on_its_workspace ())
|
if (window.showing_on_its_workspace ())
|
||||||
((Actor) window.get_compositor_private ()).show ();
|
((Clutter.Actor) window.get_compositor_private ()).show ();
|
||||||
|
|
||||||
destroy_all_children ();
|
destroy_all_children ();
|
||||||
}
|
}
|
||||||
|
@ -15,9 +15,6 @@
|
|||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
//
|
//
|
||||||
|
|
||||||
using Clutter;
|
|
||||||
using Meta;
|
|
||||||
|
|
||||||
namespace Gala {
|
namespace Gala {
|
||||||
/**
|
/**
|
||||||
* Utility class which adds a border and a shadow to a Background
|
* Utility class which adds a border and a shadow to a Background
|
||||||
@ -30,7 +27,7 @@ namespace Gala {
|
|||||||
private int last_width;
|
private int last_width;
|
||||||
private int last_height;
|
private int last_height;
|
||||||
|
|
||||||
public FramedBackground (Display display) {
|
public FramedBackground (Meta.Display display) {
|
||||||
Object (display: display, monitor_index: display.get_primary_monitor (), control_position: false);
|
Object (display: display, monitor_index: display.get_primary_monitor (), control_position: false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,7 +114,7 @@ namespace Gala {
|
|||||||
* The latter is not added to the WorkspaceClone itself though but to a container
|
* The latter is not added to the WorkspaceClone itself though but to a container
|
||||||
* of the MultitaskingView.
|
* of the MultitaskingView.
|
||||||
*/
|
*/
|
||||||
public class WorkspaceClone : Actor {
|
public class WorkspaceClone : Clutter.Actor {
|
||||||
/**
|
/**
|
||||||
* The offset of the scaled background to the bottom of the monitor bounds
|
* The offset of the scaled background to the bottom of the monitor bounds
|
||||||
*/
|
*/
|
||||||
@ -144,7 +141,7 @@ namespace Gala {
|
|||||||
* A window has been selected, the MultitaskingView should consider activating
|
* A window has been selected, the MultitaskingView should consider activating
|
||||||
* and closing the view.
|
* and closing the view.
|
||||||
*/
|
*/
|
||||||
public signal void window_selected (Window window);
|
public signal void window_selected (Meta.Window window);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The background has been selected. Switch to that workspace.
|
* The background has been selected. Switch to that workspace.
|
||||||
@ -154,7 +151,7 @@ namespace Gala {
|
|||||||
*/
|
*/
|
||||||
public signal void selected (bool close_view);
|
public signal void selected (bool close_view);
|
||||||
|
|
||||||
public Workspace workspace { get; construct; }
|
public Meta.Workspace workspace { get; construct; }
|
||||||
public GestureTracker gesture_tracker { get; construct; }
|
public GestureTracker gesture_tracker { get; construct; }
|
||||||
public IconGroup icon_group { get; private set; }
|
public IconGroup icon_group { get; private set; }
|
||||||
public WindowCloneContainer window_container { get; private set; }
|
public WindowCloneContainer window_container { get; private set; }
|
||||||
@ -179,14 +176,14 @@ namespace Gala {
|
|||||||
|
|
||||||
uint hover_activate_timeout = 0;
|
uint hover_activate_timeout = 0;
|
||||||
|
|
||||||
public WorkspaceClone (Workspace workspace, GestureTracker gesture_tracker) {
|
public WorkspaceClone (Meta.Workspace workspace, GestureTracker gesture_tracker) {
|
||||||
Object (workspace: workspace, gesture_tracker: gesture_tracker);
|
Object (workspace: workspace, gesture_tracker: gesture_tracker);
|
||||||
}
|
}
|
||||||
|
|
||||||
construct {
|
construct {
|
||||||
opened = false;
|
opened = false;
|
||||||
|
|
||||||
unowned Display display = workspace.get_display ();
|
unowned Meta.Display display = workspace.get_display ();
|
||||||
var monitor_geometry = display.get_monitor_geometry (display.get_primary_monitor ());
|
var monitor_geometry = display.get_monitor_geometry (display.get_primary_monitor ());
|
||||||
|
|
||||||
background = new FramedBackground (display);
|
background = new FramedBackground (display);
|
||||||
@ -236,7 +233,7 @@ namespace Gala {
|
|||||||
// add existing windows
|
// add existing windows
|
||||||
var windows = workspace.list_windows ();
|
var windows = workspace.list_windows ();
|
||||||
foreach (var window in windows) {
|
foreach (var window in windows) {
|
||||||
if (window.window_type == WindowType.NORMAL
|
if (window.window_type == Meta.WindowType.NORMAL
|
||||||
&& !window.on_all_workspaces
|
&& !window.on_all_workspaces
|
||||||
&& window.get_monitor () == display.get_primary_monitor ()) {
|
&& window.get_monitor () == display.get_primary_monitor ()) {
|
||||||
window_container.add_window (window);
|
window_container.add_window (window);
|
||||||
@ -268,8 +265,8 @@ namespace Gala {
|
|||||||
* Add a window to the WindowCloneContainer and the IconGroup if it really
|
* Add a window to the WindowCloneContainer and the IconGroup if it really
|
||||||
* belongs to this workspace and this monitor.
|
* belongs to this workspace and this monitor.
|
||||||
*/
|
*/
|
||||||
void add_window (Window window) {
|
void add_window (Meta.Window window) {
|
||||||
if (window.window_type != WindowType.NORMAL
|
if (window.window_type != Meta.WindowType.NORMAL
|
||||||
|| window.get_workspace () != workspace
|
|| window.get_workspace () != workspace
|
||||||
|| window.on_all_workspaces
|
|| window.on_all_workspaces
|
||||||
|| window.get_monitor () != window.get_display ().get_primary_monitor ())
|
|| window.get_monitor () != window.get_display ().get_primary_monitor ())
|
||||||
@ -286,16 +283,16 @@ namespace Gala {
|
|||||||
/**
|
/**
|
||||||
* Remove a window from the WindowCloneContainer and the IconGroup
|
* Remove a window from the WindowCloneContainer and the IconGroup
|
||||||
*/
|
*/
|
||||||
void remove_window (Window window) {
|
void remove_window (Meta.Window window) {
|
||||||
window_container.remove_window (window);
|
window_container.remove_window (window);
|
||||||
icon_group.remove_window (window, opened);
|
icon_group.remove_window (window, opened);
|
||||||
}
|
}
|
||||||
|
|
||||||
void window_entered_monitor (Display display, int monitor, Window window) {
|
void window_entered_monitor (Meta.Display display, int monitor, Meta.Window window) {
|
||||||
add_window (window);
|
add_window (window);
|
||||||
}
|
}
|
||||||
|
|
||||||
void window_left_monitor (Display display, int monitor, Window window) {
|
void window_left_monitor (Meta.Display display, int monitor, Meta.Window window) {
|
||||||
if (monitor == display.get_primary_monitor ())
|
if (monitor == display.get_primary_monitor ())
|
||||||
remove_window (window);
|
remove_window (window);
|
||||||
}
|
}
|
||||||
@ -389,13 +386,13 @@ namespace Gala {
|
|||||||
|
|
||||||
save_easing_state ();
|
save_easing_state ();
|
||||||
set_easing_duration (MultitaskingView.ANIMATION_DURATION);
|
set_easing_duration (MultitaskingView.ANIMATION_DURATION);
|
||||||
set_easing_mode (AnimationMode.EASE_OUT_QUAD);
|
set_easing_mode (Clutter.AnimationMode.EASE_OUT_QUAD);
|
||||||
set_x (target_x);
|
set_x (target_x);
|
||||||
restore_easing_state ();
|
restore_easing_state ();
|
||||||
|
|
||||||
background.save_easing_state ();
|
background.save_easing_state ();
|
||||||
background.set_easing_duration (MultitaskingView.ANIMATION_DURATION);
|
background.set_easing_duration (MultitaskingView.ANIMATION_DURATION);
|
||||||
background.set_easing_mode (AnimationMode.EASE_OUT_QUAD);
|
background.set_easing_mode (Clutter.AnimationMode.EASE_OUT_QUAD);
|
||||||
background.set_scale (scale, scale);
|
background.set_scale (scale, scale);
|
||||||
background.restore_easing_state ();
|
background.restore_easing_state ();
|
||||||
};
|
};
|
||||||
@ -422,7 +419,7 @@ namespace Gala {
|
|||||||
|
|
||||||
icon_group.redraw ();
|
icon_group.redraw ();
|
||||||
|
|
||||||
Window? selected_window = display.get_workspace_manager ().get_active_workspace () == workspace ? display.get_focus_window () : null;
|
Meta.Window? selected_window = display.get_workspace_manager ().get_active_workspace () == workspace ? display.get_focus_window () : null;
|
||||||
window_container.open (selected_window, with_gesture, is_cancel_animation);
|
window_container.open (selected_window, with_gesture, is_cancel_animation);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -459,13 +456,13 @@ namespace Gala {
|
|||||||
|
|
||||||
save_easing_state ();
|
save_easing_state ();
|
||||||
set_easing_duration (MultitaskingView.ANIMATION_DURATION);
|
set_easing_duration (MultitaskingView.ANIMATION_DURATION);
|
||||||
set_easing_mode (AnimationMode.EASE_OUT_QUAD);
|
set_easing_mode (Clutter.AnimationMode.EASE_OUT_QUAD);
|
||||||
set_x (target_x);
|
set_x (target_x);
|
||||||
restore_easing_state ();
|
restore_easing_state ();
|
||||||
|
|
||||||
background.save_easing_state ();
|
background.save_easing_state ();
|
||||||
background.set_easing_duration (MultitaskingView.ANIMATION_DURATION);
|
background.set_easing_duration (MultitaskingView.ANIMATION_DURATION);
|
||||||
background.set_easing_mode (AnimationMode.EASE_OUT_QUAD);
|
background.set_easing_mode (Clutter.AnimationMode.EASE_OUT_QUAD);
|
||||||
background.set_scale (1, 1);
|
background.set_scale (1, 1);
|
||||||
background.restore_easing_state ();
|
background.restore_easing_state ();
|
||||||
};
|
};
|
||||||
|
@ -15,8 +15,6 @@
|
|||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
//
|
//
|
||||||
|
|
||||||
using Meta;
|
|
||||||
|
|
||||||
namespace Gala {
|
namespace Gala {
|
||||||
public class WorkspaceManager : Object {
|
public class WorkspaceManager : Object {
|
||||||
public static void init (WindowManager wm) requires (instance == null) {
|
public static void init (WindowManager wm) requires (instance == null) {
|
||||||
@ -31,7 +29,7 @@ namespace Gala {
|
|||||||
|
|
||||||
public WindowManager wm { get; construct; }
|
public WindowManager wm { get; construct; }
|
||||||
|
|
||||||
Gee.LinkedList<Workspace> workspaces_marked_removed;
|
Gee.LinkedList<Meta.Workspace> workspaces_marked_removed;
|
||||||
int remove_freeze_count = 0;
|
int remove_freeze_count = 0;
|
||||||
|
|
||||||
WorkspaceManager (WindowManager wm) {
|
WorkspaceManager (WindowManager wm) {
|
||||||
@ -39,20 +37,20 @@ namespace Gala {
|
|||||||
}
|
}
|
||||||
|
|
||||||
construct {
|
construct {
|
||||||
workspaces_marked_removed = new Gee.LinkedList<Workspace> ();
|
workspaces_marked_removed = new Gee.LinkedList<Meta.Workspace> ();
|
||||||
unowned Meta.Display display = wm.get_display ();
|
unowned Meta.Display display = wm.get_display ();
|
||||||
unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
|
unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
|
||||||
|
|
||||||
// There are some empty workspace at startup
|
// There are some empty workspace at startup
|
||||||
cleanup ();
|
cleanup ();
|
||||||
|
|
||||||
if (Prefs.get_dynamic_workspaces ())
|
if (Meta.Prefs.get_dynamic_workspaces ())
|
||||||
manager.override_workspace_layout (DisplayCorner.TOPLEFT, false, 1, -1);
|
manager.override_workspace_layout (Meta.DisplayCorner.TOPLEFT, false, 1, -1);
|
||||||
|
|
||||||
for (var i = 0; i < manager.get_n_workspaces (); i++)
|
for (var i = 0; i < manager.get_n_workspaces (); i++)
|
||||||
workspace_added (manager, i);
|
workspace_added (manager, i);
|
||||||
|
|
||||||
Prefs.add_listener (prefs_listener);
|
Meta.Prefs.add_listener (prefs_listener);
|
||||||
|
|
||||||
manager.workspace_switched.connect_after (workspace_switched);
|
manager.workspace_switched.connect_after (workspace_switched);
|
||||||
manager.workspace_added.connect (workspace_added);
|
manager.workspace_added.connect (workspace_added);
|
||||||
@ -61,13 +59,13 @@ namespace Gala {
|
|||||||
display.window_left_monitor.connect (window_left_monitor);
|
display.window_left_monitor.connect (window_left_monitor);
|
||||||
|
|
||||||
// make sure the last workspace has no windows on it
|
// make sure the last workspace has no windows on it
|
||||||
if (Prefs.get_dynamic_workspaces ()
|
if (Meta.Prefs.get_dynamic_workspaces ()
|
||||||
&& Utils.get_n_windows (manager.get_workspace_by_index (manager.get_n_workspaces () - 1)) > 0)
|
&& Utils.get_n_windows (manager.get_workspace_by_index (manager.get_n_workspaces () - 1)) > 0)
|
||||||
append_workspace ();
|
append_workspace ();
|
||||||
}
|
}
|
||||||
|
|
||||||
~WorkspaceManager () {
|
~WorkspaceManager () {
|
||||||
Prefs.remove_listener (prefs_listener);
|
Meta.Prefs.remove_listener (prefs_listener);
|
||||||
|
|
||||||
unowned Meta.Display display = wm.get_display ();
|
unowned Meta.Display display = wm.get_display ();
|
||||||
unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
|
unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
|
||||||
@ -88,7 +86,7 @@ namespace Gala {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void workspace_removed (Meta.WorkspaceManager manager, int index) {
|
void workspace_removed (Meta.WorkspaceManager manager, int index) {
|
||||||
List<Workspace> existing_workspaces = null;
|
List<Meta.Workspace> existing_workspaces = null;
|
||||||
for (int i = 0; i < manager.get_n_workspaces (); i++) {
|
for (int i = 0; i < manager.get_n_workspaces (); i++) {
|
||||||
existing_workspaces.append (manager.get_workspace_by_index (i));
|
existing_workspaces.append (manager.get_workspace_by_index (i));
|
||||||
}
|
}
|
||||||
@ -102,8 +100,8 @@ namespace Gala {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void workspace_switched (Meta.WorkspaceManager manager, int from, int to, MotionDirection direction) {
|
void workspace_switched (Meta.WorkspaceManager manager, int from, int to, Meta.MotionDirection direction) {
|
||||||
if (!Prefs.get_dynamic_workspaces ())
|
if (!Meta.Prefs.get_dynamic_workspaces ())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// remove empty workspaces after we switched away from them unless it's the last one
|
// remove empty workspaces after we switched away from them unless it's the last one
|
||||||
@ -119,23 +117,23 @@ namespace Gala {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void window_added (Workspace? workspace, Window window) {
|
void window_added (Meta.Workspace? workspace, Meta.Window window) {
|
||||||
if (workspace == null || !Prefs.get_dynamic_workspaces ()
|
if (workspace == null || !Meta.Prefs.get_dynamic_workspaces ()
|
||||||
|| window.on_all_workspaces)
|
|| window.on_all_workspaces)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
unowned Meta.WorkspaceManager manager = workspace.get_display ().get_workspace_manager ();
|
unowned Meta.WorkspaceManager manager = workspace.get_display ().get_workspace_manager ();
|
||||||
int last_workspace = manager.get_n_workspaces () - 1;
|
int last_workspace = manager.get_n_workspaces () - 1;
|
||||||
|
|
||||||
if ((window.window_type == WindowType.NORMAL
|
if ((window.window_type == Meta.WindowType.NORMAL
|
||||||
|| window.window_type == WindowType.DIALOG
|
|| window.window_type == Meta.WindowType.DIALOG
|
||||||
|| window.window_type == WindowType.MODAL_DIALOG)
|
|| window.window_type == Meta.WindowType.MODAL_DIALOG)
|
||||||
&& workspace.index () == last_workspace)
|
&& workspace.index () == last_workspace)
|
||||||
append_workspace ();
|
append_workspace ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void window_removed (Workspace? workspace, Window window) {
|
void window_removed (Meta.Workspace? workspace, Meta.Window window) {
|
||||||
if (workspace == null || !Prefs.get_dynamic_workspaces () || window.on_all_workspaces)
|
if (workspace == null || !Meta.Prefs.get_dynamic_workspaces () || window.on_all_workspaces)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
unowned Meta.WorkspaceManager manager = workspace.get_display ().get_workspace_manager ();
|
unowned Meta.WorkspaceManager manager = workspace.get_display ().get_workspace_manager ();
|
||||||
@ -143,9 +141,9 @@ namespace Gala {
|
|||||||
bool is_active_workspace = workspace == manager.get_active_workspace ();
|
bool is_active_workspace = workspace == manager.get_active_workspace ();
|
||||||
int last_workspace = manager.get_n_workspaces () - 1;
|
int last_workspace = manager.get_n_workspaces () - 1;
|
||||||
|
|
||||||
if (window.window_type != WindowType.NORMAL
|
if (window.window_type != Meta.WindowType.NORMAL
|
||||||
&& window.window_type != WindowType.DIALOG
|
&& window.window_type != Meta.WindowType.DIALOG
|
||||||
&& window.window_type != WindowType.MODAL_DIALOG)
|
&& window.window_type != Meta.WindowType.MODAL_DIALOG)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// has already been removed
|
// has already been removed
|
||||||
@ -162,13 +160,13 @@ namespace Gala {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void window_entered_monitor (Meta.Display display, int monitor, Window window) {
|
void window_entered_monitor (Meta.Display display, int monitor, Meta.Window window) {
|
||||||
if (InternalUtils.workspaces_only_on_primary ()
|
if (InternalUtils.workspaces_only_on_primary ()
|
||||||
&& monitor == display.get_primary_monitor ())
|
&& monitor == display.get_primary_monitor ())
|
||||||
window_added (window.get_workspace (), window);
|
window_added (window.get_workspace (), window);
|
||||||
}
|
}
|
||||||
|
|
||||||
void window_left_monitor (Meta.Display display, int monitor, Window window) {
|
void window_left_monitor (Meta.Display display, int monitor, Meta.Window window) {
|
||||||
if (InternalUtils.workspaces_only_on_primary ()
|
if (InternalUtils.workspaces_only_on_primary ()
|
||||||
&& monitor == display.get_primary_monitor ())
|
&& monitor == display.get_primary_monitor ())
|
||||||
window_removed (window.get_workspace (), window);
|
window_removed (window.get_workspace (), window);
|
||||||
@ -177,7 +175,7 @@ namespace Gala {
|
|||||||
void prefs_listener (Meta.Preference pref) {
|
void prefs_listener (Meta.Preference pref) {
|
||||||
unowned Meta.WorkspaceManager manager = wm.get_display ().get_workspace_manager ();
|
unowned Meta.WorkspaceManager manager = wm.get_display ().get_workspace_manager ();
|
||||||
|
|
||||||
if (pref == Preference.DYNAMIC_WORKSPACES && Prefs.get_dynamic_workspaces ()) {
|
if (pref == Meta.Preference.DYNAMIC_WORKSPACES && Meta.Prefs.get_dynamic_workspaces ()) {
|
||||||
// if the last workspace has a window, we need to append a new workspace
|
// if the last workspace has a window, we need to append a new workspace
|
||||||
if (Utils.get_n_windows (manager.get_workspace_by_index (manager.get_n_workspaces () - 1)) > 0)
|
if (Utils.get_n_windows (manager.get_workspace_by_index (manager.get_n_workspaces () - 1)) > 0)
|
||||||
append_workspace ();
|
append_workspace ();
|
||||||
@ -196,19 +194,19 @@ namespace Gala {
|
|||||||
*
|
*
|
||||||
* @param workspace The workspace to remove
|
* @param workspace The workspace to remove
|
||||||
*/
|
*/
|
||||||
void remove_workspace (Workspace workspace) {
|
void remove_workspace (Meta.Workspace workspace) {
|
||||||
unowned Meta.Display display = workspace.get_display ();
|
unowned Meta.Display display = workspace.get_display ();
|
||||||
unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
|
unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
|
||||||
var time = display.get_current_time ();
|
var time = display.get_current_time ();
|
||||||
unowned Meta.Workspace active_workspace = manager.get_active_workspace ();
|
unowned Meta.Workspace active_workspace = manager.get_active_workspace ();
|
||||||
|
|
||||||
if (workspace == active_workspace) {
|
if (workspace == active_workspace) {
|
||||||
Workspace? next = null;
|
Meta.Workspace? next = null;
|
||||||
|
|
||||||
next = workspace.get_neighbor (MotionDirection.LEFT);
|
next = workspace.get_neighbor (Meta.MotionDirection.LEFT);
|
||||||
// if it's the first one we may have another one to the right
|
// if it's the first one we may have another one to the right
|
||||||
if (next == workspace || next == null)
|
if (next == workspace || next == null)
|
||||||
next = workspace.get_neighbor (MotionDirection.RIGHT);
|
next = workspace.get_neighbor (Meta.MotionDirection.RIGHT);
|
||||||
|
|
||||||
if (next != null)
|
if (next != null)
|
||||||
next.activate (time);
|
next.activate (time);
|
||||||
@ -249,7 +247,7 @@ namespace Gala {
|
|||||||
* cleanup after an operation that required stable workspace/window indices
|
* cleanup after an operation that required stable workspace/window indices
|
||||||
*/
|
*/
|
||||||
public void cleanup () {
|
public void cleanup () {
|
||||||
if (!Prefs.get_dynamic_workspaces ())
|
if (!Meta.Prefs.get_dynamic_workspaces ())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
unowned Meta.Display display = wm.get_display ();
|
unowned Meta.Display display = wm.get_display ();
|
||||||
|
Loading…
Reference in New Issue
Block a user