From d7e1ed17d9d60ab0fe306d1216f695fd96d51956 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sat, 1 Jan 2022 05:32:42 +0000 Subject: [PATCH] Flush frames after mouse face is cleared on a child frame in Haiku * src/haiku_support.cc (~EmacsWindow): (UpwardsSubsetChildren): (UpwardsUnSubsetChildren): Fix locking semantics. * src/haikuterm.c (haiku_read_socket): Flush dirty back buffers after clearing mouse face because the pointer was moved out of a frame. --- src/haiku_support.cc | 9 +++++++++ src/haikuterm.c | 2 ++ 2 files changed, 11 insertions(+) diff --git a/src/haiku_support.cc b/src/haiku_support.cc index dae0825bd29..32e61d96604 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc @@ -259,7 +259,10 @@ public: struct child_frame *next; for (struct child_frame *f = subset_windows; f; f = next) { + if (f->window->LockLooper ()) + gui_abort ("Failed to lock looper for unparent"); f->window->Unparent (); + f->window->UnlockLooper (); next = f->next; delete f; } @@ -279,6 +282,8 @@ public: void UpwardsSubsetChildren (EmacsWindow *w) { + if (!LockLooper ()) + gui_abort ("Failed to lock looper for subset"); if (!child_frame_lock.Lock ()) gui_abort ("Failed to lock child frame state lock"); UpwardsSubset (w); @@ -286,6 +291,7 @@ public: f = f->next) f->window->UpwardsSubsetChildren (w); child_frame_lock.Unlock (); + UnlockLooper (); } void @@ -298,6 +304,8 @@ public: void UpwardsUnSubsetChildren (EmacsWindow *w) { + if (!LockLooper ()) + gui_abort ("Failed to lock looper for unsubset"); if (!child_frame_lock.Lock ()) gui_abort ("Failed to lock child frame state lock"); UpwardsUnSubset (w); @@ -305,6 +313,7 @@ public: f = f->next) f->window->UpwardsUnSubsetChildren (w); child_frame_lock.Unlock (); + UnlockLooper (); } void diff --git a/src/haikuterm.c b/src/haikuterm.c index 9b54e50b617..574bf40f7b6 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c @@ -2757,6 +2757,8 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) certainly no longer on any text in the frame. */ clear_mouse_face (hlinfo); hlinfo->mouse_face_mouse_frame = 0; + + need_flush = 1; } haiku_new_focus_frame (x_display_list->focused_frame); -- 2.39.2