emacs-diffs
[Top][All Lists]
Advanced

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

master 376d6cf36a: Implement numeric values of `mouse-highlight' on Haik


From: Po Lu
Subject: master 376d6cf36a: Implement numeric values of `mouse-highlight' on Haiku
Date: Sat, 1 Jan 2022 01:21:38 -0500 (EST)

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

    Implement numeric values of `mouse-highlight' on Haiku
    
    * src/haikuterm.c (haiku_read_socket): Clear mouse face on
    keyboard input if `mouse-highlight' is a fixnum.
---
 src/haikuterm.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/src/haikuterm.c b/src/haikuterm.c
index 574bf40f7b..676c2e2148 100644
--- a/src/haikuterm.c
+++ b/src/haikuterm.c
@@ -2693,11 +2693,24 @@ haiku_read_socket (struct terminal *terminal, struct 
input_event *hold_quit)
        case KEY_DOWN:
          {
            struct haiku_key_event *b = buf;
+           Mouse_HLInfo *hlinfo = &x_display_list->mouse_highlight;
            struct frame *f = haiku_window_to_frame (b->window);
            int non_ascii_p;
            if (!f)
              continue;
 
+           /* If mouse-highlight is an integer, input clears out
+              mouse highlighting.  */
+           if (!hlinfo->mouse_face_hidden && FIXNUMP (Vmouse_highlight)
+               && (f == 0
+                   || !EQ (f->tool_bar_window, hlinfo->mouse_face_window)
+                   || !EQ (f->tab_bar_window, hlinfo->mouse_face_window)))
+             {
+               clear_mouse_face (hlinfo);
+               hlinfo->mouse_face_hidden = true;
+               need_flush = 1;
+             }
+
            inev.code = b->unraw_mb_char;
 
            BMapKey (b->kc, &non_ascii_p, &inev.code);
@@ -2738,6 +2751,7 @@ haiku_read_socket (struct terminal *terminal, struct 
input_event *hold_quit)
          {
            struct haiku_mouse_motion_event *b = buf;
            struct frame *f = haiku_window_to_frame (b->window);
+           Mouse_HLInfo *hlinfo = &x_display_list->mouse_highlight;
 
            if (!f)
              continue;
@@ -2748,6 +2762,13 @@ haiku_read_socket (struct terminal *terminal, struct 
input_event *hold_quit)
            x_display_list->last_mouse_movement_time = time (NULL);
            button_or_motion_p = 1;
 
+           if (hlinfo->mouse_face_hidden)
+             {
+               hlinfo->mouse_face_hidden = false;
+               clear_mouse_face (hlinfo);
+               need_flush = 1;
+             }
+
            if (b->just_exited_p)
              {
                Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);



reply via email to

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