Always use private keyword (#1543)

Co-authored-by: Danielle Foré <danielle@elementary.io>
This commit is contained in:
Leo 2023-02-19 02:32:32 +09:00 committed by GitHub
parent 23a60c1c36
commit e212898742
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
42 changed files with 367 additions and 367 deletions

View File

@ -35,7 +35,7 @@ namespace Gala {
} }
public class Daemon { public class Daemon {
SessionClient? sclient = null; private SessionClient? sclient = null;
public Daemon () { public Daemon () {
register.begin ((o, res)=> { register.begin ((o, res)=> {
@ -109,7 +109,7 @@ namespace Gala {
return session_client; return session_client;
} }
async bool register () { private async bool register () {
sclient = yield register_with_session ("org.pantheon.gala.daemon"); sclient = yield register_with_session ("org.pantheon.gala.daemon");
sclient.query_end_session.connect (() => end_session (false)); sclient.query_end_session.connect (() => end_session (false));
@ -119,7 +119,7 @@ namespace Gala {
return true; return true;
} }
void end_session (bool quit) { private void end_session (bool quit) {
if (quit) { if (quit) {
Gtk.main_quit (); Gtk.main_quit ();
return; return;

View File

@ -16,11 +16,11 @@
// //
namespace Gala { namespace Gala {
const string DBUS_NAME = "org.pantheon.gala"; private const string DBUS_NAME = "org.pantheon.gala";
const string DBUS_OBJECT_PATH = "/org/pantheon/gala"; private const string DBUS_OBJECT_PATH = "/org/pantheon/gala";
const string DAEMON_DBUS_NAME = "org.pantheon.gala.daemon"; private const string DAEMON_DBUS_NAME = "org.pantheon.gala.daemon";
const string DAEMON_DBUS_OBJECT_PATH = "/org/pantheon/gala/daemon"; private const string DAEMON_DBUS_OBJECT_PATH = "/org/pantheon/gala/daemon";
[DBus (name = "org.pantheon.gala")] [DBus (name = "org.pantheon.gala")]
public interface WMDBus : GLib.Object { public interface WMDBus : GLib.Object {
@ -39,25 +39,25 @@ namespace Gala {
private Granite.AccelLabel on_visible_workspace_accellabel; private Granite.AccelLabel on_visible_workspace_accellabel;
private Granite.AccelLabel resize_accellabel; private Granite.AccelLabel resize_accellabel;
private Granite.AccelLabel screenshot_accellabel; private Granite.AccelLabel screenshot_accellabel;
Gtk.Menu? window_menu = null; private Gtk.Menu? window_menu = null;
Gtk.MenuItem hide; private Gtk.MenuItem hide;
Gtk.MenuItem maximize; private Gtk.MenuItem maximize;
Gtk.MenuItem move; private Gtk.MenuItem move;
Gtk.MenuItem resize; private Gtk.MenuItem resize;
Gtk.CheckMenuItem always_on_top; private Gtk.CheckMenuItem always_on_top;
Gtk.CheckMenuItem on_visible_workspace; private Gtk.CheckMenuItem on_visible_workspace;
Gtk.MenuItem move_left; private Gtk.MenuItem move_left;
Gtk.MenuItem move_right; private Gtk.MenuItem move_right;
Gtk.MenuItem close; private Gtk.MenuItem close;
Gtk.MenuItem screenshot; private Gtk.MenuItem screenshot;
// Desktop Menu // Desktop Menu
Gtk.Menu? desktop_menu = null; private Gtk.Menu? desktop_menu = null;
WMDBus? wm_proxy = null; private WMDBus? wm_proxy = null;
ulong always_on_top_sid = 0U; private ulong always_on_top_sid = 0U;
ulong on_visible_workspace_sid = 0U; private ulong on_visible_workspace_sid = 0U;
private static GLib.Settings keybind_settings; private static GLib.Settings keybind_settings;
private static GLib.Settings gala_keybind_settings; private static GLib.Settings gala_keybind_settings;
@ -75,7 +75,7 @@ namespace Gala {
Bus.watch_name (BusType.SESSION, DBUS_NAME, BusNameWatcherFlags.NONE, gala_appeared, lost_gala); Bus.watch_name (BusType.SESSION, DBUS_NAME, BusNameWatcherFlags.NONE, gala_appeared, lost_gala);
} }
void on_gala_get (GLib.Object? o, GLib.AsyncResult? res) { private void on_gala_get (GLib.Object? o, GLib.AsyncResult? res) {
try { try {
wm_proxy = Bus.get_proxy.end (res); wm_proxy = Bus.get_proxy.end (res);
} catch (Error e) { } catch (Error e) {
@ -83,17 +83,17 @@ namespace Gala {
} }
} }
void lost_gala () { private void lost_gala () {
wm_proxy = null; wm_proxy = null;
} }
void gala_appeared () { private void gala_appeared () {
if (wm_proxy == null) { if (wm_proxy == null) {
Bus.get_proxy.begin<WMDBus> (BusType.SESSION, DBUS_NAME, DBUS_OBJECT_PATH, 0, null, on_gala_get); Bus.get_proxy.begin<WMDBus> (BusType.SESSION, DBUS_NAME, DBUS_OBJECT_PATH, 0, null, on_gala_get);
} }
} }
void on_bus_acquired (DBusConnection conn) { private void on_bus_acquired (DBusConnection conn) {
try { try {
conn.register_object (DAEMON_DBUS_OBJECT_PATH, this); conn.register_object (DAEMON_DBUS_OBJECT_PATH, this);
} catch (Error e) { } catch (Error e) {
@ -101,7 +101,7 @@ namespace Gala {
} }
} }
void perform_action (Gala.ActionType type) { private void perform_action (Gala.ActionType type) {
if (wm_proxy != null) { if (wm_proxy != null) {
try { try {
wm_proxy.perform_action (type); wm_proxy.perform_action (type);

View File

@ -25,8 +25,8 @@ namespace Gala {
} }
public class DragDropAction : Clutter.Action { public class DragDropAction : Clutter.Action {
static Gee.HashMap<string,Gee.LinkedList<Actor>>? sources = null; private static Gee.HashMap<string,Gee.LinkedList<Actor>>? sources = null;
static Gee.HashMap<string,Gee.LinkedList<Actor>>? destinations = null; private static Gee.HashMap<string,Gee.LinkedList<Actor>>? destinations = null;
/** /**
* A drag has been started. You have to connect to this signal and * A drag has been started. You have to connect to this signal and
@ -99,15 +99,15 @@ namespace Gala {
public Actor? hovered { private get; set; default = null; } public Actor? hovered { private get; set; default = null; }
bool clicked = false; private bool clicked = false;
float last_x; private float last_x;
float last_y; private float last_y;
#if HAS_MUTTER42 #if HAS_MUTTER42
Grab? grab = null; private Grab? grab = null;
static unowned Actor? grabbed_actor = null; private static unowned Actor? grabbed_actor = null;
InputDevice? grabbed_device = null; private InputDevice? grabbed_device = null;
ulong on_event_id = 0; private ulong on_event_id = 0;
#endif #endif
/** /**
@ -146,7 +146,7 @@ namespace Gala {
base.set_actor (new_actor); base.set_actor (new_actor);
} }
void release_actor (Actor actor) { private void release_actor (Actor actor) {
if (DragDropActionType.SOURCE in drag_type) { if (DragDropActionType.SOURCE in drag_type) {
#if !HAS_MUTTER42 #if !HAS_MUTTER42
actor.button_press_event.disconnect (source_clicked); actor.button_press_event.disconnect (source_clicked);
@ -162,7 +162,7 @@ namespace Gala {
} }
} }
void connect_actor (Actor actor) { private void connect_actor (Actor actor) {
if (DragDropActionType.SOURCE in drag_type) { if (DragDropActionType.SOURCE in drag_type) {
#if !HAS_MUTTER42 #if !HAS_MUTTER42
actor.button_press_event.connect (source_clicked); actor.button_press_event.connect (source_clicked);
@ -188,7 +188,7 @@ namespace Gala {
} }
} }
void emit_crossed (Actor destination, bool is_hovered) { private void emit_crossed (Actor destination, bool is_hovered) {
get_drag_drop_action (destination).crossed (actor, is_hovered); get_drag_drop_action (destination).crossed (actor, is_hovered);
destination_crossed (destination, is_hovered); destination_crossed (destination, is_hovered);
} }
@ -254,7 +254,7 @@ namespace Gala {
return base.handle_event (event); return base.handle_event (event);
} }
void grab_actor (Actor actor, InputDevice device) { private void grab_actor (Actor actor, InputDevice device) {
if (grabbed_actor != null) { if (grabbed_actor != null) {
critical ("Tried to grab an actor with a grab already in progress"); critical ("Tried to grab an actor with a grab already in progress");
} }
@ -265,7 +265,7 @@ namespace Gala {
on_event_id = actor.event.connect (on_event); on_event_id = actor.event.connect (on_event);
} }
void ungrab_actor () { private void ungrab_actor () {
if (on_event_id == 0 || grabbed_actor == null) { if (on_event_id == 0 || grabbed_actor == null) {
return; return;
} }
@ -281,7 +281,7 @@ namespace Gala {
grabbed_actor = null; grabbed_actor = null;
} }
bool on_event (Clutter.Event event) { private bool on_event (Clutter.Event event) {
var device = event.get_device (); var device = event.get_device ();
if (grabbed_device != null && if (grabbed_device != null &&
@ -381,7 +381,7 @@ namespace Gala {
return false; return false;
} }
#else #else
bool source_clicked (ButtonEvent event) { private bool source_clicked (ButtonEvent event) {
if (event.button != 1) { if (event.button != 1) {
actor_clicked (event.button); actor_clicked (event.button);
return false; return false;
@ -395,7 +395,7 @@ namespace Gala {
return true; return true;
} }
bool follow_move (Event event) { private bool follow_move (Event event) {
// still determining if we actually want to start a drag action // still determining if we actually want to start a drag action
if (!dragging) { if (!dragging) {
switch (event.get_type ()) { switch (event.get_type ()) {
@ -521,7 +521,7 @@ namespace Gala {
* *
* @return the DragDropAction instance on this actor or NULL * @return the DragDropAction instance on this actor or NULL
*/ */
DragDropAction? get_drag_drop_action (Actor actor) { private DragDropAction? get_drag_drop_action (Actor actor) {
DragDropAction? drop_action = null; DragDropAction? drop_action = null;
foreach (var action in actor.get_actions ()) { foreach (var action in actor.get_actions ()) {
@ -565,7 +565,7 @@ namespace Gala {
} }
} }
void finish () { private void finish () {
// make sure they reset the style or whatever they changed when hovered // make sure they reset the style or whatever they changed when hovered
emit_crossed (hovered, false); emit_crossed (hovered, false);
@ -574,7 +574,7 @@ namespace Gala {
drag_end (hovered); drag_end (hovered);
} }
void cleanup () { private void cleanup () {
var source_list = sources.@get (drag_id); var source_list = sources.@get (drag_id);
if (source_list != null) { if (source_list != null) {
foreach (var actor in source_list) { foreach (var actor in source_list) {

View File

@ -343,8 +343,8 @@ namespace Gala.Drawing {
context.set_operator (Operator.OVER); context.set_operator (Operator.OVER);
} }
const int ALPHA_PRECISION = 16; private const int ALPHA_PRECISION = 16;
const int PARAM_PRECISION = 7; private const int PARAM_PRECISION = 7;
/** /**
* Performs a blur operation on the internal {@link Cairo.Surface}, using an * Performs a blur operation on the internal {@link Cairo.Surface}, using an
@ -401,7 +401,7 @@ namespace Gala.Drawing {
context.set_operator (Operator.OVER); context.set_operator (Operator.OVER);
} }
void exponential_blur_columns ( private void exponential_blur_columns (
uint8* pixels, uint8* pixels,
int width, int width,
int height, int height,
@ -432,7 +432,7 @@ namespace Gala.Drawing {
} }
} }
void exponential_blur_rows ( private void exponential_blur_rows (
uint8* pixels, uint8* pixels,
int width, int width,
int height, int height,
@ -614,7 +614,7 @@ namespace Gala.Drawing {
context.set_operator (Operator.OVER); context.set_operator (Operator.OVER);
} }
void gaussian_blur_horizontal ( private void gaussian_blur_horizontal (
double* src, double* src,
double* dest, double* dest,
double* kernel, double* kernel,
@ -643,7 +643,7 @@ namespace Gala.Drawing {
} }
} }
void gaussian_blur_vertical ( private void gaussian_blur_vertical (
double* src, double* src,
double* dest, double* dest,
double* kernel, double* kernel,
@ -673,7 +673,7 @@ namespace Gala.Drawing {
} }
} }
static double[] build_gaussian_kernel (int gauss_width) requires (gauss_width % 2 == 1) { private static double[] build_gaussian_kernel (int gauss_width) requires (gauss_width % 2 == 1) {
var kernel = new double[gauss_width]; var kernel = new double[gauss_width];
// Maximum value of curve // Maximum value of curve

View File

@ -373,7 +373,7 @@ namespace Gala.Drawing {
return this; return this;
} }
void rgb_to_hsv ( private void rgb_to_hsv (
double r, double g, double b, out double h, out double s, out double v double r, double g, double b, out double h, out double s, out double v
) requires (r >= 0 && r <= 1) requires (g >= 0 && g <= 1) requires (b >= 0 && b <= 1) { ) requires (r >= 0 && r <= 1) requires (g >= 0 && g <= 1) requires (b >= 0 && b <= 1) {
var min = double.min (r, double.min (g, b)); var min = double.min (r, double.min (g, b));
@ -417,7 +417,7 @@ namespace Gala.Drawing {
} }
} }
void hsv_to_rgb ( private void hsv_to_rgb (
double h, double s, double v, out double r, out double g, out double b double h, double s, double v, out double r, out double g, out double b
) requires (h >= 0 && h <= 360) requires (s >= 0 && s <= 1) requires (v >= 0 && v <= 1) { ) requires (h >= 0 && h <= 360) requires (s >= 0 && s <= 1) requires (v >= 0 && v <= 1) {
r = 0; r = 0;

View File

@ -23,14 +23,14 @@ namespace Gala {
public int scale; public int scale;
} }
static Gdk.Pixbuf? resize_pixbuf = null; private static Gdk.Pixbuf? resize_pixbuf = null;
static Gdk.Pixbuf? close_pixbuf = null; private static Gdk.Pixbuf? close_pixbuf = null;
static Gee.HashMultiMap<DesktopAppInfo, CachedIcon?> icon_cache; private static Gee.HashMultiMap<DesktopAppInfo, CachedIcon?> icon_cache;
static Gee.HashMap<Meta.Window, DesktopAppInfo> window_to_desktop_cache; private static Gee.HashMap<Meta.Window, DesktopAppInfo> window_to_desktop_cache;
static Gee.ArrayList<CachedIcon?> unknown_icon_cache; private static Gee.ArrayList<CachedIcon?> unknown_icon_cache;
static AppCache app_cache; private static AppCache app_cache;
static construct { static construct {
icon_cache = new Gee.HashMultiMap<DesktopAppInfo, CachedIcon?> (); icon_cache = new Gee.HashMultiMap<DesktopAppInfo, CachedIcon?> ();
@ -441,7 +441,7 @@ namespace Gala {
return texture; return texture;
} }
static Gtk.CssProvider gala_css = null; private static Gtk.CssProvider gala_css = null;
public static unowned Gtk.CssProvider? get_gala_css () { public static unowned Gtk.CssProvider? get_gala_css () {
if (gala_css == null) { if (gala_css == null) {
gala_css = new Gtk.CssProvider (); gala_css = new Gtk.CssProvider ();

View File

@ -46,7 +46,7 @@ namespace Gala {
} }
} }
bool _destroy_on_unmanaged = false; private bool _destroy_on_unmanaged = false;
/** /**
* Creates a new WindowIcon * Creates a new WindowIcon
@ -70,7 +70,7 @@ namespace Gala {
update_texture (true); update_texture (true);
} }
void update_texture (bool initial) { private void update_texture (bool initial) {
var pixbuf = Gala.Utils.get_icon_for_window (window, icon_size, scale); var pixbuf = Gala.Utils.get_icon_for_window (window, icon_size, scale);
try { try {
var image = new Clutter.Image (); var image = new Clutter.Image ();

View File

@ -22,7 +22,7 @@ public class Gala.Plugins.PIP.Plugin : Gala.Plugin {
private Gala.WindowManager? wm = null; private Gala.WindowManager? wm = null;
private SelectionArea? selection_area; private SelectionArea? selection_area;
static inline bool meta_rectangle_contains (Meta.Rectangle rect, int x, int y) { private static inline bool meta_rectangle_contains (Meta.Rectangle rect, int x, int y) {
return x >= rect.x && x < rect.x + rect.width return x >= rect.x && x < rect.x + rect.width
&& y >= rect.y && y < rect.y + rect.height; && y >= rect.y && y < rect.y + rect.height;
} }
@ -50,7 +50,7 @@ public class Gala.Plugins.PIP.Plugin : Gala.Plugin {
} }
[CCode (instance_pos = -1)] [CCode (instance_pos = -1)]
void on_initiate (Meta.Display display, Meta.Window? window, Clutter.KeyEvent event, private void on_initiate (Meta.Display display, Meta.Window? window, Clutter.KeyEvent event,
Meta.KeyBinding binding) { Meta.KeyBinding binding) {
selection_area = new SelectionArea (wm); selection_area = new SelectionArea (wm);
selection_area.selected.connect (on_selection_actor_selected); selection_area.selected.connect (on_selection_actor_selected);

View File

@ -40,24 +40,24 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
private Clutter.Grab? grab = null; private Clutter.Grab? grab = null;
#endif #endif
static unowned Meta.Window? previous_focus = null; private static unowned Meta.Window? previous_focus = null;
// From https://opensourcehacker.com/2011/12/01/calculate-aspect-ratio-conserving-resize-for-images-in-javascript/ // From https://opensourcehacker.com/2011/12/01/calculate-aspect-ratio-conserving-resize-for-images-in-javascript/
static void calculate_aspect_ratio_size_fit (float src_width, float src_height, float max_width, float max_height, private static void calculate_aspect_ratio_size_fit (float src_width, float src_height, float max_width, float max_height,
out float width, out float height) { out float width, out float height) {
float ratio = float.min (max_width / src_width, max_height / src_height); float ratio = float.min (max_width / src_width, max_height / src_height);
width = src_width * ratio; width = src_width * ratio;
height = src_height * ratio; height = src_height * ratio;
} }
static bool get_window_is_normal (Meta.Window window) { private static bool get_window_is_normal (Meta.Window window) {
var window_type = window.get_window_type (); var window_type = window.get_window_type ();
return window_type == Meta.WindowType.NORMAL return window_type == Meta.WindowType.NORMAL
|| window_type == Meta.WindowType.DIALOG || window_type == Meta.WindowType.DIALOG
|| window_type == Meta.WindowType.MODAL_DIALOG; || window_type == Meta.WindowType.MODAL_DIALOG;
} }
static void get_current_cursor_position (out int x, out int y) { private static void get_current_cursor_position (out int x, out int y) {
Gdk.Display.get_default ().get_default_seat ().get_pointer ().get_position (null, out x, out y); Gdk.Display.get_default ().get_default_seat ().get_pointer ().get_position (null, out x, out y);
} }

View File

@ -22,10 +22,10 @@
namespace Gala.Plugins.Template { namespace Gala.Plugins.Template {
public class Main : Gala.Plugin { public class Main : Gala.Plugin {
const int PADDING = 50; private const int PADDING = 50;
Gala.WindowManager? wm = null; private Gala.WindowManager? wm = null;
Clutter.Actor red_box; private Clutter.Actor red_box;
// This function is called as soon as Gala has started and gives you // This function is called as soon as Gala has started and gives you
// an instance of the GalaWindowManager class. // an instance of the GalaWindowManager class.
@ -69,7 +69,7 @@ namespace Gala.Plugins.Template {
wm.ui_group.add_child (red_box); wm.ui_group.add_child (red_box);
} }
bool turn_green (Clutter.ButtonEvent event) { private bool turn_green (Clutter.ButtonEvent event) {
red_box.background_color = { 0, 255, 0, 255 }; red_box.background_color = { 0, 255, 0, 255 };
return true; return true;
} }

View File

@ -23,7 +23,7 @@ namespace Gala {
public double transition_duration { get; private set; default = 0.0; } public double transition_duration { get; private set; default = 0.0; }
public bool loaded { get; private set; default = false; } public bool loaded { get; private set; default = false; }
Gnome.BGSlideShow? show = null; private Gnome.BGSlideShow? show = null;
public Animation (string filename) { public Animation (string filename) {
Object (filename: filename); Object (filename: filename);

View File

@ -17,8 +17,8 @@
namespace Gala { namespace Gala {
public class Background : Object { public class Background : Object {
const double ANIMATION_OPACITY_STEP_INCREMENT = 4.0; private const double ANIMATION_OPACITY_STEP_INCREMENT = 4.0;
const double ANIMATION_MIN_WAKEUP_INTERVAL = 1.0; private const double ANIMATION_MIN_WAKEUP_INTERVAL = 1.0;
public signal void changed (); public signal void changed ();
public signal void loaded (); public signal void loaded ();
@ -31,10 +31,10 @@ namespace Gala {
public string? filename { get; construct; } public string? filename { get; construct; }
public Meta.Background background { get; private set; } public Meta.Background background { get; private set; }
Animation? animation = null; private Animation? animation = null;
Gee.HashMap<string,ulong> file_watches; private Gee.HashMap<string,ulong> file_watches;
Cancellable cancellable; private Cancellable cancellable;
uint update_animation_timeout_id = 0; private uint update_animation_timeout_id = 0;
private Gnome.WallClock clock; private Gnome.WallClock clock;
private ulong clock_timezone_handler = 0; private ulong clock_timezone_handler = 0;
@ -91,7 +91,7 @@ namespace Gala {
} }
} }
void set_loaded () { private void set_loaded () {
if (is_loaded) if (is_loaded)
return; return;
@ -103,7 +103,7 @@ namespace Gala {
}); });
} }
void load_pattern () { private void load_pattern () {
string color_string; string color_string;
var settings = background_source.settings; var settings = background_source.settings;
@ -121,7 +121,7 @@ namespace Gala {
} }
} }
void watch_file (string filename) { private void watch_file (string filename) {
if (file_watches.has_key (filename)) if (file_watches.has_key (filename))
return; return;
@ -138,14 +138,14 @@ namespace Gala {
}); });
} }
void remove_animation_timeout () { private void remove_animation_timeout () {
if (update_animation_timeout_id != 0) { if (update_animation_timeout_id != 0) {
Source.remove (update_animation_timeout_id); Source.remove (update_animation_timeout_id);
update_animation_timeout_id = 0; update_animation_timeout_id = 0;
} }
} }
void finish_animation (string[] files) { private void finish_animation (string[] files) {
set_loaded (); set_loaded ();
if (files.length > 1) if (files.length > 1)
@ -158,7 +158,7 @@ namespace Gala {
queue_update_animation (); queue_update_animation ();
} }
void update_animation () { private void update_animation () {
update_animation_timeout_id = 0; update_animation_timeout_id = 0;
animation.update (display.get_monitor_geometry (monitor_index)); animation.update (display.get_monitor_geometry (monitor_index));
@ -188,7 +188,7 @@ namespace Gala {
} }
} }
void queue_update_animation () { private void queue_update_animation () {
if (update_animation_timeout_id != 0) if (update_animation_timeout_id != 0)
return; return;
@ -213,7 +213,7 @@ namespace Gala {
}); });
} }
async void load_animation (string filename) { private async void load_animation (string filename) {
animation = yield BackgroundCache.get_default ().get_animation (filename); animation = yield BackgroundCache.get_default ().get_animation (filename);
if (animation == null || cancellable.is_cancelled ()) { if (animation == null || cancellable.is_cancelled ()) {
@ -225,7 +225,7 @@ namespace Gala {
watch_file (filename); watch_file (filename);
} }
void load_image (string filename) { private void load_image (string filename) {
background.set_file (File.new_for_path (filename), style); background.set_file (File.new_for_path (filename), style);
watch_file (filename); watch_file (filename);
@ -242,14 +242,14 @@ namespace Gala {
} }
} }
void load_file (string filename) { private void load_file (string filename) {
if (filename.has_suffix (".xml")) if (filename.has_suffix (".xml"))
load_animation.begin (filename); load_animation.begin (filename);
else else
load_image (filename); load_image (filename);
} }
void load () { private void load () {
load_pattern (); load_pattern ();
if (filename == null) if (filename == null)
@ -258,7 +258,7 @@ namespace Gala {
load_file (filename); load_file (filename);
} }
void settings_changed () { private void settings_changed () {
changed (); changed ();
} }
} }

View File

@ -17,7 +17,7 @@
namespace Gala { namespace Gala {
public class BackgroundCache : Object { public class BackgroundCache : Object {
static BackgroundCache? instance = null; private static BackgroundCache? instance = null;
public static unowned BackgroundCache get_default () { public static unowned BackgroundCache get_default () {
if (instance == null) if (instance == null)
@ -28,10 +28,10 @@ namespace Gala {
public signal void file_changed (string filename); public signal void file_changed (string filename);
Gee.HashMap<string,FileMonitor> file_monitors; private Gee.HashMap<string,FileMonitor> file_monitors;
Gee.HashMap<string,BackgroundSource> background_sources; private Gee.HashMap<string,BackgroundSource> background_sources;
Animation animation; private Animation animation;
public BackgroundCache () { public BackgroundCache () {
Object (); Object ();

View File

@ -43,7 +43,7 @@ namespace Gala {
Meta.MonitorManager.@get ().monitors_changed.disconnect (update); Meta.MonitorManager.@get ().monitors_changed.disconnect (update);
} }
void update () { private void update () {
var reference_child = (get_child_at_index (0) as BackgroundManager); var reference_child = (get_child_at_index (0) as BackgroundManager);
if (reference_child != null) if (reference_child != null)
reference_child.changed.disconnect (background_changed); reference_child.changed.disconnect (background_changed);
@ -60,7 +60,7 @@ namespace Gala {
} }
} }
void background_changed () { private void background_changed () {
changed (); changed ();
} }
} }

View File

@ -17,11 +17,11 @@
namespace Gala { namespace Gala {
public class BackgroundManager : Meta.BackgroundGroup { public class BackgroundManager : Meta.BackgroundGroup {
const string GNOME_BACKGROUND_SCHEMA = "org.gnome.desktop.background"; private const string GNOME_BACKGROUND_SCHEMA = "org.gnome.desktop.background";
const string GALA_BACKGROUND_SCHEMA = "io.elementary.desktop.background"; private const string GALA_BACKGROUND_SCHEMA = "io.elementary.desktop.background";
const string DIM_WALLPAPER_KEY = "dim-wallpaper-in-dark-style"; private const string DIM_WALLPAPER_KEY = "dim-wallpaper-in-dark-style";
const double DIM_OPACITY = 0.85; private const double DIM_OPACITY = 0.85;
const int FADE_ANIMATION_TIME = 1000; private const int FADE_ANIMATION_TIME = 1000;
public signal void changed (); public signal void changed ();
@ -29,9 +29,9 @@ namespace Gala {
public int monitor_index { get; construct; } public int monitor_index { get; construct; }
public bool control_position { get; construct; } public bool control_position { get; construct; }
BackgroundSource background_source; private BackgroundSource background_source;
Meta.BackgroundActor background_actor; private Meta.BackgroundActor background_actor;
Meta.BackgroundActor? new_background_actor = null; private Meta.BackgroundActor? new_background_actor = null;
private Clutter.PropertyTransition? last_dim_transition = null; private Clutter.PropertyTransition? last_dim_transition = null;
@ -52,7 +52,7 @@ namespace Gala {
destroy.connect (on_destroy); destroy.connect (on_destroy);
} }
void on_destroy () { private void on_destroy () {
BackgroundCache.get_default ().release_background_source (GNOME_BACKGROUND_SCHEMA); BackgroundCache.get_default ().release_background_source (GNOME_BACKGROUND_SCHEMA);
background_source = null; background_source = null;
@ -67,7 +67,7 @@ namespace Gala {
} }
} }
void swap_background_actor (bool animate) { private void swap_background_actor (bool animate) {
return_if_fail (new_background_actor != null); return_if_fail (new_background_actor != null);
var old_background_actor = background_actor; var old_background_actor = background_actor;
@ -97,7 +97,7 @@ namespace Gala {
} }
} }
void update_background_actor (bool animate = true) { private void update_background_actor (bool animate = true) {
if (new_background_actor != null) { if (new_background_actor != null) {
// Skip displaying existing background queued for load // Skip displaying existing background queued for load
new_background_actor.destroy (); new_background_actor.destroy ();
@ -144,7 +144,7 @@ namespace Gala {
} }
} }
Meta.BackgroundActor create_background_actor () { private Meta.BackgroundActor create_background_actor () {
var background = background_source.get_background (monitor_index); var background = background_source.get_background (monitor_index);
var background_actor = new Meta.BackgroundActor (display, monitor_index); var background_actor = new Meta.BackgroundActor (display, monitor_index);

View File

@ -18,7 +18,7 @@
namespace Gala { namespace Gala {
public class BackgroundSource : Object { public class BackgroundSource : Object {
// list of keys that are actually relevant for us // list of keys that are actually relevant for us
const string[] OPTIONS = { private const string[] OPTIONS = {
"color-shading-type", "color-shading-type",
"picture-opacity", "picture-opacity",
"picture-options", "picture-options",
@ -34,8 +34,8 @@ namespace Gala {
internal int use_count { get; set; default = 0; } internal int use_count { get; set; default = 0; }
Gee.HashMap<int,Background> backgrounds; private Gee.HashMap<int,Background> backgrounds;
uint[] hash_cache; private uint[] hash_cache;
public BackgroundSource (Meta.Display display, string settings_schema) { public BackgroundSource (Meta.Display display, string settings_schema) {
Object (display: display, settings: new Settings (settings_schema)); Object (display: display, settings: new Settings (settings_schema));
@ -68,7 +68,7 @@ namespace Gala {
}); });
} }
void monitors_changed () { private void monitors_changed () {
var n = display.get_n_monitors (); var n = display.get_n_monitors ();
var i = 0; var i = 0;
@ -113,7 +113,7 @@ namespace Gala {
return backgrounds[monitor_index]; return backgrounds[monitor_index];
} }
void background_changed (Background background) { private void background_changed (Background background) {
background.changed.disconnect (background_changed); background.changed.disconnect (background_changed);
background.destroy (); background.destroy ();
backgrounds.unset (background.monitor_index); backgrounds.unset (background.monitor_index);

View File

@ -17,7 +17,7 @@
namespace Gala { namespace Gala {
public class SystemBackground : GLib.Object { public class SystemBackground : GLib.Object {
const Clutter.Color DEFAULT_BACKGROUND_COLOR = { 0x2e, 0x34, 0x36, 0xff }; private const Clutter.Color DEFAULT_BACKGROUND_COLOR = { 0x2e, 0x34, 0x36, 0xff };
static Meta.Background? system_background = null; static Meta.Background? system_background = null;
public Meta.BackgroundActor background_actor { get; construct; } public Meta.BackgroundActor background_actor { get; construct; }

View File

@ -18,8 +18,8 @@
namespace Gala { namespace Gala {
[DBus (name="org.pantheon.gala")] [DBus (name="org.pantheon.gala")]
public class DBus { public class DBus {
static DBus? instance; private static DBus? instance;
static WindowManager wm; private static WindowManager wm;
[DBus (visible = false)] [DBus (visible = false)]
public static void init (WindowManager _wm) { public static void init (WindowManager _wm) {
@ -91,10 +91,10 @@ namespace Gala {
wm.perform_action (type); wm.perform_action (type);
} }
const double SATURATION_WEIGHT = 1.5; private const double SATURATION_WEIGHT = 1.5;
const double WEIGHT_THRESHOLD = 1.0; private const double WEIGHT_THRESHOLD = 1.0;
class DummyOffscreenEffect : Clutter.OffscreenEffect { private class DummyOffscreenEffect : Clutter.OffscreenEffect {
public signal void done_painting (); public signal void done_painting ();
#if HAS_MUTTER40 #if HAS_MUTTER40

View File

@ -57,7 +57,7 @@ namespace Gala {
[DBus (name="org.gnome.Shell")] [DBus (name="org.gnome.Shell")]
public class DBusAccelerator { public class DBusAccelerator {
static DBusAccelerator? instance; private static DBusAccelerator? instance;
[DBus (visible = false)] [DBus (visible = false)]
public static unowned DBusAccelerator init (WindowManager wm) { public static unowned DBusAccelerator init (WindowManager wm) {
@ -69,10 +69,10 @@ namespace Gala {
public signal void accelerator_activated (uint action, GLib.HashTable<string, Variant> parameters); public signal void accelerator_activated (uint action, GLib.HashTable<string, Variant> parameters);
WindowManager wm; private WindowManager wm;
GLib.HashTable<unowned string, GrabbedAccelerator> grabbed_accelerators; private GLib.HashTable<unowned string, GrabbedAccelerator> grabbed_accelerators;
DBusAccelerator (WindowManager _wm) { private DBusAccelerator (WindowManager _wm) {
wm = _wm; wm = _wm;
grabbed_accelerators = new HashTable<unowned string, GrabbedAccelerator> (str_hash, str_equal); grabbed_accelerators = new HashTable<unowned string, GrabbedAccelerator> (str_hash, str_equal);
wm.get_display ().accelerator_activated.connect (on_accelerator_activated); wm.get_display ().accelerator_activated.connect (on_accelerator_activated);

View File

@ -35,9 +35,9 @@ namespace Gala {
public string accept_label { get; set; } public string accept_label { get; set; }
public string deny_label { get; set; } public string deny_label { get; set; }
const string PANTHEON_PORTAL_NAME = "org.freedesktop.impl.portal.desktop.pantheon"; private const string PANTHEON_PORTAL_NAME = "org.freedesktop.impl.portal.desktop.pantheon";
const string FDO_PORTAL_PATH = "/org/freedesktop/portal/desktop"; private const string FDO_PORTAL_PATH = "/org/freedesktop/portal/desktop";
const string GALA_DIALOG_PATH = "/io/elementary/gala/dialog"; private const string GALA_DIALOG_PATH = "/io/elementary/gala/dialog";
protected static AccessPortal? portal = null; protected static AccessPortal? portal = null;
protected ObjectPath? path = null; protected ObjectPath? path = null;

View File

@ -375,7 +375,7 @@ namespace Gala {
/** /**
* Returns the workspaces geometry following the only_on_primary settings. * Returns the workspaces geometry following the only_on_primary settings.
*/ */
public static Meta.Rectangle get_workspaces_geometry (Meta.Display display) { public static Meta.Rectangle get_workspaces_geometry (Meta.Display display) {
if (InternalUtils.workspaces_only_on_primary ()) { if (InternalUtils.workspaces_only_on_primary ()) {
var primary = display.get_primary_monitor (); var primary = display.get_primary_monitor ();
return display.get_monitor_geometry (primary); return display.get_monitor_geometry (primary);

View File

@ -17,8 +17,8 @@
namespace Gala { namespace Gala {
public class KeyboardManager : Object { public class KeyboardManager : Object {
static KeyboardManager? instance; private static KeyboardManager? instance;
static VariantType sources_variant_type; private static VariantType sources_variant_type;
public static void init (Meta.Display display) { public static void init (Meta.Display display) {
if (instance != null) if (instance != null)
@ -33,9 +33,9 @@ namespace Gala {
sources_variant_type = new VariantType ("a(ss)"); sources_variant_type = new VariantType ("a(ss)");
} }
GLib.Settings settings; private GLib.Settings settings;
KeyboardManager () { private KeyboardManager () {
Object (); Object ();
} }
@ -51,7 +51,7 @@ namespace Gala {
} }
[CCode (instance_pos = -1)] [CCode (instance_pos = -1)]
bool handle_modifiers_accelerator_activated (Meta.Display display) { private bool handle_modifiers_accelerator_activated (Meta.Display display) {
display.ungrab_keyboard (display.get_current_time ()); display.ungrab_keyboard (display.get_current_time ());
var sources = settings.get_value ("sources"); var sources = settings.get_value ("sources");
@ -69,7 +69,7 @@ namespace Gala {
} }
[CCode (instance_pos = -1)] [CCode (instance_pos = -1)]
void set_keyboard_layout (GLib.Settings settings, string key) { private void set_keyboard_layout (GLib.Settings settings, string key) {
if (!(key == "current" || key == "sources" || key == "xkb-options")) if (!(key == "current" || key == "sources" || key == "xkb-options"))
return; return;

View File

@ -16,12 +16,12 @@
// //
namespace Gala { namespace Gala {
const OptionEntry[] OPTIONS = { private const OptionEntry[] OPTIONS = {
{ "version", 0, OptionFlags.NO_ARG, OptionArg.CALLBACK, (void*) print_version, "Print version", null }, { "version", 0, OptionFlags.NO_ARG, OptionArg.CALLBACK, (void*) print_version, "Print version", null },
{ null } { null }
}; };
void print_version () { private void print_version () {
stdout.printf ("Gala %s\n", Config.VERSION); stdout.printf ("Gala %s\n", Config.VERSION);
Meta.exit (Meta.ExitCode.SUCCESS); Meta.exit (Meta.ExitCode.SUCCESS);
} }

View File

@ -34,8 +34,8 @@ namespace Gala {
} }
} }
static MediaFeedback? instance = null; private static MediaFeedback? instance = null;
static ThreadPool<Feedback>? pool = null; private static ThreadPool<Feedback>? pool = null;
public static void init () { public static void init () {
if (instance == null) if (instance == null)
@ -50,10 +50,10 @@ namespace Gala {
} }
} }
DBusNotifications? notifications = null; private DBusNotifications? notifications = null;
uint32 notification_id = 0; private uint32 notification_id = 0;
MediaFeedback () { private MediaFeedback () {
Object (); Object ();
} }
@ -88,7 +88,7 @@ namespace Gala {
notifications = null; notifications = null;
} }
void send_feedback (owned Feedback feedback) { private void send_feedback (owned Feedback feedback) {
if (notifications == null) { if (notifications == null) {
return; return;
} }

View File

@ -16,10 +16,10 @@
// //
namespace Gala { namespace Gala {
delegate PluginInfo RegisterPluginFunction (); public delegate PluginInfo RegisterPluginFunction ();
public class PluginManager : Object { public class PluginManager : Object {
static PluginManager? instance = null; private static PluginManager? instance = null;
public static unowned PluginManager get_default () { public static unowned PluginManager get_default () {
if (instance == null) if (instance == null)
instance = new PluginManager (); instance = new PluginManager ();
@ -41,14 +41,14 @@ namespace Gala {
public string? window_overview_provider { get; private set; default = null; } public string? window_overview_provider { get; private set; default = null; }
public string? workspace_view_provider { get; private set; default = null; } public string? workspace_view_provider { get; private set; default = null; }
HashTable<string,Plugin> plugins; private HashTable<string,Plugin> plugins;
File plugin_dir; private File plugin_dir;
WindowManager? wm = null; private WindowManager? wm = null;
Gee.LinkedList<PluginInfo?> load_later_plugins; private Gee.LinkedList<PluginInfo?> load_later_plugins;
PluginManager () { private PluginManager () {
plugins = new HashTable<string,Plugin> (str_hash, str_equal); plugins = new HashTable<string,Plugin> (str_hash, str_equal);
load_later_plugins = new Gee.LinkedList<PluginInfo?> (); load_later_plugins = new Gee.LinkedList<PluginInfo?> ();
@ -84,7 +84,7 @@ namespace Gala {
} }
} }
bool load_module (string plugin_name) { private bool load_module (string plugin_name) {
var path = Module.build_path (plugin_dir.get_path (), plugin_name); var path = Module.build_path (plugin_dir.get_path (), plugin_name);
var module = Module.open (path, ModuleFlags.BIND_LOCAL); var module = Module.open (path, ModuleFlags.BIND_LOCAL);
if (module == null) { if (module == null) {
@ -122,7 +122,7 @@ namespace Gala {
return true; return true;
} }
void load_plugin_class (PluginInfo info) { private void load_plugin_class (PluginInfo info) {
var plugin = (Plugin)Object.@new (info.plugin_type); var plugin = (Plugin)Object.@new (info.plugin_type);
plugins.set (info.module_name, plugin); plugins.set (info.module_name, plugin);
@ -134,12 +134,12 @@ namespace Gala {
} }
} }
void initialize_plugin (string plugin_name, Plugin plugin) { private void initialize_plugin (string plugin_name, Plugin plugin) {
plugin.initialize (wm); plugin.initialize (wm);
plugin.region_changed.connect (recalculate_regions); plugin.region_changed.connect (recalculate_regions);
} }
bool check_provides (string name, PluginFunction provides) { private bool check_provides (string name, PluginFunction provides) {
var message = "Plugins %s and %s both provide %s functionality, using first one only"; var message = "Plugins %s and %s both provide %s functionality, using first one only";
switch (provides) { switch (provides) {
case PluginFunction.WORKSPACE_VIEW: case PluginFunction.WORKSPACE_VIEW:
@ -200,7 +200,7 @@ namespace Gala {
* Iterate over all plugins and grab their regions, update the regions * Iterate over all plugins and grab their regions, update the regions
* array accordingly and emit the regions_changed signal. * array accordingly and emit the regions_changed signal.
*/ */
void recalculate_regions () { private void recalculate_regions () {
X.Xrectangle[] regions = {}; X.Xrectangle[] regions = {};
plugins.@foreach ((name, plugin) => { plugins.@foreach ((name, plugin) => {

View File

@ -16,12 +16,12 @@
// //
namespace Gala { namespace Gala {
const string EXTENSION = ".png"; private const string EXTENSION = ".png";
const int UNCONCEAL_TEXT_TIMEOUT = 2000; private const int UNCONCEAL_TEXT_TIMEOUT = 2000;
[DBus (name="org.gnome.Shell.Screenshot")] [DBus (name="org.gnome.Shell.Screenshot")]
public class ScreenshotManager : Object { public class ScreenshotManager : Object {
static ScreenshotManager? instance; private static ScreenshotManager? instance;
[DBus (visible = false)] [DBus (visible = false)]
public static unowned ScreenshotManager init (WindowManager wm) { public static unowned ScreenshotManager init (WindowManager wm) {
@ -31,19 +31,19 @@ namespace Gala {
return instance; return instance;
} }
WindowManager wm; private WindowManager wm;
Settings desktop_settings; private Settings desktop_settings;
string prev_font_regular; private string prev_font_regular;
string prev_font_document; private string prev_font_document;
string prev_font_mono; private string prev_font_mono;
uint conceal_timeout; private uint conceal_timeout;
construct { construct {
desktop_settings = new Settings ("org.gnome.desktop.interface"); desktop_settings = new Settings ("org.gnome.desktop.interface");
} }
ScreenshotManager (WindowManager _wm) { private ScreenshotManager (WindowManager _wm) {
wm = _wm; wm = _wm;
} }
@ -249,7 +249,7 @@ namespace Gala {
return result; return result;
} }
static string find_target_path () { private static string find_target_path () {
// Try to create dedicated "Screenshots" subfolder in PICTURES xdg-dir // Try to create dedicated "Screenshots" subfolder in PICTURES xdg-dir
unowned string? base_path = Environment.get_user_special_dir (UserDirectory.PICTURES); unowned string? base_path = Environment.get_user_special_dir (UserDirectory.PICTURES);
if (base_path != null && FileUtils.test (base_path, FileTest.EXISTS)) { if (base_path != null && FileUtils.test (base_path, FileTest.EXISTS)) {
@ -266,13 +266,13 @@ namespace Gala {
return Environment.get_home_dir (); return Environment.get_home_dir ();
} }
static async bool save_image (Cairo.ImageSurface image, string filename, out string used_filename) { private static async bool save_image (Cairo.ImageSurface image, string filename, out string used_filename) {
return (filename != "") return (filename != "")
? yield save_image_to_file (image, filename, out used_filename) ? yield save_image_to_file (image, filename, out used_filename)
: save_image_to_clipboard (image, filename, out used_filename); : save_image_to_clipboard (image, filename, out used_filename);
} }
static async bool save_image_to_file (Cairo.ImageSurface image, string filename, out string used_filename) { private static async bool save_image_to_file (Cairo.ImageSurface image, string filename, out string used_filename) {
used_filename = filename; used_filename = filename;
// We only alter non absolute filename because absolute // We only alter non absolute filename because absolute
@ -309,7 +309,7 @@ namespace Gala {
} }
} }
static bool save_image_to_clipboard (Cairo.ImageSurface image, string filename, out string used_filename) { private static bool save_image_to_clipboard (Cairo.ImageSurface image, string filename, out string used_filename) {
used_filename = filename; used_filename = filename;
unowned Gdk.Display display = Gdk.Display.get_default (); unowned Gdk.Display display = Gdk.Display.get_default ();
@ -339,7 +339,7 @@ namespace Gala {
context.play_full (0, props, null); context.play_full (0, props, null);
} }
Cairo.ImageSurface take_screenshot (int x, int y, int width, int height, bool include_cursor) { private Cairo.ImageSurface take_screenshot (int x, int y, int width, int height, bool include_cursor) {
Cairo.ImageSurface image; Cairo.ImageSurface image;
#if HAS_MUTTER338 #if HAS_MUTTER338
int image_width, image_height; int image_width, image_height;
@ -393,7 +393,7 @@ namespace Gala {
return image; return image;
} }
Cairo.ImageSurface composite_capture_images (Clutter.Capture[] captures, int x, int y, int width, int height) { private Cairo.ImageSurface composite_capture_images (Clutter.Capture[] captures, int x, int y, int width, int height) {
var image = new Cairo.ImageSurface (captures[0].image.get_format (), width, height); var image = new Cairo.ImageSurface (captures[0].image.get_format (), width, height);
var cr = new Cairo.Context (image); var cr = new Cairo.Context (image);
@ -414,7 +414,7 @@ namespace Gala {
return image; return image;
} }
Cairo.ImageSurface composite_stage_cursor (Cairo.ImageSurface image, Cairo.RectangleInt image_rect) { private Cairo.ImageSurface composite_stage_cursor (Cairo.ImageSurface image, Cairo.RectangleInt image_rect) {
unowned Meta.CursorTracker cursor_tracker = wm.get_display ().get_cursor_tracker (); unowned Meta.CursorTracker cursor_tracker = wm.get_display ().get_cursor_tracker ();
Graphene.Point coords = {}; Graphene.Point coords = {};
#if HAS_MUTTER40 #if HAS_MUTTER40
@ -454,7 +454,7 @@ namespace Gala {
return (Cairo.ImageSurface)cr.get_target (); return (Cairo.ImageSurface)cr.get_target ();
} }
async void wait_stage_repaint () { private async void wait_stage_repaint () {
ulong signal_id = 0UL; ulong signal_id = 0UL;
signal_id = wm.stage.after_paint.connect (() => { signal_id = wm.stage.after_paint.connect (() => {
wm.stage.disconnect (signal_id); wm.stage.disconnect (signal_id);

View File

@ -32,7 +32,7 @@ namespace Gala {
[DBus (name = "org.gnome.SessionManager.EndSessionDialog")] [DBus (name = "org.gnome.SessionManager.EndSessionDialog")]
public class SessionManager : Object { public class SessionManager : Object {
static SessionManager? instance; private static SessionManager? instance;
[DBus (visible = false)] [DBus (visible = false)]
public static unowned SessionManager init () { public static unowned SessionManager init () {
@ -49,14 +49,14 @@ namespace Gala {
public signal void canceled (); public signal void canceled ();
public signal void closed (); public signal void closed ();
WingpanelEndSessionDialog? proxy = null; private WingpanelEndSessionDialog? proxy = null;
SessionManager () { private SessionManager () {
Bus.watch_name (BusType.SESSION, "io.elementary.wingpanel.session.EndSessionDialog", Bus.watch_name (BusType.SESSION, "io.elementary.wingpanel.session.EndSessionDialog",
BusNameWatcherFlags.NONE, proxy_appeared, proxy_vanished); BusNameWatcherFlags.NONE, proxy_appeared, proxy_vanished);
} }
void get_proxy_cb (Object? o, AsyncResult? res) { private void get_proxy_cb (Object? o, AsyncResult? res) {
try { try {
proxy = Bus.get_proxy.end (res); proxy = Bus.get_proxy.end (res);
} catch (Error e) { } catch (Error e) {
@ -71,13 +71,13 @@ namespace Gala {
proxy.closed.connect (() => closed ()); proxy.closed.connect (() => closed ());
} }
void proxy_appeared () { private void proxy_appeared () {
Bus.get_proxy.begin<WingpanelEndSessionDialog> (BusType.SESSION, Bus.get_proxy.begin<WingpanelEndSessionDialog> (BusType.SESSION,
"io.elementary.wingpanel.session.EndSessionDialog", "/io/elementary/wingpanel/session/EndSessionDialog", "io.elementary.wingpanel.session.EndSessionDialog", "/io/elementary/wingpanel/session/EndSessionDialog",
0, null, get_proxy_cb); 0, null, get_proxy_cb);
} }
void proxy_vanished () { private void proxy_vanished () {
proxy = null; proxy = null;
} }

View File

@ -13,11 +13,11 @@ namespace Gala {
public class IconGroup : Clutter.Actor { public class IconGroup : Clutter.Actor {
public const int SIZE = 64; public const int SIZE = 64;
const int PLUS_SIZE = 8; private const int PLUS_SIZE = 8;
const int PLUS_WIDTH = 24; private const int PLUS_WIDTH = 24;
const int CLOSE_BUTTON_SIZE = 36; private const int CLOSE_BUTTON_SIZE = 36;
const int SHOW_CLOSE_BUTTON_DELAY = 200; private const int SHOW_CLOSE_BUTTON_DELAY = 200;
/** /**
* The group has been clicked. The MultitaskingView should consider activating * The group has been clicked. The MultitaskingView should consider activating
@ -25,7 +25,7 @@ namespace Gala {
*/ */
public signal void selected (); public signal void selected ();
uint8 _backdrop_opacity = 0; private uint8 _backdrop_opacity = 0;
/** /**
* The opacity of the backdrop/highlight. Set by the active property setter. * The opacity of the backdrop/highlight. Set by the active property setter.
*/ */
@ -39,7 +39,7 @@ namespace Gala {
} }
} }
bool _active = false; private bool _active = false;
/** /**
* Fades in/out the backdrop/highlight * Fades in/out the backdrop/highlight
*/ */
@ -67,13 +67,13 @@ namespace Gala {
} }
} }
DragDropAction drag_action; private DragDropAction drag_action;
public Meta.Workspace workspace { get; construct; } public Meta.Workspace workspace { get; construct; }
Clutter.Actor? prev_parent = null; private Clutter.Actor? prev_parent = null;
Clutter.Actor close_button; private Clutter.Actor close_button;
Clutter.Actor icon_container; private Clutter.Actor icon_container;
public IconGroup (Meta.Workspace workspace) { public IconGroup (Meta.Workspace workspace) {
Object (workspace: workspace); Object (workspace: workspace);
@ -179,7 +179,7 @@ namespace Gala {
close_button.add_transition ("opacity", new_transition); close_button.add_transition ("opacity", new_transition);
} }
bool resize_canvas () { private bool resize_canvas () {
var scale = InternalUtils.get_ui_scaling_factor (); var scale = InternalUtils.get_ui_scaling_factor ();
var size = SIZE * scale; var size = SIZE * scale;
@ -189,7 +189,7 @@ namespace Gala {
return ((Clutter.Canvas) content).set_size (size, size); return ((Clutter.Canvas) content).set_size (size, size);
} }
void place_close_button () { private void place_close_button () {
var size = CLOSE_BUTTON_SIZE * InternalUtils.get_ui_scaling_factor (); var size = CLOSE_BUTTON_SIZE * InternalUtils.get_ui_scaling_factor ();
close_button.set_size (size, size); close_button.set_size (size, size);
@ -308,7 +308,7 @@ namespace Gala {
* That way the workspace won't be deleted if windows decide to ignore the * That way the workspace won't be deleted if windows decide to ignore the
* delete signal * delete signal
*/ */
void close () { private void close () {
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;
@ -322,7 +322,7 @@ namespace Gala {
* Draw the background or plus sign and do layouting. We won't lose performance here * Draw the background or plus sign and do layouting. We won't lose performance here
* by relayouting in the same function, as it's only ever called when we invalidate it. * by relayouting in the same function, as it's only ever called when we invalidate it.
*/ */
bool draw (Cairo.Context cr) { private bool draw (Cairo.Context cr) {
var scale = InternalUtils.get_ui_scaling_factor (); var scale = InternalUtils.get_ui_scaling_factor ();
cr.set_operator (Cairo.Operator.CLEAR); cr.set_operator (Cairo.Operator.CLEAR);
@ -486,7 +486,7 @@ namespace Gala {
return false; return false;
} }
Clutter.Actor? drag_begin (float click_x, float click_y) { private 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 ();
@ -521,7 +521,7 @@ namespace Gala {
return this; return this;
} }
void drag_end (Clutter.Actor destination) { private void drag_end (Clutter.Actor destination) {
if (destination is WorkspaceInsertThumb) { if (destination is WorkspaceInsertThumb) {
get_parent ().remove_child (this); get_parent ().remove_child (this);
@ -535,12 +535,12 @@ namespace Gala {
} }
} }
void drag_canceled () { private void drag_canceled () {
get_parent ().remove_child (this); get_parent ().remove_child (this);
restore_group (); restore_group ();
} }
void restore_group () { private void restore_group () {
var container = prev_parent as IconGroupContainer; var container = prev_parent as IconGroupContainer;
if (container != null) { if (container != null) {
container.add_group (this); container.add_group (this);

View File

@ -98,7 +98,7 @@ namespace Gala {
} }
} }
void expanded_changed (ParamSpec param) { private void expanded_changed (ParamSpec param) {
request_reposition (true); request_reposition (true);
} }
@ -143,7 +143,7 @@ namespace Gala {
} }
} }
void update_inserter_indices () { private void update_inserter_indices () {
var current_index = 0; var current_index = 0;
foreach (var child in get_children ()) { foreach (var child in get_children ()) {

View File

@ -30,8 +30,8 @@ namespace Gala {
public int monitor { get; construct; } public int monitor { get; construct; }
public GestureTracker gesture_tracker { get; construct; } public GestureTracker gesture_tracker { get; construct; }
WindowCloneContainer window_container; private WindowCloneContainer window_container;
BackgroundManager background; private BackgroundManager background;
public MonitorClone (Meta.Display display, int monitor, GestureTracker gesture_tracker) { public MonitorClone (Meta.Display display, int monitor, GestureTracker gesture_tracker) {
Object (display: display, monitor: monitor, gesture_tracker: gesture_tracker); Object (display: display, monitor: monitor, gesture_tracker: gesture_tracker);
@ -103,14 +103,14 @@ namespace Gala {
background.opacity = 255; background.opacity = 255;
} }
void window_left (int window_monitor, Meta.Window window) { private 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, Meta.Window window) { private void window_entered (int window_monitor, Meta.Window window) {
if (window_monitor != monitor || window.window_type != Meta.WindowType.NORMAL) if (window_monitor != monitor || window.window_type != Meta.WindowType.NORMAL)
return; return;

View File

@ -28,20 +28,20 @@ namespace Gala {
private GestureTracker multitasking_gesture_tracker; private GestureTracker multitasking_gesture_tracker;
private GestureTracker workspace_gesture_tracker; private GestureTracker workspace_gesture_tracker;
const int SMOOTH_SCROLL_DELAY = 500; private const int SMOOTH_SCROLL_DELAY = 500;
public WindowManager wm { get; construct; } public WindowManager wm { get; construct; }
Meta.Display display; private Meta.Display display;
ModalProxy modal_proxy; private ModalProxy modal_proxy;
bool opened = false; private bool opened = false;
bool animating = false; private bool animating = false;
List<MonitorClone> window_containers_monitors; private List<MonitorClone> window_containers_monitors;
IconGroupContainer icon_groups; private IconGroupContainer icon_groups;
Clutter.Actor workspaces; private Clutter.Actor workspaces;
Clutter.Actor dock_clones; private Clutter.Actor dock_clones;
private GLib.Settings gala_behavior_settings; private GLib.Settings gala_behavior_settings;
@ -135,7 +135,7 @@ namespace Gala {
* Places the primary container for the WorkspaceClones and the * Places the primary container for the WorkspaceClones and the
* MonitorClones at the right positions * MonitorClones at the right positions
*/ */
void update_monitors () { private void update_monitors () {
foreach (var monitor_clone in window_containers_monitors) foreach (var monitor_clone in window_containers_monitors)
monitor_clone.destroy (); monitor_clone.destroy ();
@ -347,7 +347,7 @@ namespace Gala {
* @param animate Whether to animate the movement or have all elements take their * @param animate Whether to animate the movement or have all elements take their
* positions immediately. * positions immediately.
*/ */
void update_positions (bool animate) { private void update_positions (bool animate) {
unowned Meta.WorkspaceManager manager = display.get_workspace_manager (); unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
var active_index = manager.get_active_workspace ().index (); var active_index = manager.get_active_workspace ().index ();
var active_x = 0.0f; var active_x = 0.0f;
@ -378,7 +378,7 @@ namespace Gala {
reposition_icon_groups (animate); reposition_icon_groups (animate);
} }
void reposition_icon_groups (bool animate) { private void reposition_icon_groups (bool animate) {
unowned Meta.WorkspaceManager manager = display.get_workspace_manager (); unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
var active_index = manager.get_active_workspace ().index (); var active_index = manager.get_active_workspace ().index ();
@ -401,7 +401,7 @@ namespace Gala {
icon_groups.restore_easing_state (); icon_groups.restore_easing_state ();
} }
void add_workspace (int num) { private void add_workspace (int num) {
unowned Meta.WorkspaceManager manager = display.get_workspace_manager (); unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
var workspace = new WorkspaceClone (manager.get_workspace_by_index (num), multitasking_gesture_tracker); var workspace = new WorkspaceClone (manager.get_workspace_by_index (num), multitasking_gesture_tracker);
workspace.window_selected.connect (window_selected); workspace.window_selected.connect (window_selected);
@ -416,7 +416,7 @@ namespace Gala {
workspace.open (); workspace.open ();
} }
void remove_workspace (int num) { private void remove_workspace (int num) {
WorkspaceClone? workspace = null; WorkspaceClone? workspace = null;
// FIXME is there a better way to get the removed workspace? // FIXME is there a better way to get the removed workspace?
@ -457,7 +457,7 @@ namespace Gala {
* Otherwise it will only be made active, but the view won't be * Otherwise it will only be made active, but the view won't be
* closed. * closed.
*/ */
void activate_workspace (WorkspaceClone clone, bool close_view) { private void activate_workspace (WorkspaceClone clone, bool close_view) {
unowned Meta.WorkspaceManager manager = display.get_workspace_manager (); unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
close_view = close_view && manager.get_active_workspace () == clone.workspace; close_view = close_view && manager.get_active_workspace () == clone.workspace;
@ -509,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 (Meta.MotionDirection direction) { private 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);
} }
@ -518,7 +518,7 @@ namespace Gala {
* *
* @return The active WorkspaceClone * @return The active WorkspaceClone
*/ */
WorkspaceClone get_active_workspace_clone () { private WorkspaceClone get_active_workspace_clone () {
unowned Meta.WorkspaceManager manager = display.get_workspace_manager (); unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
foreach (var child in workspaces.get_children ()) { foreach (var child in workspaces.get_children ()) {
unowned WorkspaceClone workspace_clone = (WorkspaceClone) child; unowned WorkspaceClone workspace_clone = (WorkspaceClone) child;
@ -530,7 +530,7 @@ namespace Gala {
assert_not_reached (); assert_not_reached ();
} }
void window_selected (Meta.Window window) { private void window_selected (Meta.Window window) {
var time = display.get_current_time (); var time = display.get_current_time ();
unowned Meta.WorkspaceManager manager = display.get_workspace_manager (); unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
var workspace = window.get_workspace (); var workspace = window.get_workspace ();
@ -573,7 +573,7 @@ namespace Gala {
* starting the modal mode and hiding the WindowGroup. Finally tells all components * starting the modal mode and hiding the WindowGroup. Finally tells all components
* to animate to their positions. * to animate to their positions.
*/ */
void toggle (bool with_gesture = false, bool is_cancel_animation = false) { private void toggle (bool with_gesture = false, bool is_cancel_animation = false) {
if (animating) { if (animating) {
return; return;
} }
@ -683,7 +683,7 @@ namespace Gala {
} }
} }
void show_docks (bool with_gesture, bool is_cancel_animation) { private void show_docks (bool with_gesture, bool is_cancel_animation) {
unowned GLib.List<Meta.WindowActor> window_actors = display.get_window_actors (); unowned GLib.List<Meta.WindowActor> window_actors = display.get_window_actors ();
foreach (unowned Meta.WindowActor actor in window_actors) { foreach (unowned Meta.WindowActor actor in window_actors) {
const int MAX_OFFSET = 85; const int MAX_OFFSET = 85;
@ -748,7 +748,7 @@ namespace Gala {
} }
} }
void hide_docks (bool with_gesture, bool is_cancel_animation) { private 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 = (Clutter.Clone) child; var dock = (Clutter.Clone) child;
var initial_y = dock.y; var initial_y = dock.y;

View File

@ -53,7 +53,7 @@ namespace Gala {
window.unmanaged.disconnect (reset_source); window.unmanaged.disconnect (reset_source);
} }
void reset_source () { private void reset_source () {
// actually destroying the clone will be handled somewhere else (unless we were // actually destroying the clone will be handled somewhere else (unless we were
// requested to destroy it), we just need to make sure the clone doesn't attempt // requested to destroy it), we just need to make sure the clone doesn't attempt
// to draw a clone of a window that has been destroyed // to draw a clone of a window that has been destroyed

View File

@ -30,13 +30,13 @@ namespace Gala {
public GestureTracker? gesture_tracker { get; construct; } public GestureTracker? gesture_tracker { get; construct; }
public bool overview_mode { get; construct; } public bool overview_mode { get; construct; }
bool opened; private bool opened;
/** /**
* The window that is currently selected via keyboard shortcuts. It is not * The window that is currently selected via keyboard shortcuts. It is not
* necessarily the same as the active window. * necessarily the same as the active window.
*/ */
WindowClone? current_window; private WindowClone? current_window;
public WindowCloneContainer (GestureTracker? gesture_tracker, bool overview_mode = false) { public WindowCloneContainer (GestureTracker? gesture_tracker, bool overview_mode = false) {
Object (gesture_tracker: gesture_tracker, overview_mode: overview_mode); Object (gesture_tracker: gesture_tracker, overview_mode: overview_mode);
@ -111,11 +111,11 @@ namespace Gala {
} }
} }
void window_selected_cb (WindowClone tiled) { private void window_selected_cb (WindowClone tiled) {
window_selected (tiled.window); window_selected (tiled.window);
} }
void window_destroyed (Clutter.Actor actor) { private void window_destroyed (Clutter.Actor actor) {
var window = actor as WindowClone; var window = actor as WindowClone;
if (window == null) if (window == null)
return; return;

View File

@ -24,9 +24,9 @@ namespace Gala {
public class WindowIconActor : Clutter.Actor { public class WindowIconActor : Clutter.Actor {
public Meta.Window window { get; construct; } public Meta.Window window { get; construct; }
int icon_scale; private int icon_scale;
int _icon_size; private int _icon_size;
/** /**
* The icon size of the WindowIcon. Once set the new icon will be * The icon size of the WindowIcon. Once set the new icon will be
* faded over the old one and the actor animates to the new size. * faded over the old one and the actor animates to the new size.
@ -51,7 +51,7 @@ namespace Gala {
} }
} }
bool _temporary; private bool _temporary;
/** /**
* Mark the WindowIcon as temporary. Only effect of this is that a pulse * Mark the WindowIcon as temporary. Only effect of this is that a pulse
* animation will be played on the actor. Used while DnDing window thumbs * animation will be played on the actor. Used while DnDing window thumbs
@ -98,10 +98,10 @@ namespace Gala {
} }
} }
bool initial = true; private bool initial = true;
WindowIcon? icon = null; private WindowIcon? icon = null;
WindowIcon? old_icon = null; private WindowIcon? old_icon = null;
public WindowIconActor (Meta.Window window) { public WindowIconActor (Meta.Window window) {
Object (window: window); Object (window: window);
@ -120,7 +120,7 @@ namespace Gala {
window.notify["on-all-workspaces"].disconnect (on_all_workspaces_changed); window.notify["on-all-workspaces"].disconnect (on_all_workspaces_changed);
} }
void on_all_workspaces_changed () { private void on_all_workspaces_changed () {
// we don't display windows that are on all workspaces // we don't display windows that are on all workspaces
if (window.on_all_workspaces) if (window.on_all_workspaces)
destroy (); destroy ();
@ -151,7 +151,7 @@ namespace Gala {
/** /**
* Fades out the old icon and fades in the new icon * Fades out the old icon and fades in the new icon
*/ */
void fade_new_icon () { private 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 Clutter.BindConstraint (this, Clutter.BindCoordinate.SIZE, 0)); new_icon.add_constraint (new Clutter.BindConstraint (this, Clutter.BindCoordinate.SIZE, 0));

View File

@ -25,18 +25,18 @@ namespace Gala {
public delegate void WindowPlacer (Clutter.Actor window, Meta.Rectangle rect); public delegate void WindowPlacer (Clutter.Actor window, Meta.Rectangle rect);
public class WindowOverview : Clutter.Actor, ActivatableComponent { public class WindowOverview : Clutter.Actor, ActivatableComponent {
const int BORDER = 10; private const int BORDER = 10;
const int TOP_GAP = 30; private const int TOP_GAP = 30;
const int BOTTOM_GAP = 100; private const int BOTTOM_GAP = 100;
public WindowManager wm { get; construct; } public WindowManager wm { get; construct; }
Meta.Display display; private Meta.Display display;
ModalProxy modal_proxy; private ModalProxy modal_proxy;
bool ready; private bool ready;
// the workspaces which we expose right now // the workspaces which we expose right now
List<Meta.Workspace> workspaces; private List<Meta.Workspace> workspaces;
public WindowOverview (WindowManager wm) { public WindowOverview (WindowManager wm) {
Object (wm : wm); Object (wm : wm);
@ -193,17 +193,17 @@ namespace Gala {
ready = true; ready = true;
} }
bool keybinding_filter (Meta.KeyBinding binding) { private 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 (Meta.Display display) { private 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, Meta.Window window) { private 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;
@ -216,7 +216,7 @@ namespace Gala {
} }
} }
void add_window (Meta.Window window) { private void add_window (Meta.Window window) {
if (!visible if (!visible
|| (window.window_type != Meta.WindowType.NORMAL && window.window_type != Meta.WindowType.DIALOG)) || (window.window_type != Meta.WindowType.NORMAL && window.window_type != Meta.WindowType.DIALOG))
return; return;
@ -233,7 +233,7 @@ namespace Gala {
} }
} }
void remove_window (Meta.Window window) { private 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;
@ -241,7 +241,7 @@ namespace Gala {
container.remove_window (window); container.remove_window (window);
} }
void thumb_selected (Meta.Window window) { private 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 ();
@ -283,7 +283,7 @@ namespace Gala {
}); });
} }
void cleanup () { private void cleanup () {
ready = true; ready = true;
visible = false; visible = false;

View File

@ -13,30 +13,30 @@ namespace Gala {
public const int WRAPPER_PADDING = 12; public const int WRAPPER_PADDING = 12;
public const string CAPTION_FONT_NAME = "Inter"; public const string CAPTION_FONT_NAME = "Inter";
const int MIN_OFFSET = 64; private const int MIN_OFFSET = 64;
const int FIX_TIMEOUT_INTERVAL = 100; private const int FIX_TIMEOUT_INTERVAL = 100;
public bool opened { get; private set; default = false; } public bool opened { get; private set; default = false; }
public Gala.WindowManager? wm { get; construct; } public Gala.WindowManager? wm { get; construct; }
Gala.ModalProxy modal_proxy = null; private Gala.ModalProxy modal_proxy = null;
private Granite.Settings granite_settings; private Granite.Settings granite_settings;
private Clutter.Canvas canvas; private Clutter.Canvas canvas;
Clutter.Actor container; private Clutter.Actor container;
Clutter.Actor indicator; private Clutter.Actor indicator;
Clutter.Text caption; private Clutter.Text caption;
int modifier_mask; private int modifier_mask;
WindowIcon? cur_icon = null; private WindowIcon? cur_icon = null;
private int scaling_factor = 1; private int scaling_factor = 1;
// For some reason, on Odin, the height of the caption loses // For some reason, on Odin, the height of the caption loses
// its padding after the first time the switcher displays. As a // its padding after the first time the switcher displays. As a
// workaround, I store the initial value here once we have it. // workaround, I store the initial value here once we have it.
float caption_height = -1.0f; private float caption_height = -1.0f;
public WindowSwitcher (Gala.WindowManager wm) { public WindowSwitcher (Gala.WindowManager wm) {
Object (wm: wm); Object (wm: wm);
@ -212,7 +212,7 @@ namespace Gala {
next_window (display, workspace, backward); next_window (display, workspace, backward);
} }
bool collect_windows (Meta.Display display, Meta.Workspace? workspace) { private bool collect_windows (Meta.Display display, Meta.Workspace? workspace) {
var windows = display.get_tab_list (Meta.TabList.NORMAL, workspace); var windows = display.get_tab_list (Meta.TabList.NORMAL, workspace);
if (windows == null) { if (windows == null) {
@ -237,7 +237,7 @@ namespace Gala {
return true; return true;
} }
void open_switcher () { private void open_switcher () {
var display = wm.get_display (); var display = wm.get_display ();
if (container.get_n_children () == 0) { if (container.get_n_children () == 0) {
@ -310,7 +310,7 @@ namespace Gala {
} }
} }
void toggle_display (bool show) { private void toggle_display (bool show) {
if (opened == show) { if (opened == show) {
return; return;
} }
@ -330,7 +330,7 @@ namespace Gala {
container.reactive = show; container.reactive = show;
} }
void push_modal () { private void push_modal () {
modal_proxy = wm.push_modal (this); modal_proxy = wm.push_modal (this);
modal_proxy.set_keybinding_filter ((binding) => { modal_proxy.set_keybinding_filter ((binding) => {
// if it's not built-in, we can block it right away // if it's not built-in, we can block it right away
@ -349,7 +349,7 @@ namespace Gala {
#endif #endif
} }
void close_switcher (uint32 time, bool cancel = false) { private void close_switcher (uint32 time, bool cancel = false) {
if (!opened) { if (!opened) {
return; return;
} }
@ -371,7 +371,7 @@ namespace Gala {
toggle_display (false); toggle_display (false);
} }
void next_window (Meta.Display display, Meta.Workspace? workspace, bool backward) { private void next_window (Meta.Display display, Meta.Workspace? workspace, bool backward) {
Clutter.Actor actor; Clutter.Actor actor;
var current = cur_icon; var current = cur_icon;
@ -396,7 +396,7 @@ namespace Gala {
update_indicator_position (); update_indicator_position ();
} }
void update_caption_text () { private void update_caption_text () {
var current_window = cur_icon.window; var current_window = cur_icon.window;
var current_caption = "n/a"; var current_caption = "n/a";
if (current_window != null) { if (current_window != null) {
@ -413,7 +413,7 @@ namespace Gala {
); );
} }
void update_indicator_position (bool initial = false) { private void update_indicator_position (bool initial = false) {
// FIXME there are some troubles with layouting, in some cases we // FIXME there are some troubles with layouting, in some cases we
// are here too early, in which case all the children are at // are here too early, in which case all the children are at
// (0|0), so we can easily check for that and come back later // (0|0), so we can easily check for that and come back later
@ -444,7 +444,7 @@ namespace Gala {
close_switcher (wm.get_display ().get_current_time ()); close_switcher (wm.get_display ().get_current_time ());
} }
bool container_motion_event (Clutter.MotionEvent event) { private bool container_motion_event (Clutter.MotionEvent event) {
var actor = event.stage.get_actor_at_pos (Clutter.PickMode.ALL, (int)event.x, (int)event.y); var actor = event.stage.get_actor_at_pos (Clutter.PickMode.ALL, (int)event.x, (int)event.y);
if (actor == null) { if (actor == null) {
return true; return true;
@ -463,7 +463,7 @@ namespace Gala {
return true; return true;
} }
bool container_mouse_press (Clutter.ButtonEvent event) { private bool container_mouse_press (Clutter.ButtonEvent event) {
if (opened && event.button == Gdk.BUTTON_PRIMARY) { if (opened && event.button == Gdk.BUTTON_PRIMARY) {
close_switcher (event.time); close_switcher (event.time);
} }
@ -486,7 +486,7 @@ namespace Gala {
return false; return false;
} }
Gdk.ModifierType get_current_modifiers () { private Gdk.ModifierType get_current_modifiers () {
Gdk.ModifierType modifiers; Gdk.ModifierType modifiers;
double[] axes = {}; double[] axes = {};
Gdk.Display.get_default () Gdk.Display.get_default ()

View File

@ -19,7 +19,7 @@ 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
*/ */
class FramedBackground : BackgroundManager { private class FramedBackground : BackgroundManager {
private Cogl.Pipeline pipeline; private Cogl.Pipeline pipeline;
private Cairo.ImageSurface cached_surface; private Cairo.ImageSurface cached_surface;
private Cairo.Context cached_context; private Cairo.Context cached_context;
@ -123,19 +123,19 @@ namespace Gala {
/** /**
* The offset of the scaled background to the top of the monitor bounds * The offset of the scaled background to the top of the monitor bounds
*/ */
const int TOP_OFFSET = 20; private const int TOP_OFFSET = 20;
/** /**
* The amount of time a window has to be over the WorkspaceClone while in drag * The amount of time a window has to be over the WorkspaceClone while in drag
* before we activate the workspace. * before we activate the workspace.
*/ */
const int HOVER_ACTIVATE_DELAY = 400; private const int HOVER_ACTIVATE_DELAY = 400;
/** /**
* The MultitaskingView shows the workspaces overlapping them WorkspaceClone.X_OFFSET pixels * The MultitaskingView shows the workspaces overlapping them WorkspaceClone.X_OFFSET pixels
* making it possible to move windows to the next/previous workspace. * making it possible to move windows to the next/previous workspace.
*/ */
public const int X_OFFSET = 150; public const int X_OFFSET = 150;
/** /**
* A window has been selected, the MultitaskingView should consider activating * A window has been selected, the MultitaskingView should consider activating
@ -156,7 +156,7 @@ namespace Gala {
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; }
bool _active = false; private bool _active = false;
/** /**
* If this WorkspaceClone is currently the active one. Also sets the active * If this WorkspaceClone is currently the active one. Also sets the active
* state on its IconGroup. * state on its IconGroup.
@ -171,10 +171,10 @@ namespace Gala {
} }
} }
BackgroundManager background; private BackgroundManager background;
bool opened; private bool opened;
uint hover_activate_timeout = 0; private uint hover_activate_timeout = 0;
public WorkspaceClone (Meta.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);
@ -265,7 +265,7 @@ 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 (Meta.Window window) { private void add_window (Meta.Window window) {
if (window.window_type != Meta.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
@ -283,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 (Meta.Window window) { private 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 (Meta.Display display, int monitor, Meta.Window window) { private void window_entered_monitor (Meta.Display display, int monitor, Meta.Window window) {
add_window (window); add_window (window);
} }
void window_left_monitor (Meta.Display display, int monitor, Meta.Window window) { private 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);
} }
@ -315,7 +315,7 @@ namespace Gala {
/** /**
* @return The amount of pixels the workspace is overlapped in the X axis. * @return The amount of pixels the workspace is overlapped in the X axis.
*/ */
float current_x_overlap () { private float current_x_overlap () {
var scale_factor = InternalUtils.get_ui_scaling_factor (); var scale_factor = InternalUtils.get_ui_scaling_factor ();
var display = workspace.get_display (); var display = workspace.get_display ();
unowned Meta.WorkspaceManager manager = display.get_workspace_manager (); unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
@ -334,7 +334,7 @@ namespace Gala {
* *
* @param amount The amount in px to shrink. * @param amount The amount in px to shrink.
*/ */
static inline void shrink_rectangle (ref Meta.Rectangle rect, int amount) { private static inline void shrink_rectangle (ref Meta.Rectangle rect, int amount) {
rect.x += amount; rect.x += amount;
rect.y += amount; rect.y += amount;
rect.width -= amount * 2; rect.width -= amount * 2;

View File

@ -11,7 +11,7 @@ public class Gala.WorkspaceInsertThumb : Clutter.Actor {
public bool expanded { get; set; default = false; } public bool expanded { get; set; default = false; }
public int delay { get; set; default = EXPAND_DELAY; } public int delay { get; set; default = EXPAND_DELAY; }
uint expand_timeout = 0; private uint expand_timeout = 0;
public WorkspaceInsertThumb (int workspace_index) { public WorkspaceInsertThumb (int workspace_index) {
Object (workspace_index: workspace_index); Object (workspace_index: workspace_index);

View File

@ -21,7 +21,7 @@ public class Gala.WindowListener : Object {
Meta.Rectangle outer; Meta.Rectangle outer;
} }
static WindowListener? instance = null; private static WindowListener? instance = null;
public static void init (Meta.Display display) { public static void init (Meta.Display display) {
if (instance != null) if (instance != null)
@ -50,9 +50,9 @@ public class Gala.WindowListener : Object {
public signal void window_no_longer_on_all_workspaces (Meta.Window window); public signal void window_no_longer_on_all_workspaces (Meta.Window window);
Gee.HashMap<Meta.Window, WindowGeometry?> unmaximized_state_geometry; private Gee.HashMap<Meta.Window, WindowGeometry?> unmaximized_state_geometry;
WindowListener () { private WindowListener () {
unmaximized_state_geometry = new Gee.HashMap<Meta.Window, WindowGeometry?> (); unmaximized_state_geometry = new Gee.HashMap<Meta.Window, WindowGeometry?> ();
} }
@ -63,7 +63,7 @@ public class Gala.WindowListener : Object {
window_maximized_changed (window); window_maximized_changed (window);
} }
void window_notify (Object object, ParamSpec pspec) { private void window_notify (Object object, ParamSpec pspec) {
var window = (Meta.Window) object; var window = (Meta.Window) object;
switch (pspec.name) { switch (pspec.name) {
@ -77,14 +77,14 @@ public class Gala.WindowListener : Object {
} }
} }
void window_on_all_workspaces_changed (Meta.Window window) { private void window_on_all_workspaces_changed (Meta.Window window) {
if (window.on_all_workspaces) if (window.on_all_workspaces)
return; return;
window_no_longer_on_all_workspaces (window); window_no_longer_on_all_workspaces (window);
} }
void window_maximized_changed (Meta.Window window) { private void window_maximized_changed (Meta.Window window) {
WindowGeometry window_geometry = {}; WindowGeometry window_geometry = {};
window_geometry.inner = window.get_frame_rect (); window_geometry.inner = window.get_frame_rect ();
window_geometry.outer = window.get_buffer_rect (); window_geometry.outer = window.get_buffer_rect ();

View File

@ -16,8 +16,8 @@
// //
namespace Gala { namespace Gala {
const string DAEMON_DBUS_NAME = "org.pantheon.gala.daemon"; private const string DAEMON_DBUS_NAME = "org.pantheon.gala.daemon";
const string DAEMON_DBUS_OBJECT_PATH = "/org/pantheon/gala/daemon"; private const string DAEMON_DBUS_OBJECT_PATH = "/org/pantheon/gala/daemon";
[DBus (name = "org.pantheon.gala.daemon")] [DBus (name = "org.pantheon.gala.daemon")]
public interface Daemon: GLib.Object { public interface Daemon: GLib.Object {
@ -65,45 +65,45 @@ namespace Gala {
public PointerLocator pointer_locator { get; private set; } public PointerLocator pointer_locator { get; private set; }
SystemBackground system_background; private SystemBackground system_background;
Meta.PluginInfo info; private Meta.PluginInfo info;
WindowSwitcher? winswitcher = null; private WindowSwitcher? winswitcher = null;
ActivatableComponent? window_overview = null; private ActivatableComponent? window_overview = null;
public ScreenSaverManager? screensaver { get; private set; } public ScreenSaverManager? screensaver { get; private set; }
HotCornerManager? hot_corner_manager = null; private HotCornerManager? hot_corner_manager = null;
public WindowTracker? window_tracker { get; private set; } public WindowTracker? window_tracker { get; private set; }
/** /**
* Allow to zoom in/out the entire desktop. * Allow to zoom in/out the entire desktop.
*/ */
Zoom? zoom = null; private Zoom? zoom = null;
AccentColorManager accent_color_manager; private AccentColorManager accent_color_manager;
Clutter.Actor? tile_preview; private Clutter.Actor? tile_preview;
private Meta.Window? moving; //place for the window that is being moved over private Meta.Window? moving; //place for the window that is being moved over
Daemon? daemon_proxy = null; private Daemon? daemon_proxy = null;
NotificationStack notification_stack; private NotificationStack notification_stack;
Gee.LinkedList<ModalProxy> modal_stack = new Gee.LinkedList<ModalProxy> (); private Gee.LinkedList<ModalProxy> modal_stack = new Gee.LinkedList<ModalProxy> ();
Gee.HashSet<Meta.WindowActor> minimizing = new Gee.HashSet<Meta.WindowActor> (); private Gee.HashSet<Meta.WindowActor> minimizing = new Gee.HashSet<Meta.WindowActor> ();
Gee.HashSet<Meta.WindowActor> maximizing = new Gee.HashSet<Meta.WindowActor> (); private Gee.HashSet<Meta.WindowActor> maximizing = new Gee.HashSet<Meta.WindowActor> ();
Gee.HashSet<Meta.WindowActor> unmaximizing = new Gee.HashSet<Meta.WindowActor> (); private Gee.HashSet<Meta.WindowActor> unmaximizing = new Gee.HashSet<Meta.WindowActor> ();
Gee.HashSet<Meta.WindowActor> mapping = new Gee.HashSet<Meta.WindowActor> (); private Gee.HashSet<Meta.WindowActor> mapping = new Gee.HashSet<Meta.WindowActor> ();
Gee.HashSet<Meta.WindowActor> destroying = new Gee.HashSet<Meta.WindowActor> (); private Gee.HashSet<Meta.WindowActor> destroying = new Gee.HashSet<Meta.WindowActor> ();
Gee.HashSet<Meta.WindowActor> unminimizing = new Gee.HashSet<Meta.WindowActor> (); private Gee.HashSet<Meta.WindowActor> unminimizing = new Gee.HashSet<Meta.WindowActor> ();
GLib.HashTable<Meta.Window, int> ws_assoc = new GLib.HashTable<Meta.Window, int> (direct_hash, direct_equal); private GLib.HashTable<Meta.Window, int> ws_assoc = new GLib.HashTable<Meta.Window, int> (direct_hash, direct_equal);
Meta.SizeChange? which_change = null; private Meta.SizeChange? which_change = null;
Meta.Rectangle old_rect_size_change; private Meta.Rectangle old_rect_size_change;
private GLib.Settings animations_settings; private GLib.Settings animations_settings;
private GLib.Settings behavior_settings; private GLib.Settings behavior_settings;
@ -149,11 +149,11 @@ namespace Gala {
}); });
} }
void lost_daemon () { private void lost_daemon () {
daemon_proxy = null; daemon_proxy = null;
} }
void daemon_appeared () { private void daemon_appeared () {
if (daemon_proxy == null) { if (daemon_proxy == null) {
Bus.get_proxy.begin<Daemon> (BusType.SESSION, DAEMON_DBUS_NAME, DAEMON_DBUS_OBJECT_PATH, 0, null, (obj, res) => { Bus.get_proxy.begin<Daemon> (BusType.SESSION, DAEMON_DBUS_NAME, DAEMON_DBUS_OBJECT_PATH, 0, null, (obj, res) => {
try { try {
@ -165,7 +165,7 @@ namespace Gala {
} }
} }
bool show_stage () { private bool show_stage () {
unowned Meta.Display display = get_display (); unowned Meta.Display display = get_display ();
screen_shield = new ScreenShield (this); screen_shield = new ScreenShield (this);
@ -377,7 +377,7 @@ namespace Gala {
} catch (Error e) { warning (e.message); } } catch (Error e) { warning (e.message); }
} }
void on_show_background_menu (int x, int y) { private void on_show_background_menu (int x, int y) {
if (daemon_proxy == null) { if (daemon_proxy == null) {
return; return;
} }
@ -391,12 +391,12 @@ namespace Gala {
}); });
} }
void on_monitors_changed () { private void on_monitors_changed () {
screen_shield.expand_to_screen_size (); screen_shield.expand_to_screen_size ();
} }
[CCode (instance_pos = -1)] [CCode (instance_pos = -1)]
void handle_cycle_workspaces (Meta.Display display, Meta.Window? window, Clutter.KeyEvent event, private void handle_cycle_workspaces (Meta.Display display, Meta.Window? window, Clutter.KeyEvent event,
Meta.KeyBinding binding) { Meta.KeyBinding binding) {
var direction = (binding.get_name () == "cycle-workspaces-next" ? 1 : -1); var direction = (binding.get_name () == "cycle-workspaces-next" ? 1 : -1);
unowned Meta.WorkspaceManager manager = display.get_workspace_manager (); unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
@ -413,7 +413,7 @@ namespace Gala {
} }
[CCode (instance_pos = -1)] [CCode (instance_pos = -1)]
void handle_move_to_workspace (Meta.Display display, Meta.Window? window, private void handle_move_to_workspace (Meta.Display display, Meta.Window? window,
Clutter.KeyEvent event, Meta.KeyBinding binding) { Clutter.KeyEvent event, Meta.KeyBinding binding) {
if (window == null) if (window == null)
return; return;
@ -423,7 +423,7 @@ namespace Gala {
} }
[CCode (instance_pos = -1)] [CCode (instance_pos = -1)]
void handle_move_to_workspace_end (Meta.Display display, Meta.Window? window, private void handle_move_to_workspace_end (Meta.Display display, Meta.Window? window,
Clutter.KeyEvent event, Meta.KeyBinding binding) { Clutter.KeyEvent event, Meta.KeyBinding binding) {
if (window == null) if (window == null)
return; return;
@ -436,14 +436,14 @@ namespace Gala {
} }
[CCode (instance_pos = -1)] [CCode (instance_pos = -1)]
void handle_switch_to_workspace (Meta.Display display, Meta.Window? window, private void handle_switch_to_workspace (Meta.Display display, Meta.Window? window,
Clutter.KeyEvent event, Meta.KeyBinding binding) { Clutter.KeyEvent event, Meta.KeyBinding binding) {
var direction = (binding.get_name () == "switch-to-workspace-left" ? Meta.MotionDirection.LEFT : Meta.MotionDirection.RIGHT); var direction = (binding.get_name () == "switch-to-workspace-left" ? Meta.MotionDirection.LEFT : Meta.MotionDirection.RIGHT);
switch_to_next_workspace (direction); switch_to_next_workspace (direction);
} }
[CCode (instance_pos = -1)] [CCode (instance_pos = -1)]
void handle_switch_to_workspace_end (Meta.Display display, Meta.Window? window, private void handle_switch_to_workspace_end (Meta.Display display, Meta.Window? window,
Clutter.KeyEvent event, Meta.KeyBinding binding) { Clutter.KeyEvent event, Meta.KeyBinding binding) {
unowned Meta.WorkspaceManager manager = display.get_workspace_manager (); unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
var index = (binding.get_name () == "switch-to-workspace-first" ? 0 : manager.n_workspaces - 1); var index = (binding.get_name () == "switch-to-workspace-first" ? 0 : manager.n_workspaces - 1);
@ -451,13 +451,13 @@ namespace Gala {
} }
[CCode (instance_pos = -1)] [CCode (instance_pos = -1)]
void handle_applications_menu (Meta.Display display, Meta.Window? window, private void handle_applications_menu (Meta.Display display, Meta.Window? window,
Clutter.KeyEvent event, Meta.KeyBinding binding) { Clutter.KeyEvent event, Meta.KeyBinding binding) {
launch_action ("panel-main-menu-action"); launch_action ("panel-main-menu-action");
} }
[CCode (instance_pos = -1)] [CCode (instance_pos = -1)]
void handle_screenshot (Meta.Display display, Meta.Window? window, private void handle_screenshot (Meta.Display display, Meta.Window? window,
Clutter.KeyEvent event, Meta.KeyBinding binding) { Clutter.KeyEvent event, Meta.KeyBinding binding) {
switch (binding.get_name ()) { switch (binding.get_name ()) {
case "screenshot": case "screenshot":
@ -586,7 +586,7 @@ namespace Gala {
} }
} }
void update_input_area () { private void update_input_area () {
unowned Meta.Display display = get_display (); unowned Meta.Display display = get_display ();
if (screensaver != null) { if (screensaver != null) {
@ -609,7 +609,7 @@ namespace Gala {
InternalUtils.set_input_area (display, InputArea.DEFAULT); InternalUtils.set_input_area (display, InputArea.DEFAULT);
} }
void show_bottom_stack_window (Meta.Window bottom_window) { private void show_bottom_stack_window (Meta.Window bottom_window) {
unowned Meta.Workspace workspace = bottom_window.get_workspace (); unowned Meta.Workspace workspace = bottom_window.get_workspace ();
if (Utils.get_n_windows (workspace) == 0) { if (Utils.get_n_windows (workspace) == 0) {
return; return;
@ -658,7 +658,7 @@ namespace Gala {
}); });
} }
void animate_bottom_window_scale (Meta.WindowActor actor) { private void animate_bottom_window_scale (Meta.WindowActor actor) {
const string[] PROPS = { "scale-x", "scale-y" }; const string[] PROPS = { "scale-x", "scale-y" };
foreach (string prop in PROPS) { foreach (string prop in PROPS) {
@ -1035,7 +1035,7 @@ namespace Gala {
* effects * effects
*/ */
void handle_fullscreen_window (Meta.Window window, Meta.SizeChange which_change) { private void handle_fullscreen_window (Meta.Window window, Meta.SizeChange which_change) {
// Only handle windows which are located on the primary monitor // Only handle windows which are located on the primary monitor
if (!window.is_on_primary_monitor () || !behavior_settings.get_boolean ("move-fullscreened-workspace")) if (!window.is_on_primary_monitor () || !behavior_settings.get_boolean ("move-fullscreened-workspace"))
return; return;
@ -1194,7 +1194,7 @@ namespace Gala {
} }
} }
void maximize (Meta.WindowActor actor, int ex, int ey, int ew, int eh) { private void maximize (Meta.WindowActor actor, int ex, int ey, int ew, int eh) {
var duration = AnimationDuration.SNAP; var duration = AnimationDuration.SNAP;
if (!enable_animations if (!enable_animations
@ -1578,7 +1578,7 @@ namespace Gala {
} }
} }
void unmaximize (Meta.WindowActor actor, int ex, int ey, int ew, int eh) { private void unmaximize (Meta.WindowActor actor, int ex, int ey, int ew, int eh) {
var duration = AnimationDuration.SNAP; var duration = AnimationDuration.SNAP;
if (!enable_animations if (!enable_animations
|| duration == 0) { || duration == 0) {
@ -1660,7 +1660,7 @@ namespace Gala {
} }
} }
void move_window_to_next_ws (Meta.Window window) { private void move_window_to_next_ws (Meta.Window window) {
unowned Meta.Workspace win_ws = window.get_workspace (); unowned Meta.Workspace win_ws = window.get_workspace ();
// Do nothing if the current workspace would be empty // Do nothing if the current workspace would be empty
@ -1714,7 +1714,7 @@ namespace Gala {
} }
// Cancel attached animation of an actor and reset it // Cancel attached animation of an actor and reset it
bool end_animation (ref Gee.HashSet<Meta.WindowActor> list, Meta.WindowActor actor) { private bool end_animation (ref Gee.HashSet<Meta.WindowActor> list, Meta.WindowActor actor) {
if (!list.contains (actor)) if (!list.contains (actor))
return false; return false;
@ -1748,9 +1748,9 @@ namespace Gala {
} }
/*workspace switcher*/ /*workspace switcher*/
List<Clutter.Actor>? windows; private List<Clutter.Actor>? windows;
List<Clutter.Actor>? parents; private List<Clutter.Actor>? parents;
List<Clutter.Actor>? tmp_actors; private List<Clutter.Actor>? tmp_actors;
public override void switch_workspace (int from, int to, Meta.MotionDirection direction) { public override void switch_workspace (int from, int to, Meta.MotionDirection direction) {
if (!enable_animations if (!enable_animations
@ -2028,7 +2028,7 @@ namespace Gala {
} }
} }
void end_switch_workspace () { private void end_switch_workspace () {
if (windows == null || parents == null) if (windows == null || parents == null)
return; return;
@ -2226,7 +2226,7 @@ namespace Gala {
* remove_child flags we will save the elapsed time of required transitions and * remove_child flags we will save the elapsed time of required transitions and
* then advance back to it when we're done reparenting. * then advance back to it when we're done reparenting.
*/ */
static void reparent_notification_window (Clutter.Actor actor, Clutter.Actor new_parent) { private static void reparent_notification_window (Clutter.Actor actor, Clutter.Actor new_parent) {
unowned Clutter.Transition? entry_transition = actor.get_transition (NotificationStack.TRANSITION_ENTRY_NAME); unowned Clutter.Transition? entry_transition = actor.get_transition (NotificationStack.TRANSITION_ENTRY_NAME);
unowned Clutter.Transition? position_transition = actor.get_data<Clutter.Transition?> (NotificationStack.TRANSITION_MOVE_STACK_ID); unowned Clutter.Transition? position_transition = actor.get_data<Clutter.Transition?> (NotificationStack.TRANSITION_MOVE_STACK_ID);
@ -2255,7 +2255,7 @@ namespace Gala {
} }
} }
static void clutter_actor_reparent (Clutter.Actor actor, Clutter.Actor new_parent) { private static void clutter_actor_reparent (Clutter.Actor actor, Clutter.Actor new_parent) {
if (actor == new_parent) if (actor == new_parent)
return; return;

View File

@ -25,14 +25,14 @@ namespace Gala {
return instance; return instance;
} }
static WorkspaceManager? instance = null; private static WorkspaceManager? instance = null;
public WindowManager wm { get; construct; } public WindowManager wm { get; construct; }
Gee.LinkedList<Meta.Workspace> workspaces_marked_removed; private Gee.LinkedList<Meta.Workspace> workspaces_marked_removed;
int remove_freeze_count = 0; private int remove_freeze_count = 0;
WorkspaceManager (WindowManager wm) { private WorkspaceManager (WindowManager wm) {
Object (wm: wm); Object (wm: wm);
} }
@ -76,7 +76,7 @@ namespace Gala {
display.window_left_monitor.disconnect (window_left_monitor); display.window_left_monitor.disconnect (window_left_monitor);
} }
void workspace_added (Meta.WorkspaceManager manager, int index) { private void workspace_added (Meta.WorkspaceManager manager, int index) {
var workspace = manager.get_workspace_by_index (index); var workspace = manager.get_workspace_by_index (index);
if (workspace == null) if (workspace == null)
return; return;
@ -85,7 +85,7 @@ namespace Gala {
workspace.window_removed.connect (window_removed); workspace.window_removed.connect (window_removed);
} }
void workspace_removed (Meta.WorkspaceManager manager, int index) { private void workspace_removed (Meta.WorkspaceManager manager, int index) {
List<Meta.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));
@ -100,7 +100,7 @@ namespace Gala {
} }
} }
void workspace_switched (Meta.WorkspaceManager manager, int from, int to, Meta.MotionDirection direction) { private void workspace_switched (Meta.WorkspaceManager manager, int from, int to, Meta.MotionDirection direction) {
if (!Meta.Prefs.get_dynamic_workspaces ()) if (!Meta.Prefs.get_dynamic_workspaces ())
return; return;
@ -117,7 +117,7 @@ namespace Gala {
} }
} }
void window_added (Meta.Workspace? workspace, Meta.Window window) { private void window_added (Meta.Workspace? workspace, Meta.Window window) {
if (workspace == null || !Meta.Prefs.get_dynamic_workspaces () if (workspace == null || !Meta.Prefs.get_dynamic_workspaces ()
|| window.on_all_workspaces) || window.on_all_workspaces)
return; return;
@ -132,7 +132,7 @@ namespace Gala {
append_workspace (); append_workspace ();
} }
void window_removed (Meta.Workspace? workspace, Meta.Window window) { private void window_removed (Meta.Workspace? workspace, Meta.Window window) {
if (workspace == null || !Meta.Prefs.get_dynamic_workspaces () || window.on_all_workspaces) if (workspace == null || !Meta.Prefs.get_dynamic_workspaces () || window.on_all_workspaces)
return; return;
@ -160,19 +160,19 @@ namespace Gala {
} }
} }
void window_entered_monitor (Meta.Display display, int monitor, Meta.Window window) { private 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, Meta.Window window) { private 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);
} }
void prefs_listener (Meta.Preference pref) { private 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 == Meta.Preference.DYNAMIC_WORKSPACES && Meta.Prefs.get_dynamic_workspaces ()) { if (pref == Meta.Preference.DYNAMIC_WORKSPACES && Meta.Prefs.get_dynamic_workspaces ()) {
@ -182,7 +182,7 @@ namespace Gala {
} }
} }
void append_workspace () { private void append_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 ();
@ -194,7 +194,7 @@ namespace Gala {
* *
* @param workspace The workspace to remove * @param workspace The workspace to remove
*/ */
void remove_workspace (Meta.Workspace workspace) { private 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 ();

View File

@ -6,17 +6,17 @@
*/ */
public class Gala.Zoom : Object { public class Gala.Zoom : Object {
const float MIN_ZOOM = 1.0f; private const float MIN_ZOOM = 1.0f;
const float MAX_ZOOM = 10.0f; private const float MAX_ZOOM = 10.0f;
const float SHORTCUT_DELTA = 0.5f; private const float SHORTCUT_DELTA = 0.5f;
const int ANIMATION_DURATION = 300; private const int ANIMATION_DURATION = 300;
const uint MOUSE_POLL_TIME = 50; private const uint MOUSE_POLL_TIME = 50;
public WindowManager wm { get; construct; } public WindowManager wm { get; construct; }
uint mouse_poll_timer = 0; private uint mouse_poll_timer = 0;
float current_zoom = MIN_ZOOM; private float current_zoom = MIN_ZOOM;
ulong wins_handler_id = 0UL; private ulong wins_handler_id = 0UL;
private GestureTracker gesture_tracker; private GestureTracker gesture_tracker;
@ -50,13 +50,13 @@ public class Gala.Zoom : Object {
} }
[CCode (instance_pos = -1)] [CCode (instance_pos = -1)]
void zoom_in (Meta.Display display, Meta.Window? window, private void zoom_in (Meta.Display display, Meta.Window? window,
Clutter.KeyEvent event, Meta.KeyBinding binding) { Clutter.KeyEvent event, Meta.KeyBinding binding) {
zoom (SHORTCUT_DELTA, true, wm.enable_animations); zoom (SHORTCUT_DELTA, true, wm.enable_animations);
} }
[CCode (instance_pos = -1)] [CCode (instance_pos = -1)]
void zoom_out (Meta.Display display, Meta.Window? window, private void zoom_out (Meta.Display display, Meta.Window? window,
Clutter.KeyEvent event, Meta.KeyBinding binding) { Clutter.KeyEvent event, Meta.KeyBinding binding) {
zoom (-SHORTCUT_DELTA, true, wm.enable_animations); zoom (-SHORTCUT_DELTA, true, wm.enable_animations);
} }
@ -99,7 +99,7 @@ public class Gala.Zoom : Object {
gesture_tracker.connect_handlers (null, (owned) on_animation_update, null); gesture_tracker.connect_handlers (null, (owned) on_animation_update, null);
} }
void zoom (float delta, bool play_sound, bool animate) { private void zoom (float delta, bool play_sound, bool animate) {
// Nothing to do if zooming out of our bounds is requested // Nothing to do if zooming out of our bounds is requested
if ((current_zoom <= MIN_ZOOM && delta < 0) || (current_zoom >= MAX_ZOOM && delta >= 0)) { if ((current_zoom <= MIN_ZOOM && delta < 0) || (current_zoom >= MAX_ZOOM && delta >= 0)) {
if (play_sound) { if (play_sound) {