Flush frames after mouse face is cleared on a child frame in Haiku
authorPo Lu <luangruo@yahoo.com>
Sat, 1 Jan 2022 05:32:42 +0000 (05:32 +0000)
committerPo Lu <luangruo@yahoo.com>
Sat, 1 Jan 2022 05:32:42 +0000 (05:32 +0000)
* 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
src/haikuterm.c

index dae0825bd29fef7e8187480c061007483c483875..32e61d96604768e4d872f983061ce6613cc4f046 100644 (file)
@@ -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
index 9b54e50b617f98f497b8ff55e4b8da27b65ed2ad..574bf40f7b6a40f3a406d250991c6659ec04c27c 100644 (file)
@@ -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);