Skip to content

Commit b6da608

Browse files
committed
Merge branch 'main' into lenemter/bg-blur-2
2 parents c6071ae + 89ef729 commit b6da608

File tree

307 files changed

+7253
-11657
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

307 files changed

+7253
-11657
lines changed

daemon/DBus.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
public enum Gala.ActionType {
77
NONE = 0,
8-
SHOW_WORKSPACE_VIEW,
8+
SHOW_MULTITASKING_VIEW,
99
MAXIMIZE_CURRENT,
1010
HIDE_CURRENT,
1111
OPEN_LAUNCHER,

lib/CloseButton.vala

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,7 @@ public class Gala.CloseButton : Clutter.Actor {
7979
pixbuf_actor.background_color = { 255, 0, 0, 255 };
8080
}
8181

82-
#if HAS_MUTTER45
8382
public override bool button_press_event (Clutter.Event e) {
84-
#else
85-
public override bool button_press_event (Clutter.ButtonEvent e) {
86-
#endif
8783
var estimated_duration = (uint) (ANIMATION_DURATION * (scale_x - 0.8) / 0.2);
8884

8985
pixbuf_actor.save_easing_state ();
@@ -97,11 +93,7 @@ public class Gala.CloseButton : Clutter.Actor {
9793
return Clutter.EVENT_STOP;
9894
}
9995

100-
#if HAS_MUTTER45
10196
public override bool button_release_event (Clutter.Event e) {
102-
#else
103-
public override bool button_release_event (Clutter.ButtonEvent e) {
104-
#endif
10597
reset_scale ();
10698

10799
if (is_pressed) {
@@ -112,11 +104,7 @@ public class Gala.CloseButton : Clutter.Actor {
112104
return Clutter.EVENT_STOP;
113105
}
114106

115-
#if HAS_MUTTER45
116107
public override bool leave_event (Clutter.Event event) {
117-
#else
118-
public override bool leave_event (Clutter.CrossingEvent event) {
119-
#endif
120108
reset_scale ();
121109
is_pressed = false;
122110

lib/Constants.vala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ namespace Gala {
3535
NUDGE = 360,
3636
}
3737

38+
public enum GestureAction {
39+
NONE,
40+
SWITCH_WORKSPACE,
41+
SWITCH_WINDOWS,
42+
MULTITASKING_VIEW,
43+
DOCK,
44+
ZOOM,
45+
N_ACTIONS
46+
}
47+
3848
/**
3949
* Used as a key for Object.set_data<bool> on Meta.Windows that should be
4050
* treated as notifications. Has to be set before the window is mapped.

lib/Plugin.vala

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ namespace Gala {
1919
public enum PluginFunction {
2020
ADDITION,
2121
WINDOW_SWITCHER,
22-
WORKSPACE_VIEW,
2322
WINDOW_OVERVIEW
2423
}
2524

@@ -85,34 +84,20 @@ namespace Gala {
8584
* It is calculated by the system whenever update_region is called.
8685
* You can influce it with the custom_region and the track_actor function.
8786
*/
88-
#if HAS_MUTTER45
8987
private Mtk.Rectangle[] region;
9088
public unowned Mtk.Rectangle[] get_region () {
91-
#else
92-
private Meta.Rectangle[] region;
93-
public unowned Meta.Rectangle[] get_region () {
94-
#endif
9589
return region;
9690
}
9791
/**
9892
* This list will be merged with the region property. See region for
9993
* more details. Changing this property will cause update_region to be
10094
* called. Default to null.
10195
*/
102-
#if HAS_MUTTER45
10396
private Mtk.Rectangle[]? _custom_region = null;
10497
protected unowned Mtk.Rectangle[]? get_custom_region () {
105-
#else
106-
private Meta.Rectangle[]? _custom_region = null;
107-
protected unowned Meta.Rectangle[]? get_custom_region () {
108-
#endif
10998
return _custom_region;
11099
}
111-
#if HAS_MUTTER45
112100
protected void set_custom_region (Mtk.Rectangle[]? custom_region) {
113-
#else
114-
protected void set_custom_region (Meta.Rectangle[]? custom_region) {
115-
#endif
116101
_custom_region = custom_region;
117102
update_region ();
118103
}
@@ -190,11 +175,7 @@ namespace Gala {
190175
var has_custom = custom_region != null;
191176
var len = tracked_actors.length () + (has_custom ? custom_region.length : 0);
192177

193-
#if HAS_MUTTER45
194178
var regions = new Mtk.Rectangle[len];
195-
#else
196-
var regions = new Meta.Rectangle[len];
197-
#endif
198179
var i = 0;
199180

200181
if (has_custom) {

lib/Utils.vala

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,7 @@ namespace Gala {
305305
*/
306306
public static Clutter.Actor? get_window_actor_snapshot (
307307
Meta.WindowActor actor,
308-
#if HAS_MUTTER45
309308
Mtk.Rectangle inner_rect
310-
#else
311-
Meta.Rectangle inner_rect
312-
#endif
313309
) {
314310
Clutter.Content content;
315311

@@ -344,11 +340,7 @@ namespace Gala {
344340
*/
345341
[Version (deprecated = true, deprecated_since = "7.0.3", replacement = "Meta.Display.get_monitor_scale")]
346342
public static int get_ui_scaling_factor () {
347-
#if HAS_MUTTER44
348343
return 1;
349-
#else
350-
return Meta.Backend.get_backend ().get_settings ().get_ui_scaling_factor ();
351-
#endif
352344
}
353345

354346
/**

lib/WindowManager.vala

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,16 @@
1616
//
1717

1818
namespace Gala {
19+
namespace ActionKeys {
20+
public const string INTERACTIVE_SCREENSHOT_ACTION = "interactive-screenshot-action";
21+
public const string OVERLAY_ACTION = "overlay-action";
22+
public const string PANEL_MAIN_MENU_ACTION = "panel-main-menu-action";
23+
public const string TOGGLE_RECORDING_ACTION = "toggle-recording-action";
24+
}
25+
1926
public enum ActionType {
2027
NONE = 0,
21-
SHOW_WORKSPACE_VIEW,
28+
SHOW_MULTITASKING_VIEW,
2229
MAXIMIZE_CURRENT,
2330
HIDE_CURRENT,
2431
OPEN_LAUNCHER,
@@ -63,6 +70,9 @@ namespace Gala {
6370
*/
6471
public class ModalProxy : Object {
6572
public Clutter.Grab? grab { get; set; }
73+
74+
private GestureAction[] allowed_actions;
75+
6676
/**
6777
* A function which is called whenever a keybinding is pressed. If you supply a custom
6878
* one you can filter out those that'd you like to be passed through and block all others.
@@ -87,6 +97,14 @@ namespace Gala {
8797
public void allow_all_keybindings () {
8898
_keybinding_filter = null;
8999
}
100+
101+
public void allow_actions (GestureAction[] actions) {
102+
allowed_actions = actions;
103+
}
104+
105+
public bool filter_action (GestureAction action) {
106+
return !(action in allowed_actions);
107+
}
90108
}
91109

92110
public interface WindowManager : Meta.Plugin {
@@ -118,11 +136,6 @@ namespace Gala {
118136
*/
119137
public abstract Meta.BackgroundGroup background_group { get; protected set; }
120138

121-
/**
122-
* View that allows to see and manage all your windows and desktops.
123-
*/
124-
public abstract Gala.ActivatableComponent workspace_view { get; protected set; }
125-
126139
/**
127140
* Enters the modal mode, which means that all events are directed to the stage instead
128141
* of the windows. This is the only way to receive keyboard events besides shortcut listeners.
@@ -176,5 +189,18 @@ namespace Gala {
176189
* @param direction The direction in which to switch
177190
*/
178191
public abstract void switch_to_next_workspace (Meta.MotionDirection direction, uint32 timestamp);
192+
193+
/**
194+
* Gets action command from gsettings and executes it.
195+
*
196+
* @param action_key The gsettings key of action. Available keys are stored in ActionKeys
197+
*/
198+
public abstract void launch_action (string action_key);
199+
200+
/**
201+
* Checks whether the action should currently be prohibited.
202+
* @return true if the action should be prohibited, false otherwise
203+
*/
204+
public abstract bool filter_action (GestureAction action);
179205
}
180206
}

meson.build

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -103,39 +103,6 @@ libmutter_dep = []
103103

104104
vala_flags = []
105105

106-
mutter42_dep = dependency('libmutter-10', version: ['>= 42', '< 43'], required: false)
107-
if mutter42_dep.found()
108-
libmutter_dep = dependency('libmutter-10', version: '>= 42')
109-
mutter_dep = [
110-
libmutter_dep,
111-
dependency('mutter-cogl-10'), dependency('mutter-cogl-pango-10'),
112-
dependency('mutter-clutter-10')
113-
]
114-
vala_flags = []
115-
endif
116-
117-
mutter43_dep = dependency('libmutter-11', version: ['>= 43', '< 44'], required: false)
118-
if mutter43_dep.found()
119-
libmutter_dep = dependency('libmutter-11', version: '>= 43')
120-
mutter_dep = [
121-
libmutter_dep,
122-
dependency('mutter-cogl-11'), dependency('mutter-cogl-pango-11'),
123-
dependency('mutter-clutter-11')
124-
]
125-
vala_flags = ['--define', 'HAS_MUTTER43']
126-
endif
127-
128-
mutter44_dep = dependency('libmutter-12', version: ['>= 44', '< 45'], required: false)
129-
if mutter44_dep.found()
130-
libmutter_dep = dependency('libmutter-12', version: '>= 44')
131-
mutter_dep = [
132-
libmutter_dep,
133-
dependency('mutter-cogl-12'), dependency('mutter-cogl-pango-12'),
134-
dependency('mutter-clutter-12')
135-
]
136-
vala_flags = ['--define', 'HAS_MUTTER43', '--define', 'HAS_MUTTER44']
137-
endif
138-
139106
mutter45_dep = dependency('libmutter-13', version: ['>= 45', '< 46'], required: false)
140107
if mutter45_dep.found()
141108
libmutter_dep = dependency('libmutter-13', version: '>= 45')

plugins/pip/Main.vala

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@ public class Gala.Plugins.PIP.Plugin : Gala.Plugin {
2222
private Gala.WindowManager? wm = null;
2323
private SelectionArea? selection_area;
2424

25-
#if HAS_MUTTER45
2625
private static inline bool meta_rectangle_contains (Mtk.Rectangle rect, int x, int y) {
27-
#else
28-
private static inline bool meta_rectangle_contains (Meta.Rectangle rect, int x, int y) {
29-
#endif
3026
return x >= rect.x && x < rect.x + rect.width
3127
&& y >= rect.y && y < rect.y + rect.height;
3228
}

plugins/pip/PopupWindow.vala

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
162162
}
163163
}
164164

165-
#if HAS_MUTTER45
166165
public override bool enter_event (Clutter.Event event) {
167-
#else
168-
public override bool enter_event (Clutter.CrossingEvent event) {
169-
#endif
170166
var duration = Utils.get_animation_duration (300);
171167

172168
close_button.save_easing_state ();
@@ -182,11 +178,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
182178
return Clutter.EVENT_PROPAGATE;
183179
}
184180

185-
#if HAS_MUTTER45
186181
public override bool leave_event (Clutter.Event event) {
187-
#else
188-
public override bool leave_event (Clutter.CrossingEvent event) {
189-
#endif
190182
var duration = Utils.get_animation_duration (300);
191183

192184
close_button.save_easing_state ();
@@ -220,11 +212,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
220212
display.set_cursor (Meta.Cursor.DEFAULT);
221213
}
222214

223-
#if HAS_MUTTER45
224215
private bool on_resize_button_press (Clutter.Event event) {
225-
#else
226-
private bool on_resize_button_press (Clutter.ButtonEvent event) {
227-
#endif
228216
if (resizing || event.get_button () != Clutter.Button.PRIMARY) {
229217
return Clutter.EVENT_STOP;
230218
}

plugins/pip/SelectionArea.vala

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,7 @@ public class Gala.Plugins.PIP.SelectionArea : CanvasActor {
4444
height = screen_height;
4545
}
4646

47-
#if HAS_MUTTER45
4847
public override bool key_press_event (Clutter.Event e) {
49-
#else
50-
public override bool key_press_event (Clutter.KeyEvent e) {
51-
#endif
5248
if (e.get_key_symbol () == Clutter.Key.Escape) {
5349
close ();
5450
closed ();
@@ -58,11 +54,7 @@ public class Gala.Plugins.PIP.SelectionArea : CanvasActor {
5854
return false;
5955
}
6056

61-
#if HAS_MUTTER45
6257
public override bool button_press_event (Clutter.Event e) {
63-
#else
64-
public override bool button_press_event (Clutter.ButtonEvent e) {
65-
#endif
6658
if (dragging || e.get_button () != Clutter.Button.PRIMARY) {
6759
return true;
6860
}
@@ -76,11 +68,7 @@ public class Gala.Plugins.PIP.SelectionArea : CanvasActor {
7668
return true;
7769
}
7870

79-
#if HAS_MUTTER45
8071
public override bool button_release_event (Clutter.Event e) {
81-
#else
82-
public override bool button_release_event (Clutter.ButtonEvent e) {
83-
#endif
8472
if (e.get_button () != Clutter.Button.PRIMARY) {
8573
return true;
8674
}
@@ -109,11 +97,7 @@ public class Gala.Plugins.PIP.SelectionArea : CanvasActor {
10997
return true;
11098
}
11199

112-
#if HAS_MUTTER45
113100
public override bool motion_event (Clutter.Event e) {
114-
#else
115-
public override bool motion_event (Clutter.MotionEvent e) {
116-
#endif
117101
if (!clicked) {
118102
return true;
119103
}

0 commit comments

Comments
 (0)