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-07-16T06·34+0800
committerChris Feng <chris.w.feng@gmail.com>2016-07-16T06·34+0800
commit4ac71a7ddc78d1485a7fca7a8dbf4c4f6b4016f2 (patch)
treee3b9ff8f06ef87f3eb81314fd765df2c04c9619d /exwm-layout.el
parent7f12d9fc7a88369a479ed2f0489ff3b10b347d13 (diff)
Add RandR support for docks and reuse workareas
* exwm-workspace (exwm-workspace--update-struts): Add RandR support for
docks.

* exwm-workspace (exwm-workspace--workareas): New variable for storing
workareas.
(exwm-workspace--update-workareas): Update workareas and set
_NET_WORKAREA (replaces `exwm-workspace--set-workareas').
(exwm-workspace--set-fullscreen): Reuse workareas for
resizing and drop optional arguments.
(exwm-workspace--resize-minibuffer-frame)
(exwm-workspace--on-ConfigureNotify): Reuse workareas for
resizing/reposition the (optional) dedicated minibuffer frame.

* exwm-layout.el (exwm-layout-set-fullscreen): Do not use
`exwm-workspace--set-fullscreen' here.

* exwm-manage.el (exwm-manage--unmanage-window):
* exwm-randr.el (exwm-randr--refresh):
* exwm.el (exwm--update-struts-legacy, exwm--update-struts-partial):
Update workareas before resizing workspaces.

* exwm.el (exwm--update-struts-legacy, exwm--update-struts-partial):
Remove the corresponding record on receiving invalid struts.

* exwm-workspace.el (exwm-workspace--get-geometry): New utility
function for retrieving workspace geometry.
Diffstat (limited to 'exwm-layout.el')
-rw-r--r--exwm-layout.el14
1 files changed, 9 insertions, 5 deletions
diff --git a/exwm-layout.el b/exwm-layout.el
index b79e42e641..85e186f609 100644
--- a/exwm-layout.el
+++ b/exwm-layout.el
@@ -155,8 +155,7 @@
 (defvar exwm-workspace--current)
 (defvar exwm-workspace--list)
 
-(declare-function exwm-workspace--set-fullscreen "exwm-workspace.el"
-                  (frame &optional no-struts container-only))
+(declare-function exwm-workspace--set-fullscreen "exwm-workspace.el" (frame))
 
 ;;;###autoload
 (defun exwm-layout-set-fullscreen (&optional id)
@@ -165,15 +164,20 @@
   (with-current-buffer (if id (exwm--id->buffer id) (window-buffer))
     (when exwm--fullscreen
       (user-error "Already in full-screen mode."))
-    ;; Set the floating frame fullscreen first when the client is floating
+    ;; Save the position of floating frame.
     (when exwm--floating-frame
       (let* ((geometry (xcb:+request-unchecked+reply exwm--connection
                            (make-instance 'xcb:GetGeometry
                                           :drawable exwm--container))))
         (setq exwm--floating-frame-position
               (vector (slot-value geometry 'x) (slot-value geometry 'y)))))
-    ;; Expand the workspace frame & its container to fill the whole screen.
-    (exwm-workspace--set-fullscreen exwm--frame t t)
+    ;; Expand the workspace to fill the whole screen.
+    (with-slots (x y width height) (exwm-workspace--get-geometry exwm--frame)
+      (exwm-layout--resize-container nil
+                                     (frame-parameter exwm--frame
+                                                      'exwm-workspace)
+                                     x y width height
+                                     t))
     ;; Raise the workspace container (in case there are docks).
     (xcb:+request exwm--connection
         (make-instance 'xcb:ConfigureWindow