mirror of
https://github.com/ErikReider/SwayNotificationCenter.git
synced 2024-10-05 21:08:40 +03:00
Fixes #91
This commit is contained in:
parent
0ed0361291
commit
4d71fdf316
@ -37,16 +37,27 @@ namespace SwayNotificationCenter {
|
||||
|
||||
viewport.size_allocate.connect (size_alloc);
|
||||
|
||||
// Only use release for closing notifications due to Escape key
|
||||
// sometimes being passed through to unfucused application
|
||||
// Ex: Firefox in a fullscreen YouTube video
|
||||
this.key_release_event.connect ((w, event_key) => {
|
||||
if (event_key.type == Gdk.EventType.KEY_RELEASE) {
|
||||
var children = list_box.get_children ();
|
||||
Notification noti = (Notification)
|
||||
list_box.get_focus_child ();
|
||||
switch (Gdk.keyval_name (event_key.keyval)) {
|
||||
case "Escape":
|
||||
case "Caps_Lock":
|
||||
this.set_visibility (false);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
this.key_press_event.connect ((w, event_key) => {
|
||||
if (event_key.type == Gdk.EventType.KEY_PRESS) {
|
||||
var children = list_box.get_children ();
|
||||
Notification noti = (Notification)
|
||||
list_box.get_focus_child ();
|
||||
switch (Gdk.keyval_name (event_key.keyval)) {
|
||||
case "Return":
|
||||
if (noti != null) noti.click_default_action ();
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user