Skip to content

Commit 74bf859

Browse files
authored
Merge branch 'main' into lenemter/hide-pip-in-mtv
2 parents ca5ad87 + 3e606b1 commit 74bf859

Some content is hidden

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

46 files changed

+1120
-123
lines changed

.github/workflows/gettext.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
apt-get install git -y
1818
1919
- name: Clone repository
20-
uses: actions/checkout@v4
20+
uses: actions/checkout@v5
2121
with:
2222
token: ${{ secrets.GIT_USER_TOKEN }}
2323

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
image: ghcr.io/elementary/docker:${{ matrix.version }}
2828

2929
steps:
30-
- uses: actions/checkout@v4
30+
- uses: actions/checkout@v5
3131
- name: Install Dependencies
3232
run: |
3333
apt update
@@ -47,7 +47,7 @@ jobs:
4747
image: fedora:latest
4848

4949
steps:
50-
- uses: actions/checkout@v4
50+
- uses: actions/checkout@v5
5151
- name: Install Dependencies
5252
run: |
5353
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 sqlite-devel meson valac valadoc
@@ -70,7 +70,7 @@ jobs:
7070
zypper addrepo https://download.opensuse.org/repositories/X11:Pantheon/15.6/X11:Pantheon.repo
7171
zypper --gpg-auto-import-keys refresh
7272
zypper --non-interactive install tar git desktop-file-utils gsettings-desktop-schemas-devel libatk-1_0-0 libcanberra-devel 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
73-
- uses: actions/checkout@v4
73+
- uses: actions/checkout@v5
7474
- name: Build
7575
env:
7676
DESTDIR: out
@@ -85,7 +85,7 @@ jobs:
8585
image: valalang/lint
8686

8787
steps:
88-
- uses: actions/checkout@v4
88+
- uses: actions/checkout@v5
8989
- name: Lint
9090
run: |
9191
io.elementary.vala-lint -d daemon

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-22.04
1111
if: github.event.pull_request.merged == true && true == contains(join(github.event.pull_request.labels.*.name), 'Release')
1212
steps:
13-
- uses: actions/checkout@v4
13+
- uses: actions/checkout@v5
1414
- uses: elementary/actions/release@main
1515
env:
1616
GIT_USER_TOKEN: "${{ secrets.GIT_USER_TOKEN }}"

daemon-gtk3/BackgroundMenu.vala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
*/
55

66
public class Gala.Daemon.BackgroundMenu : Gtk.Menu {
7-
public const string ACTION_GROUP_PREFIX = "background-menu";
8-
public const string ACTION_PREFIX = ACTION_GROUP_PREFIX + ".";
7+
private const string ACTION_GROUP_PREFIX = "background-menu";
8+
private const string ACTION_PREFIX = ACTION_GROUP_PREFIX + ".";
99

1010
construct {
1111
var change_wallpaper = new Gtk.MenuItem.with_label (_("Change Wallpaper…")) {

daemon/MonitorLabel.vala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*/
55

66
public class Gala.Daemon.MonitorLabel : Gtk.Window {
7-
private const int SPACING = 12;
87
private const string COLORED_STYLE_CSS = """
98
.%s {
109
background-color: alpha(%s, 0.8);

data/[email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Type=notify
2222
ExecStart=@bindir@/gala
2323

2424
# unset some environment variables that were set by the compositor and won't work now that the compositor is gone
25-
ExecStopPost=-/bin/sh -c 'test "$SERVICE_RESULT" != "exec-condition" && systemctl --user unset-environment GNOME_SETUP_DISPLAY WAYLAND_DISPLAY DISPLAY XAUTHORITY'
25+
ExecStopPost=-/bin/sh -c 'test "$SERVICE_RESULT" != "exec-condition" && systemctl --user unset-environment GNOME_SETUP_DISPLAY WAYLAND_DISPLAY DISPLAY XAUTHORITY && rm -f "$XDG_RUNTIME_DIR/wayland-0" "$XDG_RUNTIME_DIR/wayland-0.lock"'
2626

2727
# On wayland we cannot restart
2828
Restart=no

lib/Text.vala

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* SPDX-License-Identifier: LGPL-3.0-or-later
3+
* SPDX-FileCopyrightText: 2025 elementary, Inc. (https://elementary.io)
4+
*/
5+
6+
/*
7+
* Clutter.Text that automatically changes font-name to the system one
8+
*/
9+
public class Gala.Text : Clutter.Text {
10+
private static GLib.Settings gnome_interface_settings;
11+
12+
static construct {
13+
gnome_interface_settings = new GLib.Settings ("org.gnome.desktop.interface");
14+
}
15+
16+
construct {
17+
set_system_font_name ();
18+
gnome_interface_settings.changed["font-name"].connect (set_system_font_name);
19+
}
20+
21+
private void set_system_font_name () {
22+
var name = gnome_interface_settings.get_string ("font-name").split (" ");
23+
var last_element_index = name.length - 1;
24+
25+
if (int.try_parse (name[last_element_index])) { // if last element is a font-size
26+
name[last_element_index] = "12"; // hardcode size (can be changed later if needed)
27+
} else {
28+
name += "12";
29+
}
30+
31+
font_name = string.joinv (" ", name);
32+
}
33+
}

lib/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ gala_lib_sources = files(
1717
'Plugin.vala',
1818
'RoundedCornersEffect.vala',
1919
'ShadowEffect.vala',
20+
'Text.vala',
2021
'Utils.vala',
2122
'WindowIcon.vala',
2223
'WindowManager.vala',

meson.build

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,17 @@ if mutter48_dep.found()
141141
vala_flags = ['--define', 'HAS_MUTTER43', '--define', 'HAS_MUTTER44', '--define', 'HAS_MUTTER45', '--define', 'HAS_MUTTER46', '--define', 'HAS_MUTTER47', '--define', 'HAS_MUTTER48']
142142
endif
143143

144+
mutter49_dep = dependency('libmutter-17', version: ['>= 49', '< 50'], required: false)
145+
if mutter49_dep.found()
146+
libmutter_dep = dependency('libmutter-17', version: '>= 49')
147+
mutter_dep = [
148+
libmutter_dep,
149+
dependency('mutter-mtk-17'), dependency('mutter-cogl-17'),
150+
dependency('mutter-clutter-17')
151+
]
152+
vala_flags = ['--define', 'HAS_MUTTER43', '--define', 'HAS_MUTTER44', '--define', 'HAS_MUTTER45', '--define', 'HAS_MUTTER46', '--define', 'HAS_MUTTER47', '--define', 'HAS_MUTTER48', '--define', 'HAS_MUTTER49']
153+
endif
154+
144155
if mutter_dep.length() == 0
145156
error ('No supported mutter library found!')
146157
endif

plugins/pip/PopupWindow.vala

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ public class Gala.Plugins.PIP.PopupWindow : RootTarget, ActorTarget {
1010
private const uint FADE_OUT_TIMEOUT = 200;
1111
private const float MINIMUM_SCALE = 0.1f;
1212
private const float MAXIMUM_SCALE = 1.0f;
13-
private const int SCREEN_MARGIN = 0;
1413
private const float OFF_SCREEN_PERCENT = 0.5f;
1514
private const int OFF_SCREEN_VISIBLE_PIXELS = 80;
1615

@@ -95,11 +94,11 @@ public class Gala.Plugins.PIP.PopupWindow : RootTarget, ActorTarget {
9594

9695
float x_position, y_position;
9796
if (Clutter.get_default_text_direction () == Clutter.TextDirection.RTL) {
98-
x_position = SCREEN_MARGIN + workarea_rect.x;
97+
x_position = workarea_rect.x;
9998
} else {
100-
x_position = workarea_rect.x + workarea_rect.width - SCREEN_MARGIN - width;
99+
x_position = workarea_rect.x + workarea_rect.width - width;
101100
}
102-
y_position = workarea_rect.y + workarea_rect.height - SCREEN_MARGIN - height;
101+
y_position = workarea_rect.y + workarea_rect.height - height;
103102

104103
set_position (x_position, y_position);
105104

@@ -451,10 +450,10 @@ public class Gala.Plugins.PIP.PopupWindow : RootTarget, ActorTarget {
451450

452451
var workarea_rect = wm.get_display ().get_workspace_manager ().get_active_workspace ().get_work_area_all_monitors ();
453452

454-
var screen_limit_start_x = workarea_rect.x + SCREEN_MARGIN;
455-
var screen_limit_end_x = workarea_rect.x + workarea_rect.width - SCREEN_MARGIN - width;
456-
var screen_limit_start_y = workarea_rect.y + SCREEN_MARGIN;
457-
var screen_limit_end_y = workarea_rect.y + workarea_rect.height - SCREEN_MARGIN - height;
453+
var screen_limit_start_x = workarea_rect.x;
454+
var screen_limit_end_x = workarea_rect.x + workarea_rect.width - width;
455+
var screen_limit_start_y = workarea_rect.y;
456+
var screen_limit_end_y = workarea_rect.y + workarea_rect.height - height;
458457

459458
var duration = Utils.get_animation_duration (300);
460459

0 commit comments

Comments
 (0)