emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master e7614cc9ac: Correctly handle key map updates on Haiku


From: Po Lu
Subject: master e7614cc9ac: Correctly handle key map updates on Haiku
Date: Sat, 12 Nov 2022 08:12:26 -0500 (EST)

branch: master
commit e7614cc9ac18995ef8ac353096a5c13e8cebddc9
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Correctly handle key map updates on Haiku
    
    * src/haiku_support.cc (MessageReceived): Handle
    B_KEY_MAP_LOADED by clearing the previous keymap.
---
 src/haiku_support.cc | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/haiku_support.cc b/src/haiku_support.cc
index 0f8e26d0db..3a98285677 100644
--- a/src/haiku_support.cc
+++ b/src/haiku_support.cc
@@ -653,6 +653,24 @@ public:
       Quit ();
     else if (msg->what == B_CLIPBOARD_CHANGED)
       haiku_write (CLIPBOARD_CHANGED_EVENT, &rq);
+    else if (msg->what == B_KEY_MAP_LOADED)
+      {
+       /* Install the new keymap.  Or rather, clear key_map -- Emacs
+          will fetch it again from the main thread the next time it
+          is needed.  */
+       if (key_map_lock.Lock ())
+         {
+           if (key_map)
+             free (key_map);
+
+           if (key_chars)
+             free (key_chars);
+
+           key_map = NULL;
+           key_chars = NULL;
+           key_map_lock.Unlock ();
+         }
+      }
     else
       BApplication::MessageReceived (msg);
   }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]