diff --git a/src/AbstractBubble.vala b/src/AbstractBubble.vala index bf34df1..446c26a 100644 --- a/src/AbstractBubble.vala +++ b/src/AbstractBubble.vala @@ -19,17 +19,17 @@ */ public class Notifications.AbstractBubble : Gtk.Window { - public signal void closed (uint32 reason); + public signal void closed (uint32 reason) { + close (); + } public uint32 timeout { get; set; } protected Gtk.Stack content_area; private Gtk.Revealer close_revealer; - private Gtk.Revealer revealer; private Gtk.Box draw_area; - private Gtk.EventControllerMotion motion_controller; private uint timeout_id; construct { @@ -64,25 +64,14 @@ public class Notifications.AbstractBubble : Gtk.Window { }; overlay.add_overlay (close_revealer); - revealer = new Gtk.Revealer () { - reveal_child = true, - transition_duration = 195, - transition_type = Gtk.RevealerTransitionType.CROSSFADE, - child = overlay - }; - var carousel = new Adw.Carousel () { - allow_mouse_drag = true, - interactive = true, - halign = Gtk.Align.END, hexpand = true }; carousel.append (new Gtk.Grid ()); - carousel.append (revealer); - carousel.scroll_to (revealer, false); + carousel.append (overlay); + carousel.scroll_to (overlay, false); child = carousel; - default_height = 0; default_width = 332; resizable = false; add_css_class ("notification"); @@ -96,28 +85,11 @@ public class Notifications.AbstractBubble : Gtk.Window { } }); close_button.clicked.connect (() => closed (Notifications.Server.CloseReason.DISMISSED)); - closed.connect (close); - motion_controller = new Gtk.EventControllerMotion () { - propagation_phase = TARGET - }; + var motion_controller = new Gtk.EventControllerMotion (); motion_controller.enter.connect (pointer_enter); motion_controller.leave.connect (pointer_leave); - carousel.add_controller (motion_controller); - - close_request.connect (on_close); - } - - private bool on_close (Gtk.Window window) { - revealer.reveal_child = false; - - Timeout.add (revealer.transition_duration, () => { - destroy (); - return Source.REMOVE; - }); - - return Gdk.EVENT_PROPAGATE; } public new void present () { diff --git a/src/DBus.vala b/src/DBus.vala index 0259a67..3e23b0f 100644 --- a/src/DBus.vala +++ b/src/DBus.vala @@ -158,7 +158,7 @@ public class Notifications.Server : Object { bubbles[id].insert_action_group ("fdo", action_group); bubbles[id].close_request.connect (() => { bubbles[id] = null; - return Gdk.EVENT_STOP; + return Gdk.EVENT_PROPAGATE; }); bubbles[id].closed.connect ((res) => { if (res == CloseReason.EXPIRED && app_settings.get_boolean ("remember")) { @@ -209,7 +209,7 @@ public class Notifications.Server : Object { ); confirmation.close_request.connect (() => { confirmation = null; - return Gdk.EVENT_STOP; + return Gdk.EVENT_PROPAGATE; }); } else { confirmation.icon_name = icon_name;