Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notification dbus refactor #36

Merged
merged 39 commits into from
Jan 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
08bb20d
Add initital skeleton for a new notification DBus server
EbonJaeger Jan 7, 2022
ff5e86b
Create a popup widget for notifications
EbonJaeger Jan 7, 2022
4696282
Spit notification classes into separate files
EbonJaeger Jan 8, 2022
c9249ea
Port over code to set the notification popup position
EbonJaeger Jan 8, 2022
3356ee8
Add support for DoNotDisturb
EbonJaeger Jan 9, 2022
b4ff59b
Rip out all of the old Raven notification handling
EbonJaeger Jan 11, 2022
81db33b
Fix DBus name collision
EbonJaeger Jan 11, 2022
2f1b4fe
Simply the popup icon and fix usage of app_icon
EbonJaeger Jan 11, 2022
a05bf8e
Fix long notifications stretching the popup width
EbonJaeger Jan 11, 2022
1f73483
Re-add overridden methods
EbonJaeger Jan 11, 2022
3fe8031
Improve last notification tracking
EbonJaeger Jan 13, 2022
f1ddd0a
Use a Gtk.Stack for popup bodies
EbonJaeger Jan 13, 2022
890111d
Fix action button text and clicking a notification breaking tracking
EbonJaeger Jan 13, 2022
6ce4e0b
Notification icon had too much left margin
EbonJaeger Jan 13, 2022
6436445
Move notification class and enums to the libs dir
EbonJaeger Jan 13, 2022
983ed4e
Fix compilation.
JoshStrobl Jan 13, 2022
197ca59
Re-enable the Raven notification view
EbonJaeger Jan 14, 2022
ae7c020
Add initital skeleton for a new notification DBus server
EbonJaeger Jan 7, 2022
10ca0bd
Create a popup widget for notifications
EbonJaeger Jan 7, 2022
43827e2
Spit notification classes into separate files
EbonJaeger Jan 8, 2022
57b2bbe
Port over code to set the notification popup position
EbonJaeger Jan 8, 2022
eabdea8
Add support for DoNotDisturb
EbonJaeger Jan 9, 2022
5f46ae8
Rip out all of the old Raven notification handling
EbonJaeger Jan 11, 2022
eadd65e
Fix DBus name collision
EbonJaeger Jan 11, 2022
6633eb6
Simply the popup icon and fix usage of app_icon
EbonJaeger Jan 11, 2022
9270722
Fix long notifications stretching the popup width
EbonJaeger Jan 11, 2022
3a0e15c
Re-add overridden methods
EbonJaeger Jan 11, 2022
4fdd20e
Improve last notification tracking
EbonJaeger Jan 13, 2022
5c1f3b1
Use a Gtk.Stack for popup bodies
EbonJaeger Jan 13, 2022
acb0f16
Fix action button text and clicking a notification breaking tracking
EbonJaeger Jan 13, 2022
8013b6a
Notification icon had too much left margin
EbonJaeger Jan 13, 2022
ee4fd1c
Move notification class and enums to the libs dir
EbonJaeger Jan 13, 2022
503677c
Fix compilation.
JoshStrobl Jan 13, 2022
6747467
Re-enable the Raven notification view
EbonJaeger Jan 14, 2022
6d8da14
Merge branch 'notification-dbus-refactor' of github.com:BuddiesOfBudg…
EbonJaeger Jan 14, 2022
9bb6298
Make logic in notification view easier to read
EbonJaeger Jan 14, 2022
e367387
Hook up fullscreen pausing
EbonJaeger Jan 14, 2022
ee2e756
Reformat code
EbonJaeger Jan 14, 2022
d0db004
Changes from code review
EbonJaeger Jan 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/abomination/abomination.vala
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
* (at your option) any later version.
*/

private const string RAVEN_DBUS_NAME = "org.budgie_desktop.Raven";
private const string RAVEN_DBUS_OBJECT_PATH = "/org/budgie_desktop/Raven";
private const string NOTIFICATIONS_DBUS_NAME = "org.budgie_desktop.Notifications";
private const string NOTIFICATIONS_DBUS_OBJECT_PATH = "/org/budgie_desktop/Notifications";

[DBus (name="org.budgie_desktop.Raven")]
public interface AbominationRavenRemote : GLib.Object {
public async abstract void SetPauseNotifications(bool paused) throws DBusError, IOError;
[DBus (name="org.buddiesofbudgie.budgie.Dispatcher")]
public interface NotificationsRemote : GLib.Object {
public abstract bool notifications_paused { get; set; default = false; }
}

namespace Budgie.Abomination {
Expand All @@ -34,7 +34,7 @@ namespace Budgie.Abomination {
private HashTable<string?, unowned AppGroup?> running_app_groups; // running_app_groups is a list of app groups based on the group name

private Wnck.Screen screen = null;
private AbominationRavenRemote? raven_proxy = null;
private NotificationsRemote? notifications_proxy = null;

private ulong color_id = 0;

Expand All @@ -56,7 +56,7 @@ namespace Budgie.Abomination {

this.screen = Wnck.Screen.get_default();

Bus.get_proxy.begin<AbominationRavenRemote>(BusType.SESSION, RAVEN_DBUS_NAME, RAVEN_DBUS_OBJECT_PATH, 0, null, this.on_raven_get);
Bus.get_proxy.begin<NotificationsRemote>(BusType.SESSION, NOTIFICATIONS_DBUS_NAME, NOTIFICATIONS_DBUS_OBJECT_PATH, 0, null, this.on_dbus_get);

if (this.color_settings != null) { // gsd colors plugin schema defined
this.update_night_light_value();
Expand Down Expand Up @@ -89,9 +89,9 @@ namespace Budgie.Abomination {
}

/* Hold onto our Raven proxy ref */
public void on_raven_get(Object? o, AsyncResult? res) {
public void on_dbus_get(Object? o, AsyncResult? res) {
try {
this.raven_proxy = Bus.get_proxy.end(res);
this.notifications_proxy = Bus.get_proxy.end(res);
} catch (Error e) {
warning("Failed to gain Raven proxy: %s", e.message);
}
Expand Down Expand Up @@ -320,7 +320,7 @@ namespace Budgie.Abomination {

private void set_notifications_paused() {
if (this.should_pause_notifications_on_fullscreen) {
raven_proxy.SetPauseNotifications.begin(this.fullscreen_windows.size() >= 1);
notifications_proxy.notifications_paused = (this.fullscreen_windows.size() >= 1);
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/daemon/manager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace Budgie {

/* On Screen Display */
Budgie.OSDManager? osd;
Budgie.Notifications.Server? notifications;
Budgie.MenuManager? menus;
Budgie.TabSwitcher? switcher;

Expand All @@ -36,6 +37,7 @@ namespace Budgie {
});
osd = new Budgie.OSDManager();
osd.setup_dbus(replace);
notifications = new Budgie.Notifications.Server();
menus = new Budgie.MenuManager();
menus.setup_dbus(replace);
switcher = new Budgie.TabSwitcher();
Expand Down
4 changes: 4 additions & 0 deletions src/daemon/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ daemon_resources = gnome.compile_resources(

daemon_sources = [
'endsession.vala',
'notifications/dbus.vala',
'notifications/popup.vala',
'main.vala',
'manager.vala',
'menus.vala',
Expand All @@ -31,6 +33,8 @@ daemon_deps = [
dep_gdkx11,
dep_notify,
dep_wnck,
link_libbudgieprivate,
libplugin_vapi,
link_libappsys,
link_libconfig,
link_libtheme,
Expand Down
Loading