Commit ca7e27d9 authored by Paolo Borelli's avatar Paolo Borelli
Browse files

Fix keyboard event handling

It seems like the hack using pointers does not work anymore, but
we can not use a normal vala cast.
While at it also leave standalone mode using ESC.
parent a0b07a9a
......@@ -143,8 +143,14 @@ public class Window : Gtk.ApplicationWindow {
public override bool key_press_event (Gdk.EventKey event) {
uint keyval;
if (((Gdk.Event*)(&event))->get_keyval (out keyval) && keyval == Gdk.Key.Escape) {
return ((Clock) stack.visible_child).escape_pressed ();
bool handled = false;
if (((Gdk.Event)(event)).get_keyval (out keyval) && keyval == Gdk.Key.Escape) {
handled = ((Clock) stack.visible_child).escape_pressed ();
}
if (handled) {
return true;
}
return base.key_press_event (event);
......
......@@ -438,6 +438,11 @@ public class Face : Gtk.Stack, Clocks.Clock {
}
public bool escape_pressed () {
if (visible_child == standalone) {
reset_view ();
return true;
}
return content_view.escape_pressed ();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment