Skip to content
Merged
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
24 changes: 21 additions & 3 deletions src/AbstractBubble.vala
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ public class Notifications.AbstractBubble : Gtk.Window {
// We have to wrap in Idle otherwise the Meta.Window of the WaylandSurface in Gala is still null
Idle.add_once (init_wl);
} else {
init_x ();
x11_make_notification ();
x11_update_mutter_hints ();
}
});

Expand All @@ -122,7 +123,7 @@ public class Notifications.AbstractBubble : Gtk.Window {

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

Expand Down Expand Up @@ -181,7 +182,7 @@ public class Notifications.AbstractBubble : Gtk.Window {
right = (int) (16 - distance).clamp (0, width);
}

private void init_x () {
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 ();
Expand All @@ -198,6 +199,23 @@ public class Notifications.AbstractBubble : Gtk.Window {
}
}

private void x11_make_notification () {
unowned 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 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