From c1fbbc57a9c850e2e8d756d0e6d7e967c652e870 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Fri, 20 May 2022 09:28:19 +0000 Subject: [PATCH] Fix race conditions processing zoom events on Haiku * src/haiku_support.cc (Zoom): * src/haiku_support.h (struct haiku_zoom_event): Include the current fullscreen mode in the event. * src/haikuterm.c (haiku_read_socket): Use that instead of the current frame's fullscreen mode. --- src/haiku_support.cc | 1 + src/haiku_support.h | 1 + src/haikuterm.c | 5 +---- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/haiku_support.cc b/src/haiku_support.cc index 3961d33e4d7..33c68cbd465 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc @@ -1281,6 +1281,7 @@ public: struct haiku_zoom_event rq; rq.window = this; + rq.fullscreen_mode = fullscreen_mode; haiku_write (ZOOM_EVENT, &rq); } diff --git a/src/haiku_support.h b/src/haiku_support.h index b66486b1dce..163685572f6 100644 --- a/src/haiku_support.h +++ b/src/haiku_support.h @@ -249,6 +249,7 @@ struct haiku_menu_bar_help_event struct haiku_zoom_event { void *window; + int fullscreen_mode; }; enum haiku_font_specification diff --git a/src/haikuterm.c b/src/haikuterm.c index 731afd9d394..6401ea12330 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c @@ -3867,14 +3867,11 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) { struct haiku_zoom_event *b = buf; struct frame *f = haiku_window_to_frame (b->window); - struct haiku_output *output; if (!f) continue; - output = FRAME_OUTPUT_DATA (f); - - if (output->fullscreen_mode == FULLSCREEN_MAXIMIZED) + if (b->fullscreen_mode == FULLSCREEN_MODE_MAXIMIZED) f->want_fullscreen = FULLSCREEN_NONE; else f->want_fullscreen = FULLSCREEN_MAXIMIZED; -- 2.39.2