about summary refs log tree commit diff
path: root/exwm-systemtray.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2016-02-19T12·18+0800
committerChris Feng <chris.w.feng@gmail.com>2016-02-19T12·18+0800
commit08bf970b16405d4f6b48559e517ab61339a956bd (patch)
treec45e92a06b3c7ead3cc9095824551e7f835422d0 /exwm-systemtray.el
parentfc589b899b71e88e48931de41ea1df760f9c1edd (diff)
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.
Diffstat (limited to 'exwm-systemtray.el')
-rw-r--r--exwm-systemtray.el21
1 files changed, 12 insertions, 9 deletions
diff --git a/exwm-systemtray.el b/exwm-systemtray.el
index 11d9be647486..e9a974531686 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)))))))