Skip to content
Merged
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
3 changes: 3 additions & 0 deletions data/notifications.metainfo.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
<li>Updated translations</li>
</ul>
</description>
<issues>
<issue url="https://github.com/elementary/notifications/issues/279">Notification Focus Settings</issue>
</issues>
</release>

<release version="8.1.1" date="2025-11-07" urgency="medium">
Expand Down
16 changes: 12 additions & 4 deletions src/AbstractBubble.vala
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public class Notifications.AbstractBubble : Gtk.Window {
add_css_class ("notification");
// Prevent stealing focus when an app window is closed
can_focus = false;
focusable = false;
set_titlebar (new Gtk.Grid ());

carousel.page_changed.connect (on_page_changed);
Expand Down Expand Up @@ -162,7 +163,12 @@ public class Notifications.AbstractBubble : Gtk.Window {
timeout_id = 0;
}

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

if (timeout != 0) {
timeout_id = Timeout.add (timeout, timeout_expired);
Expand Down Expand Up @@ -218,10 +224,12 @@ 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 ();
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);

Expand Down