mirror of
https://github.com/jtheoof/swappy.git
synced 2024-08-17 02:30:47 +03:00
fix(window): quit when delete event is received
This commit is contained in:
parent
b287fefd6d
commit
0c5e458d4c
@ -9,6 +9,8 @@ void application_finish(struct swappy_state *state);
|
||||
/* Glade signals */
|
||||
void window_keypress_handler(GtkWidget *widget, GdkEventKey *event,
|
||||
struct swappy_state *state);
|
||||
gboolean window_delete_handler(GtkWidget *widget, GdkEvent *event,
|
||||
struct swappy_state *state);
|
||||
|
||||
void undo_clicked_handler(GtkWidget *widget, struct swappy_state *state);
|
||||
void redo_clicked_handler(GtkWidget *widget, struct swappy_state *state);
|
||||
|
@ -28,6 +28,7 @@
|
||||
<property name="resizable">False</property>
|
||||
<property name="window_position">center</property>
|
||||
<property name="show_menubar">False</property>
|
||||
<signal name="delete-event" handler="window_delete_handler" swapped="no"/>
|
||||
<signal name="key-press-event" handler="window_keypress_handler" swapped="no"/>
|
||||
<child type="titlebar">
|
||||
<object class="GtkHeaderBar">
|
||||
|
@ -301,6 +301,12 @@ void window_keypress_handler(GtkWidget *widget, GdkEventKey *event,
|
||||
}
|
||||
}
|
||||
|
||||
gboolean window_delete_handler(GtkWidget *widget, GdkEvent *event,
|
||||
struct swappy_state *state) {
|
||||
gtk_main_quit();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void undo_clicked_handler(GtkWidget *widget, struct swappy_state *state) {
|
||||
action_undo(state);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user