Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
GIT_USER_NAME: "elementaryBot"
GIT_USER_EMAIL: "builds@elementary.io"
with:
release_branch: "noble"
release_branch: "resolute"
2 changes: 0 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ executable(
dependency ('granite-7', version: '>=7.7.0'),
dependency ('gtk4'),
dependency('gtk4-wayland'),
dependency('gtk4-x11'),
dependency ('gtk4-x11'),
dependency ('libadwaita-1'),
dependency('wayland-client'),
pantheon_desktop_shell_dep
Expand Down
54 changes: 3 additions & 51 deletions src/AbstractBubble.vala
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,8 @@ public class Notifications.AbstractBubble : Gtk.Window {
accessible_role = ALERT;

child.realize.connect (() => {
if (Gdk.Display.get_default () is Gdk.Wayland.Display) {
// We have to wrap in Idle otherwise the Meta.Window of the WaylandSurface in Gala is still null
Idle.add_once (init_wl);
} else {
x11_make_notification ();
x11_update_mutter_hints ();
}
// We have to wrap in Idle otherwise the Meta.Window of the WaylandSurface in Gala is still null
Idle.add_once (init_wl);
});

carousel.notify["position"].connect (update_swipe_progress);
Expand Down Expand Up @@ -154,8 +149,6 @@ public class Notifications.AbstractBubble : Gtk.Window {
get_blur_margins (out left, out right);

desktop_panel.add_blur (left, right, 16, 16, 9);
} else if (Gdk.Display.get_default () is Gdk.X11.Display) {
x11_update_mutter_hints ();
}
}

Expand All @@ -165,12 +158,7 @@ public class Notifications.AbstractBubble : Gtk.Window {
timeout_id = 0;
}

if (Gdk.Display.get_default () is Gdk.X11.Display) {
// Avoid present on X11 because it focuses the window
base.show ();
} else {
base.present ();
}
base.present ();

if (timeout != 0) {
timeout_id = Timeout.add (timeout, timeout_expired);
Expand Down Expand Up @@ -206,42 +194,6 @@ public class Notifications.AbstractBubble : Gtk.Window {
right = (int) (16 - distance).clamp (0, width);
}

private void x11_update_mutter_hints () {
var display = Gdk.Display.get_default ();
if (display is Gdk.X11.Display) {
unowned var xdisplay = ((Gdk.X11.Display) display).get_xdisplay ();

var window = ((Gdk.X11.Surface) get_surface ()).get_xid ();
var prop = xdisplay.intern_atom ("_MUTTER_HINTS", false);

int left, right;
get_blur_margins (out left, out right);

var value = "blur=%d,%d,16,16,9".printf (left, right);

xdisplay.change_property (window, prop, X.XA_STRING, 8, 0, (uchar[]) value, value.length);
}
}

private void x11_make_notification () {
unowned var display = Gdk.Display.get_default ();
if (display is Gdk.X11.Display) {
unowned var x11_surface = (Gdk.X11.Surface) get_surface ();
var window = (x11_surface).get_xid ();
x11_surface.set_skip_pager_hint (true);
x11_surface.set_skip_taskbar_hint (true);

unowned var xdisplay = ((Gdk.X11.Display) display).get_xdisplay ();
var atom = xdisplay.intern_atom ("_NET_WM_WINDOW_TYPE", false);
var notification_atom = xdisplay.intern_atom ("_NET_WM_WINDOW_TYPE_NOTIFICATION", false);

// (X.Atom) 4 is XA_ATOM
// 32 is format
// 0 means replace
xdisplay.change_property (window, atom, (X.Atom) 4, 32, 0, (uchar[]) notification_atom, 1);
}
}

private static Wl.RegistryListener registry_listener;
private void init_wl () {
registry_listener.global = registry_handle_global;
Expand Down
9 changes: 0 additions & 9 deletions src/CanberraGtk4.vala
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,6 @@ namespace CanberraGtk4 {
}

unowned var display = Gdk.Display.get_default ();
if (display is Gdk.X11.Display) {
unowned var display_name = display.get_name ();
if (display_name != null) {
proplist.sets (Canberra.PROP_WINDOW_X11_SCREEN, display_name);
}

var screen = "%i".printf (((Gdk.X11.Display) display).get_screen ().get_screen_number ());
proplist.sets (Canberra.PROP_WINDOW_X11_SCREEN, screen);
}

context.change_props_full (proplist);

Expand Down