emacs-diffs
[Top][All Lists]
Advanced

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

master e976a935f8: Improve handling of xsettings events


From: Po Lu
Subject: master e976a935f8: Improve handling of xsettings events
Date: Mon, 1 Aug 2022 07:01:48 -0400 (EDT)

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

    Improve handling of xsettings events
    
    * src/xsettings.c (xft_settings_event):
    * src/xsettings.h: Return if the event was handled.
    * src/xterm.c (handle_one_xevent): If it was, don't handle the
    event any further.
---
 src/xsettings.c | 7 +++++--
 src/xsettings.h | 2 +-
 src/xterm.c     | 3 ++-
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/xsettings.c b/src/xsettings.c
index c29a844e0a..9c60ff825a 100644
--- a/src/xsettings.c
+++ b/src/xsettings.c
@@ -964,9 +964,10 @@ read_and_apply_settings (Display_Info *dpyinfo, bool 
send_event_p)
 #endif
 
 #ifndef HAVE_PGTK
-/* Check if EVENT for the display in DPYINFO is XSettings related.  */
+/* Check if EVENT for the display in DPYINFO is XSettings related.
+   Return true if it is, after performing associated side effects.  */
 
-void
+bool
 xft_settings_event (Display_Info *dpyinfo, const XEvent *event)
 {
   bool check_window_p = false, apply_settings_p = false;
@@ -1004,6 +1005,8 @@ xft_settings_event (Display_Info *dpyinfo, const XEvent 
*event)
 
   if (apply_settings_p)
     read_and_apply_settings (dpyinfo, true);
+
+  return check_window_p || apply_settings_p;
 }
 #endif
 
diff --git a/src/xsettings.h b/src/xsettings.h
index 5e5df37062..833c2b367d 100644
--- a/src/xsettings.h
+++ b/src/xsettings.h
@@ -36,7 +36,7 @@ typedef struct pgtk_display_info Display_Info;
 
 extern void xsettings_initialize (Display_Info *);
 #ifndef HAVE_PGTK
-extern void xft_settings_event (Display_Info *, const XEvent *);
+extern bool xft_settings_event (Display_Info *, const XEvent *);
 #endif
 extern const char *xsettings_get_system_font (void);
 #ifdef USE_LUCID
diff --git a/src/xterm.c b/src/xterm.c
index bf6061d30e..c34fb3eb36 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -17170,7 +17170,8 @@ handle_one_xevent (struct x_display_info *dpyinfo,
          goto done;
 #endif
 
-        xft_settings_event (dpyinfo, event);
+        if (xft_settings_event (dpyinfo, event))
+         goto done;
 
        f = any;
        /* We don't want to ever leak tooltip frames to Lisp code.  */



reply via email to

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