summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
index ba35d2920..e6fa514ce 100644
--- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
@@ -444,7 +444,7 @@ void Fl_Wayland_Window_Driver::hide() {
wld_win->subsurface = NULL;
}
if (wld_win->kind == DECORATED) {
- if (wld_win->frame) libdecor_frame_unref(wld_win->frame);
+ libdecor_frame_unref(wld_win->frame);
wld_win->frame = NULL;
wld_win->xdg_surface = NULL;
} else {
@@ -886,20 +886,18 @@ void Fl_Wayland_Window_Driver::wait_for_expose()
}
static void delayed_close(void *data) {
- if (data) {
- Fl::remove_check(delayed_close, data);
- Fl::handle(FL_CLOSE, (Fl_Window*)data);
- Fl::add_timeout(0.01, delayed_close, NULL); // necessary for closing with app menu
- }
+ Fl::remove_check(delayed_close, data);
+ Fl::handle(FL_CLOSE, (Fl_Window*)data);
}
static void handle_close(struct libdecor_frame *frame, void *user_data)
{ // runs when the close button of a window titlebar is pushed
// or after "Quit" of the application menu
- libdecor_frame_unref(frame); // may or may not release frame
+ // or after the Kill command of Sway
struct wld_window* wl_win = (struct wld_window*)user_data;
+ // the close window attempt is delayed because libdecor
+ // uses the frame after return from this function
Fl::add_check(delayed_close, wl_win->fl_win);
- wl_win->frame = NULL;
}