Fix GtkWidget::key-press-event callback prototype

This commit is contained in:
Přemysl Eric Janouch 2021-11-12 07:22:06 +01:00
parent 062b5757da
commit afc08df234
Signed by: p
GPG Key ID: A0420B94F92B9493

View File

@ -250,12 +250,12 @@ on_item_activated(G_GNUC_UNUSED FastivBrowser *browser, const char *path,
// g_signal_connect{,after}(), or overriding the handler and either tactically // g_signal_connect{,after}(), or overriding the handler and either tactically
// chaining up or using gtk_window_propagate_key_event(). // chaining up or using gtk_window_propagate_key_event().
static gboolean static gboolean
on_key_press(G_GNUC_UNUSED GtkWidget *widget, GdkEvent *event, on_key_press(G_GNUC_UNUSED GtkWidget *widget, GdkEventKey *event,
G_GNUC_UNUSED gpointer data) G_GNUC_UNUSED gpointer data)
{ {
switch (event->key.state & gtk_accelerator_get_default_mod_mask()) { switch (event->state & gtk_accelerator_get_default_mod_mask()) {
case GDK_CONTROL_MASK: case GDK_CONTROL_MASK:
switch (event->key.keyval) { switch (event->keyval) {
case GDK_KEY_o: case GDK_KEY_o:
on_open(); on_open();
return TRUE; return TRUE;
@ -270,7 +270,7 @@ on_key_press(G_GNUC_UNUSED GtkWidget *widget, GdkEvent *event,
} }
break; break;
case 0: case 0:
switch (event->key.keyval) { switch (event->keyval) {
case GDK_KEY_Escape: case GDK_KEY_Escape:
case GDK_KEY_q: case GDK_KEY_q:
gtk_main_quit(); gtk_main_quit();