about summary refs log tree commit diff
path: root/exwm-layout.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2016-02-19T09·12+0800
committerChris Feng <chris.w.feng@gmail.com>2016-02-19T09·12+0800
commitfc589b899b71e88e48931de41ea1df760f9c1edd (patch)
treedbe6814fba5e46262b1809d8331f39220ed47c52 /exwm-layout.el
parentbfd43feb494a8a7675f3a882ea5ebeaa91fb3f82 (diff)
Fix system tray issues after updating workspaces
* exwm-workspace.el (exwm-workspace-switch-hook): New hook run by
`exwm-workspace-switch'.
* exwm-randr.el (exwm-randr-refresh-hook): New hook run by
`exwm-randr--refresh'.
* exwm-systemtray.el (exwm-systemtray--on-randr-refresh)
(exwm-systemtray--on-workspace-switch, exwm-systemtray--init): Update the
system tray in `exwm-randr-refresh-hook' and `exwm-workspace-switch-hook'.

* exwm-layout.el (exwm-layout--set-frame-fullscreen):
* exwm-workspace.el (exwm-workspace--post-init): Wait until all workspace
frames are set fullscreen.

* exwm-workspace.el (exwm-workspace--current-width)
(exwm-workspace--current-height): New functions for retrieving the width
and height of the current workspace.
* exwm-layout.el (exwm-layout-set-fullscreen):
* exwm-manage.el (exwm-manage--manage-window)
(exwm-manage--on-ConfigureRequest):
* exwm-systemtray.el (exwm-systemtray--refresh, exwm-systemtray--init):
* exwm-workspace.le (exwm-workspace--resize-minibuffer-frame)
(exwm-workspace--on-ConfigureNotify): Switch to
`exwm-workspace--current-width' and `exwm-workspace--current-height'.

* exwm-core.el:
* exwm-floating.el:
* exwm-floating.el:
* exwm-input.el:
* exwm-layout.el:
* exwm-manage.el:
* exwm-randr.el:
* exwm-systemtray.el:
* exwm-workspace.el:
* exwm.el:
Clean up loading file.  Set/Unset some functions as commands.

* README.md: Add intro to system tray.
Diffstat (limited to 'exwm-layout.el')
-rw-r--r--exwm-layout.el24
1 files changed, 17 insertions, 7 deletions
diff --git a/exwm-layout.el b/exwm-layout.el
index 52a84b0fe1fd..c0f3c6147289 100644
--- a/exwm-layout.el
+++ b/exwm-layout.el
@@ -26,7 +26,6 @@
 ;;; Code:
 
 (require 'exwm-core)
-(eval-when-compile (require 'exwm-workspace))
 
 (defvar exwm-floating-border-width)
 
@@ -51,7 +50,6 @@
                                              xcb:ConfigWindow:Height))
                        :width width :height height))))
 
-;;;###autoload
 (defun exwm-layout--show (id &optional window)
   "Show window ID exactly fit in the Emacs window WINDOW."
   (exwm--log "Show #x%x in %s" id window)
@@ -112,7 +110,6 @@
                                exwm--connection))))
   (xcb:flush exwm--connection))
 
-;;;###autoload
 (defun exwm-layout--hide (id)
   "Hide window ID."
   (unless (eq xcb:icccm:WM_STATE:IconicState ;already hidden
@@ -137,6 +134,9 @@
                        :icon xcb:Window:None))
     (xcb:flush exwm--connection)))
 
+(defvar exwm-workspace--current)
+(defvar exwm-workspace--list)
+
 ;;;###autoload
 (defun exwm-layout-set-fullscreen (&optional id)
   "Make window ID fullscreen."
@@ -153,9 +153,8 @@
               (vector (slot-value geometry 'x) (slot-value geometry 'y))))
       (xcb:flush exwm--connection))
     (exwm-layout--resize-container exwm--id exwm--container 0 0
-                                   (frame-pixel-width exwm-workspace--current)
-                                   (frame-pixel-height
-                                    exwm-workspace--current))
+                                   (exwm-workspace--current-width)
+                                   (exwm-workspace--current-height))
     (xcb:+request exwm--connection
         (make-instance 'xcb:ewmh:set-_NET_WM_STATE
                        :window exwm--id
@@ -164,6 +163,7 @@
     (setq exwm--fullscreen t)
     (exwm-input-release-keyboard)))
 
+;;;###autoload
 (defun exwm-layout-unset-fullscreen (&optional id)
   "Restore window from fullscreen state."
   (interactive)
@@ -187,6 +187,9 @@
     (setq exwm--fullscreen nil)
     (exwm-input-grab-keyboard)))
 
+(defvar exwm-layout--fullscreen-frame-count 0
+  "Count the fullscreen workspace frames.")
+
 ;; This function is superficially similar to `exwm-layout-set-fullscreen', but
 ;; they do very different things: `exwm-layout--set-frame-fullscreen' resizes a
 ;; frame to the actual monitor size, `exwm-layout-set-fullscreen' resizes an X
@@ -207,7 +210,8 @@
                  (exwm-workspace--minibuffer-own-frame-p))
         (exwm-workspace--resize-minibuffer-frame width height))
       (exwm-layout--resize-container id workspace x y width height)
-      (xcb:flush exwm--connection))))
+      (xcb:flush exwm--connection)))
+  (cl-incf exwm-layout--fullscreen-frame-count))
 
 (defvar exwm-layout-show-all-buffers nil
   "Non-nil to allow switching to buffers on other workspaces.")
@@ -297,6 +301,7 @@
         (exwm-layout--refresh)
       (run-with-idle-timer 0.01 nil #'exwm-layout--refresh)))) ;FIXME
 
+;;;###autoload
 (defun exwm-layout-enlarge-window (delta &optional horizontal)
   "Make the selected window DELTA pixels taller.
 
@@ -371,6 +376,7 @@ windows."
                            :height height))
         (xcb:flush exwm--connection))))))
 
+;;;###autoload
 (defun exwm-layout-enlarge-window-horizontally (delta)
   "Make the selected window DELTA pixels wider.
 
@@ -378,6 +384,7 @@ See also `exwm-layout-enlarge-window'."
   (interactive "p")
   (exwm-layout-enlarge-window delta t))
 
+;;;###autoload
 (defun exwm-layout-shrink-window (delta)
   "Make the selected window DELTA pixels lower.
 
@@ -385,6 +392,7 @@ See also `exwm-layout-enlarge-window'."
   (interactive "p")
   (exwm-layout-enlarge-window (- delta)))
 
+;;;###autoload
 (defun exwm-layout-shrink-window-horizontally (delta)
   "Make the selected window DELTA pixels narrower.
 
@@ -392,6 +400,7 @@ See also `exwm-layout-enlarge-window'."
   (interactive "p")
   (exwm-layout-enlarge-window (- delta) t))
 
+;;;###autoload
 (defun exwm-layout-hide-mode-line ()
   "Hide mode-line."
   (interactive)
@@ -409,6 +418,7 @@ See also `exwm-layout-enlarge-window'."
                              mode-line-height)
                           nil t)))))
 
+;;;###autoload
 (defun exwm-layout-show-mode-line ()
   "Show mode-line."
   (interactive)