Skip to content

Commit eb074b7

Browse files
committed
Remove custom close animation
1 parent 90474b0 commit eb074b7

File tree

2 files changed

+8
-36
lines changed

2 files changed

+8
-36
lines changed

src/AbstractBubble.vala

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@
1919
*/
2020

2121
public class Notifications.AbstractBubble : Gtk.Window {
22-
public signal void closed (uint32 reason);
22+
public signal void closed (uint32 reason) {
23+
close ();
24+
}
2325

2426
public uint32 timeout { get; set; }
2527

2628
protected Gtk.Stack content_area;
2729

2830
private Gtk.Revealer close_revealer;
29-
private Gtk.Revealer revealer;
3031
private Gtk.Box draw_area;
3132

32-
private Gtk.EventControllerMotion motion_controller;
3333
private uint timeout_id;
3434

3535
construct {
@@ -64,25 +64,14 @@ public class Notifications.AbstractBubble : Gtk.Window {
6464
};
6565
overlay.add_overlay (close_revealer);
6666

67-
revealer = new Gtk.Revealer () {
68-
reveal_child = true,
69-
transition_duration = 195,
70-
transition_type = Gtk.RevealerTransitionType.CROSSFADE,
71-
child = overlay
72-
};
73-
7467
var carousel = new Adw.Carousel () {
75-
allow_mouse_drag = true,
76-
interactive = true,
77-
halign = Gtk.Align.END,
7868
hexpand = true
7969
};
8070
carousel.append (new Gtk.Grid ());
81-
carousel.append (revealer);
82-
carousel.scroll_to (revealer, false);
71+
carousel.append (overlay);
72+
carousel.scroll_to (overlay, false);
8373

8474
child = carousel;
85-
default_height = 0;
8675
default_width = 332;
8776
resizable = false;
8877
add_css_class ("notification");
@@ -96,28 +85,11 @@ public class Notifications.AbstractBubble : Gtk.Window {
9685
}
9786
});
9887
close_button.clicked.connect (() => closed (Notifications.Server.CloseReason.DISMISSED));
99-
closed.connect (close);
10088

101-
motion_controller = new Gtk.EventControllerMotion () {
102-
propagation_phase = TARGET
103-
};
89+
var motion_controller = new Gtk.EventControllerMotion ();
10490
motion_controller.enter.connect (pointer_enter);
10591
motion_controller.leave.connect (pointer_leave);
106-
10792
carousel.add_controller (motion_controller);
108-
109-
close_request.connect (on_close);
110-
}
111-
112-
private bool on_close (Gtk.Window window) {
113-
revealer.reveal_child = false;
114-
115-
Timeout.add (revealer.transition_duration, () => {
116-
destroy ();
117-
return Source.REMOVE;
118-
});
119-
120-
return Gdk.EVENT_PROPAGATE;
12193
}
12294

12395
public new void present () {

src/DBus.vala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public class Notifications.Server : Object {
158158
bubbles[id].insert_action_group ("fdo", action_group);
159159
bubbles[id].close_request.connect (() => {
160160
bubbles[id] = null;
161-
return Gdk.EVENT_STOP;
161+
return Gdk.EVENT_PROPAGATE;
162162
});
163163
bubbles[id].closed.connect ((res) => {
164164
if (res == CloseReason.EXPIRED && app_settings.get_boolean ("remember")) {
@@ -209,7 +209,7 @@ public class Notifications.Server : Object {
209209
);
210210
confirmation.close_request.connect (() => {
211211
confirmation = null;
212-
return Gdk.EVENT_STOP;
212+
return Gdk.EVENT_PROPAGATE;
213213
});
214214
} else {
215215
confirmation.icon_name = icon_name;

0 commit comments

Comments
 (0)