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-21T12·19+0800
committerChris Feng <chris.w.feng@gmail.com>2016-02-21T12·19+0800
commit55cec760ca3cee21e735bff9a9a5229b222b97ff (patch)
treef6593789633637697906259b5a3b2103de815343 /exwm-systemtray.el
parent7116b01b0c9b7efda105487a17192470c466b9c4 (diff)
Fix emacsclient related issues
* exwm-systemtray.el (exwm-systemtray-height): The value is not available
when emacsclient has just loaded the library (and it crashes emacsclient).

* exwm-workspace.el (exwm-workspace--init): Set `default-minibuffer-frame'
later to prevent it from being modified when using emacsclient.

* exwm-floating.el:
* exwm-randr.el:
* exwm-systemtray.el:
* exwm-workspace.el:
* exwm.el: Use `exwm-workspace--minibuffer-own-frame-p' instead of the raw
variable.
Diffstat (limited to 'exwm-systemtray.el')
-rw-r--r--exwm-systemtray.el14
1 files changed, 7 insertions, 7 deletions
diff --git a/exwm-systemtray.el b/exwm-systemtray.el
index e9a974531686..861304ab7c4e 100644
--- a/exwm-systemtray.el
+++ b/exwm-systemtray.el
@@ -43,9 +43,7 @@
 ;; GTK icons require at least 16 pixels to show normally.
 (defconst exwm-systemtray--icon-min-size 16 "Minimum icon size.")
 
-(defvar exwm-systemtray-height (max exwm-systemtray--icon-min-size
-                                    (line-pixel-height))
-  "System tray height.
+(defvar exwm-systemtray-height nil "System tray height.
 
 You shall use the default value if using auto-hide minibuffer.")
 
@@ -258,12 +256,11 @@ You shall use the default value if using auto-hide minibuffer.")
               (t
                (exwm--log "(System Tray) Unknown opcode message: %s" obj)))))))
 
-(defvar exwm-workspace-minibuffer-position)
 (defvar exwm-workspace--current)
 
 (defun exwm-systemtray--on-workspace-switch ()
   "Reparent/Refresh the system tray in `exwm-workspace-switch-hook'."
-  (unless exwm-workspace-minibuffer-position
+  (unless (exwm-workspace--minibuffer-own-frame-p)
     (xcb:+request exwm-systemtray--connection
         (make-instance 'xcb:ReparentWindow
                        :window exwm-systemtray--embedder
@@ -277,7 +274,7 @@ You shall use the default value if using auto-hide minibuffer.")
 
 (defun exwm-systemtray--on-randr-refresh ()
   "Reposition/Refresh the system tray in `exwm-randr-refresh-hook'."
-  (unless exwm-workspace-minibuffer-position
+  (unless (exwm-workspace--minibuffer-own-frame-p)
     (xcb:+request exwm-systemtray--connection
         (make-instance 'xcb:ConfigureWindow
                        :window exwm-systemtray--embedder
@@ -295,6 +292,9 @@ You shall use the default value if using auto-hide minibuffer.")
   (cl-assert (not exwm-systemtray--list))
   (cl-assert (not exwm-systemtray--selection-owner-window))
   (cl-assert (not exwm-systemtray--embedder))
+  (unless exwm-systemtray-height
+    (setq exwm-systemtray-height (max exwm-systemtray--icon-min-size
+                                      (line-pixel-height))))
   ;; Create a new connection.
   (setq exwm-systemtray--connection (xcb:connect-to-socket))
   (set-process-query-on-exit-flag (slot-value exwm-systemtray--connection
@@ -345,7 +345,7 @@ You shall use the default value if using auto-hide minibuffer.")
                        :border-width 0 :class xcb:WindowClass:CopyFromParent
                        :visual 0 :value-mask xcb:CW:EventMask
                        :event-mask xcb:EventMask:SubstructureNotify))
-    (if exwm-workspace-minibuffer-position
+    (if (exwm-workspace--minibuffer-own-frame-p)
         (setq parent (frame-parameter exwm-workspace--minibuffer
                                       'exwm-container)
               ;; Vertically centered.