From 7dd4dc6ace22aab91939176cb623d54cdb1788e4 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Fri, 31 Dec 2021 13:03:07 +0000 Subject: [PATCH] On Haiku, sync a frames's connection to the app sever after raising * src/haiku_support.h: (BWindow_sync) * src/haiku_support.cc (BWindow_sync): New function. * src/haikuterm.c (haiku_frame_raise_lower): Synchronize window after raising it to avoid situations where raising windows is done out-of-order, such as when ediff raises a frame. --- src/haiku_support.cc | 12 ++++++++++++ src/haiku_support.h | 3 +++ src/haikuterm.c | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/haiku_support.cc b/src/haiku_support.cc index fea0684b1b4..dae0825bd29 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc @@ -2901,6 +2901,18 @@ BWindow_set_min_size (void *window, int width, int height) w->UnlockLooper (); } +/* Synchronize WINDOW's connection to the App Server. */ +void +BWindow_sync (void *window) +{ + BWindow *w = (BWindow *) window; + + if (!w->LockLooper ()) + gui_abort ("Failed to lock window looper for sync"); + w->Sync (); + w->UnlockLooper (); +} + /* Set the alignment of WINDOW's dimensions. */ void BWindow_set_size_alignment (void *window, int align_width, int align_height) diff --git a/src/haiku_support.h b/src/haiku_support.h index 9f5f3c77e3d..b08a561def3 100644 --- a/src/haiku_support.h +++ b/src/haiku_support.h @@ -819,6 +819,9 @@ extern "C" extern void BWindow_set_size_alignment (void *window, int align_width, int align_height); + extern void + BWindow_sync (void *window); + #ifdef __cplusplus extern void * find_appropriate_view_for_draw (void *vw); diff --git a/src/haikuterm.c b/src/haikuterm.c index 24fa44b01d0..9b54e50b617 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c @@ -346,7 +346,7 @@ haiku_frame_raise_lower (struct frame *f, bool raise_p) { block_input (); BWindow_activate (FRAME_HAIKU_WINDOW (f)); - flush_frame (f); + BWindow_sync (FRAME_HAIKU_WINDOW (f)); unblock_input (); } } -- 2.39.2