Skip to content

Commit 92fd023

Browse files
authored
Merge branch 'main' into ryonakano/stylemanager-add-latte
2 parents 9b7df7e + 76b5800 commit 92fd023

35 files changed

+436
-458
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)

daemon/MonitorLabel.vala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
var provider = new Gtk.CssProvider ();
3232
try {
3333
provider.load_from_string (COLORED_STYLE_CSS.printf (title, info.background_color, info.text_color));
34-
get_style_context ().add_class (title);
35-
get_style_context ().add_class ("monitor-label");
34+
add_css_class (title);
35+
add_css_class ("monitor-label");
3636

3737
Gtk.StyleContext.add_provider_for_display (
3838
Gdk.Display.get_default (),

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: 1 addition & 7 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;
@@ -70,7 +64,7 @@ public class Gala.ActorTarget : Clutter.Actor, GestureTarget {
7064
public virtual void commit_progress (GestureAction action, double to) {}
7165
public virtual void end_progress (GestureAction action) {}
7266

73-
public override void propagate (UpdateType update_type, GestureAction action, double progress) {
67+
public void propagate (UpdateType update_type, GestureAction action, double progress) {
7468
if (update_type == COMMIT) {
7569
current_commit[action] = progress;
7670
} else {

lib/Gestures/GestureSettings.vala

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,6 @@ private class Gala.GestureSettings : Object {
3434
: touchpad_settings.get_boolean ("natural-scroll");
3535
}
3636

37-
public Meta.MotionDirection? get_direction (Gesture gesture) {
38-
switch (gesture.direction) {
39-
case GestureDirection.UP:
40-
return Meta.MotionDirection.UP;
41-
case GestureDirection.DOWN:
42-
return Meta.MotionDirection.DOWN;
43-
case GestureDirection.LEFT:
44-
return Meta.MotionDirection.LEFT;
45-
case GestureDirection.RIGHT:
46-
return Meta.MotionDirection.RIGHT;
47-
default:
48-
return null;
49-
}
50-
}
51-
5237
public Meta.MotionDirection? get_natural_scroll_direction (Gesture gesture) {
5338
bool natural_scroll = is_natural_scroll_enabled (gesture.performed_on_device_type);
5439

lib/Gestures/GestureTarget.vala

Lines changed: 1 addition & 7 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-
22-
public virtual void propagate (UpdateType update_type, GestureAction action, double progress) { }
16+
public abstract void propagate (UpdateType update_type, GestureAction action, double progress);
2317
}

lib/Gestures/PropertyTarget.vala

Lines changed: 18 additions & 11 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

26-
public override void propagate (UpdateType update_type, GestureAction action, double progress) {
27-
if (update_type != UPDATE || action != this.action) {
33+
public void propagate (UpdateType update_type, GestureAction action, double progress) {
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
}

0 commit comments

Comments
 (0)