Merge branch 'sigint' of https://github.com/jacwah/kitty
This commit is contained in:
commit
aaa521bd24
@ -372,7 +372,7 @@ parse_input(ChildMonitor *self) {
|
||||
}
|
||||
|
||||
if (UNLIKELY(kill_signal_received)) {
|
||||
global_state.close_all_windows = true;
|
||||
global_state.terminate = true;
|
||||
} else {
|
||||
count = self->count;
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
@ -737,7 +737,6 @@ process_pending_resizes(double now) {
|
||||
static inline void
|
||||
close_all_windows() {
|
||||
for (size_t w = 0; w < global_state.num_os_windows; w++) mark_os_window_for_close(&global_state.os_windows[w], true);
|
||||
global_state.close_all_windows = false;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
@ -793,7 +792,13 @@ main_loop(ChildMonitor *self, PyObject *a UNUSED) {
|
||||
}
|
||||
#endif
|
||||
parse_input(self);
|
||||
if (global_state.close_all_windows) close_all_windows();
|
||||
if (global_state.terminate) {
|
||||
global_state.terminate = false;
|
||||
close_all_windows();
|
||||
#ifdef __APPLE__
|
||||
request_application_quit();
|
||||
#endif
|
||||
}
|
||||
has_open_windows = process_pending_closes(self);
|
||||
}
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
|
||||
@ -650,6 +650,12 @@ bool
|
||||
application_quit_requested() {
|
||||
return !application_quit_canary || glfwWindowShouldClose(application_quit_canary);
|
||||
}
|
||||
|
||||
void
|
||||
request_application_quit() {
|
||||
if (application_quit_canary)
|
||||
glfwSetWindowShouldClose(application_quit_canary, true);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Global functions {{{
|
||||
|
||||
@ -144,7 +144,7 @@ typedef struct {
|
||||
OSWindow *os_windows;
|
||||
size_t num_os_windows, capacity;
|
||||
OSWindow *callback_os_window;
|
||||
bool close_all_windows;
|
||||
bool terminate;
|
||||
bool is_wayland;
|
||||
bool debug_gl, debug_font_fallback;
|
||||
bool has_pending_resizes;
|
||||
@ -209,5 +209,6 @@ typedef enum {
|
||||
} CocoaPendingAction;
|
||||
void set_cocoa_pending_action(CocoaPendingAction action);
|
||||
bool application_quit_requested();
|
||||
void request_application_quit();
|
||||
#endif
|
||||
void wayland_request_frame_render(OSWindow *w);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user