From 08bf970b16405d4f6b48559e517ab61339a956bd Mon Sep 17 00:00:00 2001 From: Chris Feng Date: Fri, 19 Feb 2016 20:18:29 +0800 Subject: [PATCH] Minor fixes for system tray * exwm-systemtray.el (exwm-systemtray--embed): Default to visible if the XEMBED_MAPPED flag is not set. (exwm-systemtray--on-ClientMessage): Only embed new icons. Ignore balloon messages. --- exwm-systemtray.el | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/exwm-systemtray.el b/exwm-systemtray.el index 11d9be6..e9a9745 100644 --- a/exwm-systemtray.el +++ b/exwm-systemtray.el @@ -101,8 +101,13 @@ You shall use the default value if using auto-hide minibuffer.") :value-mask xcb:CW:EventMask :event-mask (logior xcb:EventMask:ResizeRedirect xcb:EventMask:PropertyChange))) - (when (setq visible - (/= 0 (logand (slot-value info 'flags) xcb:xembed:MAPPED))) + (setq visible (slot-value info 'flags)) + (if visible + (setq visible + (/= 0 (logand (slot-value info 'flags) xcb:xembed:MAPPED))) + ;; Default to visible. + (setq visible t)) + (when visible (exwm--log "(System Tray) Map the window") (xcb:+request exwm-systemtray--connection (make-instance 'xcb:MapWindow :window icon))) @@ -245,13 +250,11 @@ You shall use the default value if using auto-hide minibuffer.") (setq data32 (slot-value data 'data32) opcode (elt data32 1)) (cond ((= opcode xcb:systemtray:opcode:REQUEST-DOCK) - (exwm-systemtray--embed (elt data32 2))) - ((= opcode xcb:systemtray:opcode:BEGIN-MESSAGE) - ;; FIXME - ) - ((= opcode xcb:systemtray:opcode:CANCEL-MESSAGE) - ;; FIXME - ) + (unless (assoc (elt data32 2) exwm-systemtray--list) + (exwm-systemtray--embed (elt data32 2)))) + ;; Not implemented (rarely used nowadays). + ((or (= opcode xcb:systemtray:opcode:BEGIN-MESSAGE) + (= opcode xcb:systemtray:opcode:CANCEL-MESSAGE))) (t (exwm--log "(System Tray) Unknown opcode message: %s" obj)))))))