From 4ac71a7ddc78d1485a7fca7a8dbf4c4f6b4016f2 Mon Sep 17 00:00:00 2001 From: Chris Feng Date: Sat, 16 Jul 2016 14:34:57 +0800 Subject: 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. --- exwm-layout.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'exwm-layout.el') diff --git a/exwm-layout.el b/exwm-layout.el index b79e42e641ca..85e186f60936 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 -- cgit 1.4.1