Skip to content

Commit 3008cb4

Browse files
authored
Merge branch 'main' into lenemter/move-some-hints-to-server
2 parents 5a3aaea + badc062 commit 3008cb4

File tree

11 files changed

+89
-93
lines changed

11 files changed

+89
-93
lines changed

po/extra/be.po

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ msgstr ""
88
"Project-Id-Version: extra\n"
99
"Report-Msgid-Bugs-To: \n"
1010
"POT-Creation-Date: 2025-10-05 17:49+0000\n"
11-
"PO-Revision-Date: 2025-07-28 13:55+0000\n"
12-
"Last-Translator: lenify <[email protected]>\n"
11+
"PO-Revision-Date: 2025-10-06 17:55+0000\n"
12+
"Last-Translator: anonymous <[email protected]>\n"
1313
"Language-Team: Belarusian <https://l10n.elementaryos.org/projects/desktop/"
1414
"notifications-extra/be/>\n"
1515
"Language: be\n"
@@ -34,7 +34,7 @@ msgstr "Сервер апавяшчэнняў для Pantheon"
3434

3535
#: data/notifications.metainfo.xml.in:30
3636
msgid "elementary, Inc."
37-
msgstr ""
37+
msgstr "elementary, Inc."
3838

3939
#: data/notifications.metainfo.xml.in:38 data/notifications.metainfo.xml.in:50
4040
#: data/notifications.metainfo.xml.in:63 data/notifications.metainfo.xml.in:78

po/extra/ie.po

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@ msgstr ""
88
"Project-Id-Version: extra\n"
99
"Report-Msgid-Bugs-To: \n"
1010
"POT-Creation-Date: 2025-10-05 17:49+0000\n"
11-
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12-
"Last-Translator: Automatically generated\n"
13-
"Language-Team: none\n"
11+
"PO-Revision-Date: 2025-10-06 17:55+0000\n"
12+
"Last-Translator: anonymous <[email protected]>\n"
13+
"Language-Team: Occidental <https://l10n.elementaryos.org/projects/desktop/"
14+
"notifications-extra/ie/>\n"
1415
"Language: ie\n"
1516
"MIME-Version: 1.0\n"
1617
"Content-Type: text/plain; charset=UTF-8\n"
1718
"Content-Transfer-Encoding: 8bit\n"
19+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
20+
"X-Generator: Weblate 5.11.4\n"
1821

1922
#: data/notifications.metainfo.xml.in:10
2023
msgid "Notifications"
@@ -30,7 +33,7 @@ msgstr ""
3033

3134
#: data/notifications.metainfo.xml.in:30
3235
msgid "elementary, Inc."
33-
msgstr ""
36+
msgstr "elementary, Inc."
3437

3538
#: data/notifications.metainfo.xml.in:38 data/notifications.metainfo.xml.in:50
3639
#: data/notifications.metainfo.xml.in:63 data/notifications.metainfo.xml.in:78

po/extra/nb.po

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ msgstr ""
88
"Project-Id-Version: extra\n"
99
"Report-Msgid-Bugs-To: \n"
1010
"POT-Creation-Date: 2025-10-05 17:49+0000\n"
11-
"PO-Revision-Date: 2023-07-08 01:10+0000\n"
12-
"Last-Translator: Allan Nordhøy <[email protected]>\n"
13-
"Language-Team: Norwegian Bokmål <https://l10n.elementary.io/projects/desktop/"
14-
"notifications-extra/nb/>\n"
11+
"PO-Revision-Date: 2025-10-06 17:55+0000\n"
12+
"Last-Translator: anonymous <[email protected]>\n"
13+
"Language-Team: Norwegian Bokmål <https://l10n.elementaryos.org/projects/"
14+
"desktop/notifications-extra/nb/>\n"
1515
"Language: nb\n"
1616
"MIME-Version: 1.0\n"
1717
"Content-Type: text/plain; charset=UTF-8\n"
1818
"Content-Transfer-Encoding: 8bit\n"
1919
"Plural-Forms: nplurals=2; plural=n != 1;\n"
20-
"X-Generator: Weblate 4.17\n"
20+
"X-Generator: Weblate 5.11.4\n"
2121

2222
#: data/notifications.metainfo.xml.in:10
2323
msgid "Notifications"
@@ -32,7 +32,6 @@ msgid "A notification server for Pantheon"
3232
msgstr ""
3333

3434
#: data/notifications.metainfo.xml.in:30
35-
#, fuzzy
3635
msgid "elementary, Inc."
3736
msgstr "elementary, Inc."
3837

po/extra/sco.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ msgstr ""
88
"Project-Id-Version: extra\n"
99
"Report-Msgid-Bugs-To: \n"
1010
"POT-Creation-Date: 2025-10-05 17:49+0000\n"
11-
"PO-Revision-Date: 2025-04-16 14:55+0000\n"
12-
"Last-Translator: Ben Gordon Agnew <[email protected]>\n"
11+
"PO-Revision-Date: 2025-10-06 17:55+0000\n"
12+
"Last-Translator: anonymous <[email protected]>\n"
1313
"Language-Team: Scots <https://l10n.elementaryos.org/projects/desktop/"
1414
"notifications-extra/sco/>\n"
1515
"Language: sco\n"
1616
"MIME-Version: 1.0\n"
1717
"Content-Type: text/plain; charset=UTF-8\n"
1818
"Content-Transfer-Encoding: 8bit\n"
1919
"Plural-Forms: nplurals=2; plural=n != 1;\n"
20-
"X-Generator: Weblate 5.10.4\n"
20+
"X-Generator: Weblate 5.11.4\n"
2121

2222
#: data/notifications.metainfo.xml.in:10
2323
msgid "Notifications"
@@ -33,7 +33,7 @@ msgstr ""
3333

3434
#: data/notifications.metainfo.xml.in:30
3535
msgid "elementary, Inc."
36-
msgstr ""
36+
msgstr "elementary, Inc."
3737

3838
#: data/notifications.metainfo.xml.in:38 data/notifications.metainfo.xml.in:50
3939
#: data/notifications.metainfo.xml.in:63 data/notifications.metainfo.xml.in:78

po/extra/szl.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ msgstr ""
88
"Project-Id-Version: extra\n"
99
"Report-Msgid-Bugs-To: \n"
1010
"POT-Creation-Date: 2025-10-05 17:49+0000\n"
11-
"PO-Revision-Date: 2024-08-07 18:17+0000\n"
11+
"PO-Revision-Date: 2025-10-06 17:55+0000\n"
1212
"Last-Translator: anonymous <[email protected]>\n"
13-
"Language-Team: Silesian <https://l10n.elementary.io/projects/desktop/"
13+
"Language-Team: Silesian <https://l10n.elementaryos.org/projects/desktop/"
1414
"notifications-extra/szl/>\n"
1515
"Language: szl\n"
1616
"MIME-Version: 1.0\n"
1717
"Content-Type: text/plain; charset=UTF-8\n"
1818
"Content-Transfer-Encoding: 8bit\n"
1919
"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
2020
"|| n%100>=20) ? 1 : 2;\n"
21-
"X-Generator: Weblate 5.6.2\n"
21+
"X-Generator: Weblate 5.11.4\n"
2222

2323
#: data/notifications.metainfo.xml.in:10
2424
msgid "Notifications"
@@ -34,7 +34,7 @@ msgstr ""
3434

3535
#: data/notifications.metainfo.xml.in:30
3636
msgid "elementary, Inc."
37-
msgstr ""
37+
msgstr "elementary, Inc."
3838

3939
#: data/notifications.metainfo.xml.in:38 data/notifications.metainfo.xml.in:50
4040
#: data/notifications.metainfo.xml.in:63 data/notifications.metainfo.xml.in:78

po/extra/uz.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ msgstr ""
88
"Project-Id-Version: extra\n"
99
"Report-Msgid-Bugs-To: \n"
1010
"POT-Creation-Date: 2025-10-05 17:49+0000\n"
11-
"PO-Revision-Date: 2025-01-11 04:16+0000\n"
11+
"PO-Revision-Date: 2025-10-06 17:55+0000\n"
1212
"Last-Translator: anonymous <[email protected]>\n"
13-
"Language-Team: Uzbek <https://l10n.elementary.io/projects/desktop/"
13+
"Language-Team: Uzbek <https://l10n.elementaryos.org/projects/desktop/"
1414
"notifications-extra/uz/>\n"
1515
"Language: uz\n"
1616
"MIME-Version: 1.0\n"
1717
"Content-Type: text/plain; charset=UTF-8\n"
1818
"Content-Transfer-Encoding: 8bit\n"
1919
"Plural-Forms: nplurals=2; plural=n != 1;\n"
20-
"X-Generator: Weblate 5.9.2\n"
20+
"X-Generator: Weblate 5.11.4\n"
2121

2222
#: data/notifications.metainfo.xml.in:10
2323
msgid "Notifications"
@@ -33,7 +33,7 @@ msgstr ""
3333

3434
#: data/notifications.metainfo.xml.in:30
3535
msgid "elementary, Inc."
36-
msgstr ""
36+
msgstr "elementary Inc."
3737

3838
#: data/notifications.metainfo.xml.in:38 data/notifications.metainfo.xml.in:50
3939
#: data/notifications.metainfo.xml.in:63 data/notifications.metainfo.xml.in:78

src/AbstractBubble.vala

Lines changed: 39 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 elementary, Inc. (https://elementary.io)
2+
* Copyright 2020-2025 elementary, Inc. (https://elementary.io)
33
*
44
* This program is free software; you can redistribute it and/or
55
* modify it under the terms of the GNU General Public
@@ -18,8 +18,18 @@
1818
*
1919
*/
2020

21+
public enum Notifications.CloseReason {
22+
EXPIRED = 1,
23+
DISMISSED = 2,
24+
/**
25+
* This value is unique for org.freedesktop.Notifications server interface and must not be used elsewhere.
26+
*/
27+
CLOSE_NOTIFICATION_CALL = 3,
28+
UNDEFINED = 4
29+
}
30+
2131
public class Notifications.AbstractBubble : Gtk.Window {
22-
public signal void closed (uint32 reason) {
32+
public signal void closed (CloseReason reason) {
2333
close ();
2434
}
2535

@@ -31,6 +41,7 @@ public class Notifications.AbstractBubble : Gtk.Window {
3141

3242
private Gtk.Revealer close_revealer;
3343
private Gtk.Box draw_area;
44+
private Gtk.Overlay overlay;
3445

3546
private uint timeout_id;
3647

@@ -72,7 +83,7 @@ public class Notifications.AbstractBubble : Gtk.Window {
7283
overflow = VISIBLE
7384
};
7485

75-
var overlay = new Gtk.Overlay () {
86+
overlay = new Gtk.Overlay () {
7687
child = draw_area
7788
};
7889
overlay.add_overlay (close_revealer);
@@ -92,12 +103,8 @@ public class Notifications.AbstractBubble : Gtk.Window {
92103
can_focus = false;
93104
set_titlebar (new Gtk.Grid ());
94105

95-
carousel.page_changed.connect ((index) => {
96-
if (index == 0) {
97-
closed (Notifications.Server.CloseReason.DISMISSED);
98-
}
99-
});
100-
close_button.clicked.connect (() => closed (Notifications.Server.CloseReason.DISMISSED));
106+
carousel.page_changed.connect (on_page_changed);
107+
close_button.clicked.connect (() => closed (CloseReason.DISMISSED));
101108

102109
var motion_controller = new Gtk.EventControllerMotion ();
103110
motion_controller.enter.connect (pointer_enter);
@@ -114,18 +121,7 @@ public class Notifications.AbstractBubble : Gtk.Window {
114121
}
115122
});
116123

117-
carousel.notify["position"].connect (() => {
118-
current_swipe_progress = carousel.position;
119-
120-
if (desktop_panel != null) {
121-
int left, right;
122-
get_blur_margins (out left, out right);
123-
124-
desktop_panel.add_blur (left, right, 16, 16, 9);
125-
} else if (Gdk.Display.get_default () is Gdk.X11.Display) {
126-
x11_update_mutter_hints ();
127-
}
128-
});
124+
carousel.notify["position"].connect (update_swipe_progress);
129125

130126
transparency_settings.changed["use-transparency"].connect (update_transparency);
131127
update_transparency ();
@@ -139,6 +135,27 @@ public class Notifications.AbstractBubble : Gtk.Window {
139135
}
140136
}
141137

138+
private void on_page_changed (Adw.Carousel carousel, uint index) {
139+
if (carousel.get_nth_page (index) != overlay) {
140+
closed (CloseReason.DISMISSED);
141+
}
142+
}
143+
144+
private void update_swipe_progress (Object obj, ParamSpec pspec) {
145+
var carousel = (Adw.Carousel) obj;
146+
147+
current_swipe_progress = carousel.position;
148+
149+
if (desktop_panel != null) {
150+
int left, right;
151+
get_blur_margins (out left, out right);
152+
153+
desktop_panel.add_blur (left, right, 16, 16, 9);
154+
} else if (Gdk.Display.get_default () is Gdk.X11.Display) {
155+
x11_update_mutter_hints ();
156+
}
157+
}
158+
142159
public new void present () {
143160
if (timeout_id != 0) {
144161
Source.remove (timeout_id);
@@ -170,11 +187,10 @@ public class Notifications.AbstractBubble : Gtk.Window {
170187
}
171188

172189
private bool timeout_expired () {
173-
closed (Notifications.Server.CloseReason.EXPIRED);
190+
closed (CloseReason.EXPIRED);
174191
return Source.REMOVE;
175192
}
176193

177-
178194
private void get_blur_margins (out int left, out int right) {
179195
var width = get_width ();
180196
var distance = (1 - current_swipe_progress) * width;

src/Application.vala

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019-2023 elementary, Inc. (https://elementary.io)
2+
* Copyright 2019-2025 elementary, Inc. (https://elementary.io)
33
*
44
* This program is free software; you can redistribute it and/or
55
* modify it under the terms of the GNU General Public
@@ -19,8 +19,7 @@
1919
*/
2020

2121
public class Notifications.Application : Gtk.Application {
22-
private static Granite.Settings granite_settings;
23-
private static Gtk.Settings gtk_settings;
22+
public static Settings settings = new Settings ("io.elementary.notifications");
2423

2524
public Application () {
2625
Object (
@@ -33,7 +32,7 @@ public class Notifications.Application : Gtk.Application {
3332
try {
3433
new Notifications.Server (connection);
3534
} catch (Error e) {
36-
Error.prefix_literal (out e, "Registring notification server failed: ");
35+
Error.prefix_literal (out e, "Registering notification server failed: ");
3736
throw e;
3837
}
3938

@@ -45,13 +44,6 @@ public class Notifications.Application : Gtk.Application {
4544

4645
Granite.init ();
4746

48-
granite_settings = Granite.Settings.get_default ();
49-
gtk_settings = Gtk.Settings.get_default ();
50-
gtk_settings.gtk_application_prefer_dark_theme = granite_settings.prefers_color_scheme == Granite.Settings.ColorScheme.DARK;
51-
granite_settings.notify["prefers-color-scheme"].connect (() => {
52-
gtk_settings.gtk_application_prefer_dark_theme = granite_settings.prefers_color_scheme == Granite.Settings.ColorScheme.DARK;
53-
});
54-
5547
unowned var context = CanberraGtk4.context_get ();
5648
context.change_props (
5749
Canberra.PROP_APPLICATION_NAME, "Notifications",
@@ -72,12 +64,22 @@ public class Notifications.Application : Gtk.Application {
7264
dbus_flags,
7365
() => hold (),
7466
(conn, name) => {
75-
critical ("Could not aquire bus: %s", name);
67+
critical ("Could not acquire bus: %s", name);
7668
name_lost ();
7769
}
7870
);
7971
}
8072

73+
public static void play_sound (string sound_name) {
74+
Canberra.Proplist props;
75+
Canberra.Proplist.create (out props);
76+
77+
props.sets (Canberra.PROP_CANBERRA_CACHE_CONTROL, "volatile");
78+
props.sets (Canberra.PROP_EVENT_ID, sound_name);
79+
80+
CanberraGtk4.context_get ().play_full (0, props);
81+
}
82+
8183
public static int main (string[] args) {
8284
var app = new Application ();
8385
return app.run (args);

src/Bubble.vala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019-2023 elementary, Inc. (https://elementary.io)
2+
* Copyright 2019-2025 elementary, Inc. (https://elementary.io)
33
* SPDX-License-Identifier: GPL-3.0-or-later
44
*/
55

@@ -56,7 +56,7 @@ public class Notifications.Bubble : AbstractBubble {
5656
notification.app_info.launch_uris_async.begin (null, null, null, (obj, res) => {
5757
try {
5858
((AppInfo) obj).launch_uris_async.end (res);
59-
closed (Server.CloseReason.UNDEFINED);
59+
closed (CloseReason.UNDEFINED);
6060
} catch (Error e) {
6161
warning ("Unable to launch app: %s", e.message);
6262
}

0 commit comments

Comments
 (0)