Skip to content

Commit 1f10e9e

Browse files
authored
Merge branch 'main' into lenemter/add-hide-delay
2 parents 95a829a + 60fd6ca commit 1f10e9e

Some content is hidden

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

42 files changed

+1498
-788
lines changed

.github/workflows/main.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,24 @@ jobs:
4040
ninja -C build
4141
ninja -C build install
4242
43+
fedora:
44+
runs-on: ubuntu-latest
45+
46+
container:
47+
image: fedora:latest
48+
49+
steps:
50+
- uses: actions/checkout@v4
51+
- name: Install Dependencies
52+
run: |
53+
dnf install -y desktop-file-utils gettext gsettings-desktop-schemas-devel atk-devel libcanberra-devel clutter-devel libgee-devel glib2-devel gnome-desktop3-devel granite-devel granite-7-devel gtk3-devel gtk4-devel libhandy-devel mutter-devel xml2 sqlite-devel meson valac valadoc
54+
- name: Build
55+
env:
56+
DESTDIR: out
57+
run: |
58+
meson build
59+
ninja -C build install
60+
4361
lint:
4462

4563
runs-on: ubuntu-latest

lib/AnimationsSettings.vala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,11 @@ namespace AnimationsSettings {
2222

2323
return enable_animations;
2424
}
25+
26+
/**
27+
* Utility that returns the given duration or 0 if animations are disabled.
28+
*/
29+
public uint get_animation_duration (uint duration) {
30+
return get_enable_animations () ? duration : 0;
31+
}
2532
}

lib/App.vala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ public class Gala.App : GLib.Object {
158158
return windows.data;
159159
}
160160

161-
public GLib.SList<Posix.pid_t?> get_pids () {
162-
var results = new GLib.SList<Posix.pid_t?> ();
161+
public GLib.SList<pid_t?> get_pids () {
162+
var results = new GLib.SList<pid_t?> ();
163163
foreach (unowned var window in windows) {
164164
var pid = window.get_pid ();
165165
if (pid < 1) {

meson.build

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,17 @@ if mutter46_dep.found()
158158
vala_flags = ['--define', 'HAS_MUTTER43', '--define', 'HAS_MUTTER44', '--define', 'HAS_MUTTER45', '--define', 'HAS_MUTTER46']
159159
endif
160160

161+
mutter47_dep = dependency('libmutter-15', version: ['>= 47', '< 48'], required: false)
162+
if mutter47_dep.found()
163+
libmutter_dep = dependency('libmutter-15', version: '>= 47')
164+
mutter_dep = [
165+
libmutter_dep,
166+
dependency('mutter-mtk-15'), dependency('mutter-cogl-15'),
167+
dependency('mutter-cogl-pango-15'), dependency('mutter-clutter-15')
168+
]
169+
vala_flags = ['--define', 'HAS_MUTTER43', '--define', 'HAS_MUTTER44', '--define', 'HAS_MUTTER45', '--define', 'HAS_MUTTER46', '--define', 'HAS_MUTTER47']
170+
endif
171+
161172
if mutter_dep.length() == 0
162173
error ('No supported mutter library found!')
163174
endif

plugins/pip/PopupWindow.vala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,15 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
142142
opacity = 0;
143143

144144
save_easing_state ();
145-
set_easing_duration (AnimationsSettings.get_enable_animations () ? 200 : 0);
145+
set_easing_duration (AnimationsSettings.get_animation_duration (200));
146146
opacity = 255;
147147
restore_easing_state ();
148148
}
149149

150150
public override void hide () {
151151
opacity = 255;
152152

153-
var duration = AnimationsSettings.get_enable_animations () ? 200 : 0;
153+
var duration = AnimationsSettings.get_animation_duration (200);
154154
save_easing_state ();
155155
set_easing_duration (duration);
156156
opacity = 0;
@@ -172,7 +172,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
172172
#else
173173
public override bool enter_event (Clutter.CrossingEvent event) {
174174
#endif
175-
var duration = AnimationsSettings.get_enable_animations () ? 300 : 0;
175+
var duration = AnimationsSettings.get_animation_duration (300);
176176

177177
close_button.save_easing_state ();
178178
close_button.set_easing_duration (duration);
@@ -192,7 +192,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
192192
#else
193193
public override bool leave_event (Clutter.CrossingEvent event) {
194194
#endif
195-
var duration = AnimationsSettings.get_enable_animations () ? 300 : 0;
195+
var duration = AnimationsSettings.get_animation_duration (300);
196196

197197
close_button.save_easing_state ();
198198
close_button.set_easing_duration (duration);
@@ -314,7 +314,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
314314
}
315315

316316
private void on_close_click_clicked () {
317-
var duration = AnimationsSettings.get_enable_animations () ? FADE_OUT_TIMEOUT : 0;
317+
var duration = AnimationsSettings.get_animation_duration (FADE_OUT_TIMEOUT);
318318

319319
save_easing_state ();
320320
set_easing_duration (duration);
@@ -448,7 +448,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
448448
var screen_limit_start_y = SCREEN_MARGIN + monitor_y;
449449
var screen_limit_end_y = monitor_height + monitor_y - SCREEN_MARGIN - height;
450450

451-
var duration = AnimationsSettings.get_enable_animations () ? 300 : 0;
451+
var duration = AnimationsSettings.get_animation_duration (300);
452452

453453
save_easing_state ();
454454
set_easing_mode (Clutter.AnimationMode.EASE_OUT_BACK);
@@ -461,7 +461,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
461461
private bool place_window_off_screen () {
462462
off_screen = false;
463463

464-
var duration = AnimationsSettings.get_enable_animations () ? 300 : 0;
464+
var duration = AnimationsSettings.get_animation_duration (300);
465465

466466
save_easing_state ();
467467
set_easing_mode (Clutter.AnimationMode.EASE_OUT_BACK);

po/zh_TW.po

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: \n"
99
"Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n"
1010
"POT-Creation-Date: 2024-10-15 19:33+0000\n"
11-
"PO-Revision-Date: 2024-09-19 10:09+0000\n"
11+
"PO-Revision-Date: 2024-11-06 11:20+0000\n"
1212
"Last-Translator: Kisaragi Hiu <[email protected]>\n"
1313
"Language-Team: Chinese (Traditional) <https://l10n.elementary.io/projects/"
1414
"desktop/gala/zh_Hant/>\n"
@@ -151,11 +151,11 @@ msgstr "修正多工作業檢視中手勢可能會停止運作的問題"
151151

152152
#: data/gala.metainfo.xml.in:109
153153
msgid "Improve dynamic workspaces behaviour with multiple monitors"
154-
msgstr "改善多螢幕時的動態工作空間行為"
154+
msgstr "改善多螢幕時的動態工作區行為"
155155

156156
#: data/gala.metainfo.xml.in:131
157157
msgid "Improve handling of move-to-workspace shortcut"
158-
msgstr "改善移動到工作空間快捷鍵的處理"
158+
msgstr "改善「移動到工作區」快捷鍵的處理"
159159

160160
#: data/gala-multitaskingview.desktop.in:4
161161
#: data/gala-multitaskingview.desktop.in:6

src/Background/Background.vala

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,38 @@ namespace Gala {
108108
var settings = background_source.gnome_background_settings;
109109

110110
color_string = settings.get_string ("primary-color");
111+
#if HAS_MUTTER47
112+
var color = Cogl.Color.from_string (color_string);
113+
#else
111114
var color = Clutter.Color.from_string (color_string);
115+
#endif
116+
if (color == null) {
117+
#if HAS_MUTTER47
118+
color = Cogl.Color.from_string ("black");
119+
#else
120+
color = Clutter.Color.from_string ("black");
121+
#endif
122+
}
112123

113124
var shading_type = settings.get_enum ("color-shading-type");
114125

115126
if (shading_type == GDesktop.BackgroundShading.SOLID) {
116127
background.set_color (color);
117128
} else {
118129
color_string = settings.get_string ("secondary-color");
130+
#if HAS_MUTTER47
131+
var second_color = Cogl.Color.from_string (color_string);
132+
#else
119133
var second_color = Clutter.Color.from_string (color_string);
134+
#endif
135+
if (second_color == null) {
136+
#if HAS_MUTTER47
137+
second_color = Cogl.Color.from_string ("black");
138+
#else
139+
second_color = Clutter.Color.from_string ("black");
140+
#endif
141+
}
142+
120143
background.set_gradient ((GDesktop.BackgroundShading) shading_type, color, second_color);
121144
}
122145
}

src/Background/BackgroundContainer.vala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ namespace Gala {
4949
}
5050

5151
public void set_black_background (bool black) {
52+
#if HAS_MUTTER47
53+
set_background_color (black ? Cogl.Color.from_string ("Black") : null);
54+
#else
5255
set_background_color (black ? Clutter.Color.from_string ("Black") : null);
56+
#endif
5357
}
5458

5559
private void update () {

src/InternalUtils.vala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,12 @@ namespace Gala {
7171
}
7272

7373
unowned Meta.X11Display x11display = display.get_x11_display ();
74+
#if HAS_MUTTER47
75+
x11display.set_stage_input_region (rects);
76+
#else
7477
var xregion = X.Fixes.create_region (x11display.get_xdisplay (), rects);
7578
x11display.set_stage_input_region (xregion);
79+
#endif
7680
}
7781

7882
/**

src/ScreenshotManager.vala

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ namespace Gala {
6565
var flash_actor = new Clutter.Actor ();
6666
flash_actor.set_size (width, height);
6767
flash_actor.set_position (x, y);
68-
#if HAS_MUTTER46
68+
#if HAS_MUTTER47
69+
flash_actor.set_background_color (Cogl.Color.from_string ("white"));
70+
#elif HAS_MUTTER46
6971
flash_actor.set_background_color (Clutter.Color.from_pixel (0xffffffffu));
7072
#else
7173
flash_actor.set_background_color (Clutter.Color.get_static (Clutter.StaticColor.WHITE));
@@ -151,8 +153,12 @@ namespace Gala {
151153
window_actor.get_position (out actor_x, out actor_y);
152154

153155
var rect = window.get_frame_rect ();
156+
#if HAS_MUTTER45
157+
if (!include_frame) {
158+
#if else
154159
if ((include_frame && window.is_client_decorated ()) ||
155160
(!include_frame && !window.is_client_decorated ())) {
161+
#endif
156162
rect = window.frame_rect_to_client_rect (rect);
157163
}
158164

0 commit comments

Comments
 (0)