From 55cec760ca3cee21e735bff9a9a5229b222b97ff Mon Sep 17 00:00:00 2001 From: Chris Feng Date: Sun, 21 Feb 2016 20:19:45 +0800 Subject: 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. --- exwm-systemtray.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'exwm-systemtray.el') 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. -- cgit 1.4.1