Skip to content

Commit e8ef993

Browse files
authored
Merge branch 'main' into lenemter/improve-dock-reveal-animation
2 parents 293b1d9 + 64ad306 commit e8ef993

22 files changed

+244
-130
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Install Dependencies
3232
run: |
3333
apt update
34-
apt install -y gettext gsettings-desktop-schemas-dev libatk-bridge2.0-dev libclutter-1.0-dev libgee-0.8-dev libglib2.0-dev libgnome-desktop-3-dev libgranite-dev libgtk-3-dev ${{ matrix.mutter_pkg }} libsqlite3-dev meson valac valadoc
34+
apt install -y gettext gsettings-desktop-schemas-dev libatk-bridge2.0-dev libclutter-1.0-dev libgee-0.8-dev libglib2.0-dev libgnome-desktop-4-dev libgnome-bg-4-dev libgranite-dev libgtk-3-dev ${{ matrix.mutter_pkg }} libsqlite3-dev meson valac valadoc
3535
- name: Build
3636
env:
3737
DESTDIR: out
@@ -69,7 +69,7 @@ jobs:
6969
run: |
7070
zypper addrepo https://download.opensuse.org/repositories/X11:Pantheon/15.6/X11:Pantheon.repo
7171
zypper --gpg-auto-import-keys refresh
72-
zypper --non-interactive install tar git desktop-file-utils gsettings-desktop-schemas-devel libatk-1_0-0 clutter-devel libgee-devel glib2-devel libgnome-desktop-3-devel granite6-devel granite-devel gtk3-devel gtk4-devel libhandy-devel mutter-devel sqlite3-devel meson vala valadoc gcc
72+
zypper --non-interactive install tar git desktop-file-utils gsettings-desktop-schemas-devel libatk-1_0-0 clutter-devel libgee-devel glib2-devel libgnome-desktop-4-devel granite6-devel granite-devel gtk3-devel gtk4-devel libhandy-devel mutter-devel sqlite3-devel meson vala valadoc gcc
7373
- uses: actions/checkout@v5
7474
- name: Build
7575
env:

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@ You'll need the following dependencies:
1111
* libclutter-1.0-dev (>= 1.12.0)
1212
* libgee-0.8-dev
1313
* libglib2.0-dev (>= 2.74)
14-
* libgnome-desktop-3-dev
14+
* libgnome-desktop-4-dev
15+
* libgnome-bg-4-dev
1516
* libgranite-dev (>= 5.4.0)
16-
* libgtk-3-dev (>= 3.10.0)
17+
* libgranite-7-dev
18+
* libgtk-3-dev
19+
* libgtk-4-dev
1720
* libmutter-10-dev (>= 42.0) | libmutter-dev (>= 3.18.3)
1821
* meson (>= 0.59.0)
1922
* valac (>= 0.46.0)

docs/meson.build

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ basic_command = [
1010
'--package-name','gala',
1111
'--package-version', meson.project_version(),
1212
mutter_packages_command,
13-
'--pkg', 'gtk+-3.0',
13+
'--pkg', 'gtk4',
1414
'--pkg', 'gee-0.8',
1515
'--pkg', 'gio-unix-2.0',
1616
'--pkg', 'gmodule-2.0',
@@ -41,10 +41,9 @@ all_doc_target = custom_target(
4141
'--internal',
4242
'--pkg', 'sqlite3',
4343
'--pkg', 'atk-bridge-2.0',
44-
'--pkg', 'gnome-desktop-3.0',
44+
'--pkg', 'gnome-bg-4',
45+
'--pkg', 'gnome-desktop-4',
4546
'--pkg', 'libsystemd',
46-
'--pkg', 'gnome-desktop-3.0',
47-
'--pkg', 'gmodule-2.0',
4847
'--pkg', 'wayland-server',
4948
'--pkg', 'pantheon-desktop-shell',
5049
'--vapidir=' + join_paths(meson.global_source_root(), 'protocol'),

lib/Drawing/Color.vala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ namespace Gala.Drawing {
1111
public class Color : GLib.Object {
1212
public const Gdk.RGBA LIGHT_BACKGROUND = { (250f / 255f), (250f / 255f), (250f / 255f), 1};
1313
public const Gdk.RGBA DARK_BACKGROUND = { (51 / 255f), (51 / 255f), (51 / 255f), 1};
14-
public const Gdk.RGBA LIGHT_BORDER = { 0, 0, 0, 0.2};
15-
public const Gdk.RGBA DARK_BORDER = { 0, 0, 0, 0.75};
14+
public const Gdk.RGBA LIGHT_BORDER = { 0, 0, 0, 0.2f};
15+
public const Gdk.RGBA DARK_BORDER = { 0, 0, 0, 0.75f};
1616
public const Gdk.RGBA LIGHT_HIGHLIGHT = { 255, 255, 255, 1};
17-
public const Gdk.RGBA DARK_HIGHLIGHT = { 255, 255, 255, 0.05};
17+
public const Gdk.RGBA DARK_HIGHLIGHT = { 255, 255, 255, 0.05f};
1818
public const Gdk.RGBA TOOLTIP_BACKGROUND = { 0, 0, 0, 1};
1919
public const Gdk.RGBA TOOLTIP_TEXT_COLOR = { 1, 1, 1, 1};
2020

lib/Drawing/StyleManager.vala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class Gala.Drawing.StyleManager : Object {
3131
private const string FDO_ACCOUNTS_NAME = "org.freedesktop.Accounts";
3232
private const string FDO_ACCOUNTS_PATH = "/org/freedesktop/Accounts";
3333

34-
private const double ACCENT_COLOR_ALPHA = 0.25;
34+
private const float ACCENT_COLOR_ALPHA = 0.25f;
3535
private const Gdk.RGBA DEFAULT_ACCENT_COLOR = { 0, 0, 0, ACCENT_COLOR_ALPHA };
3636

3737
private static GLib.Once<StyleManager> instance;
@@ -94,9 +94,9 @@ public class Gala.Drawing.StyleManager : Object {
9494
private void update_color (int color) {
9595
var rgb = get_color (color);
9696

97-
double r = ((rgb >> 16) & 255) / 255.0;
98-
double g = ((rgb >> 8) & 255) / 255.0;
99-
double b = (rgb & 255) / 255.0;
97+
var r = ((rgb >> 16) & 255) / 255.0f;
98+
var g = ((rgb >> 8) & 255) / 255.0f;
99+
var b = (rgb & 255) / 255.0f;
100100

101101
theme_accent_color = {
102102
r,

lib/Gestures/ActorTarget.vala

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@
1111
* If a new child (or target via {@link add_target}) is added, its progress will be synced.
1212
*/
1313
public class Gala.ActorTarget : Clutter.Actor, GestureTarget {
14-
public Clutter.Actor? actor {
15-
get {
16-
return this;
17-
}
18-
}
19-
2014
public bool animating { get { return ongoing_animations > 0; } }
2115

2216
private double[] current_progress;

lib/Gestures/GestureTarget.vala

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,5 @@ public interface Gala.GestureTarget : Object {
1313
END
1414
}
1515

16-
/**
17-
* The actor manipulated by the gesture. The associated frame clock
18-
* will be used for animation timelines.
19-
*/
20-
public abstract Clutter.Actor? actor { get; }
21-
2216
public virtual void propagate (UpdateType update_type, GestureAction action, double progress) { }
2317
}

lib/Gestures/PropertyTarget.vala

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,34 @@
77

88
public class Gala.PropertyTarget : Object, GestureTarget {
99
public GestureAction action { get; construct; }
10-
11-
//we don't want to hold a strong reference to the actor because we might've been added to it which would form a reference cycle
12-
private weak Clutter.Actor? _actor;
13-
public Clutter.Actor? actor { get { return _actor; } }
14-
10+
// Don't take a reference since we are most of the time owned by the target
11+
public weak Object? target { get; private set; }
1512
public string property { get; construct; }
1613

1714
public Clutter.Interval interval { get; construct; }
1815

19-
public PropertyTarget (GestureAction action, Clutter.Actor actor, string property, Type value_type, Value from_value, Value to_value) {
16+
public PropertyTarget (GestureAction action, Object target, string property, Type value_type, Value from_value, Value to_value) {
2017
Object (action: action, property: property, interval: new Clutter.Interval.with_values (value_type, from_value, to_value));
2118

22-
_actor = actor;
23-
_actor.destroy.connect (() => _actor = null);
19+
this.target = target;
20+
this.target.weak_ref (on_target_disposed);
21+
}
22+
23+
~PropertyTarget () {
24+
if (target != null) {
25+
target.weak_unref (on_target_disposed);
26+
}
27+
}
28+
29+
private void on_target_disposed () {
30+
target = null;
2431
}
2532

2633
public override void propagate (UpdateType update_type, GestureAction action, double progress) {
27-
if (update_type != UPDATE || action != this.action) {
34+
if (target == null || update_type != UPDATE || action != this.action) {
2835
return;
2936
}
3037

31-
actor.set_property (property, interval.compute (progress));
38+
target.set_property (property, interval.compute (progress));
3239
}
3340
}

lib/Gestures/RootTarget.vala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
*/
77

88
public interface Gala.RootTarget : Object, GestureTarget {
9+
/**
10+
* The actor manipulated by the gesture. The associated frame clock
11+
* will be used for animation timelines.
12+
*/
13+
public abstract Clutter.Actor? actor { get; }
14+
915
public void add_gesture_controller (GestureController controller) requires (controller.target == null) {
1016
controller.attached (this);
1117
weak_ref (controller.detached);

lib/Utils.vala

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ namespace Gala {
3434
private static Gtk.IconTheme icon_theme;
3535

3636
static construct {
37-
icon_theme = new Gtk.IconTheme ();
38-
icon_theme.set_custom_theme ("elementary");
37+
icon_theme = new Gtk.IconTheme () {
38+
theme_name = "elementary"
39+
};
40+
3941
icon_cache = new Gee.HashMultiMap<DesktopAppInfo, CachedIcon?> ();
4042
window_to_desktop_cache = new Gee.HashMap<Meta.Window, DesktopAppInfo> ();
4143
unknown_icon_cache = new Gee.ArrayList<CachedIcon?> ();
@@ -159,9 +161,19 @@ namespace Gala {
159161

160162
// Construct a new "application-default-icon" and store it in the cache
161163
try {
162-
var icon = icon_theme.load_icon_for_scale ("application-default-icon", icon_size, scale, 0);
163-
unknown_icon_cache.add (CachedIcon () { icon = icon, icon_size = icon_size, scale = scale });
164-
return icon;
164+
var icon_paintable = icon_theme.lookup_icon (
165+
"application-default-icon",
166+
null,
167+
icon_size,
168+
scale,
169+
Gtk.TextDirection.NONE,
170+
0
171+
);
172+
173+
var pixbuf = new Gdk.Pixbuf.from_file (icon_paintable.get_file ().get_path ());
174+
175+
unknown_icon_cache.add (CachedIcon () { icon = pixbuf, icon_size = icon_size, scale = scale });
176+
return pixbuf;
165177
} catch (Error e) {
166178
var icon = new Gdk.Pixbuf (Gdk.Colorspace.RGB, true, 8, icon_size * scale, icon_size * scale);
167179
icon.fill (0x00000000);
@@ -228,14 +240,19 @@ namespace Gala {
228240

229241
if (icon is GLib.ThemedIcon) {
230242
var icon_names = ((GLib.ThemedIcon)icon).get_names ();
231-
var icon_info = icon_theme.choose_icon_for_scale (icon_names, icon_size, scale, 0);
243+
if (icon_names.length == 0) {
244+
return null;
245+
}
246+
247+
var icon_paintable = icon_theme.lookup_icon (icon_names[0], icon_names[1:], icon_size, scale, NONE, 0);
232248

233-
if (icon_info == null) {
249+
var path = icon_paintable.get_file ()?.get_path ();
250+
if (path == null) {
234251
return null;
235252
}
236253

237254
try {
238-
var pixbuf = icon_info.load_icon ();
255+
var pixbuf = new Gdk.Pixbuf.from_file (path);
239256
icon_cache.@set (desktop, CachedIcon () { icon = pixbuf, icon_size = icon_size, scale = scale });
240257
return pixbuf;
241258
} catch (Error e) {

0 commit comments

Comments
 (0)