diff options
author | Chris Feng <chris.w.feng@gmail.com> | 2016-07-15T12·04+0800 |
---|---|---|
committer | Chris Feng <chris.w.feng@gmail.com> | 2016-07-15T12·04+0800 |
commit | 7f12d9fc7a88369a479ed2f0489ff3b10b347d13 (patch) | |
tree | 9e2da5e00adeaa8117dd8e832a521fc78440e4c0 /exwm-layout.el | |
parent | 0b8a373e4fd092b527b34070b6556be35983062c (diff) |
Add multi-dock support and fix fullscreen issues with dock
* exwm.el (exwm--update-strut-legacy, exwm--update-strut-partial) (exwm--update-strut): Rename (strut => struts). * exwm-manage.el (exwm-manage--manage-window): Listen for UnmapNotify/DestroyNotify events of docks to stop tracking them. (exwm-manage--unmanage-window): Remove dock from tracking list when it's unmapped/destroyed. * exwm-workspace.el (exwm-workspace--id-struts-alist): New variable for tracking docks. (exwm-workspace--struts): Now it stores merged struts. (exwm-workspace--update-struts): New function for doing the 'merge'. * exwm.el (exwm--update-struts-legacy, exwm--update-struts-partial): Now update struts for multiple docks. * exwm-layout.el (exwm-layout-set-fullscreen) (exwm-layout-unset-fullscreen): * exwm-manage.el (exwm-manage--unmanage-window): Fix fullscreen mode with dock. * exwm-workspace.el (exwm-workspace--set-fullscreen): Add optional arguments for ignoring struts / resizing container only. (exwm-workspace-switch): Restack workspace/docks appropriately.
Diffstat (limited to 'exwm-layout.el')
-rw-r--r-- | exwm-layout.el | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/exwm-layout.el b/exwm-layout.el index 259788f66c26..b79e42e641ca 100644 --- a/exwm-layout.el +++ b/exwm-layout.el @@ -155,6 +155,9 @@ (defvar exwm-workspace--current) (defvar exwm-workspace--list) +(declare-function exwm-workspace--set-fullscreen "exwm-workspace.el" + (frame &optional no-struts container-only)) + ;;;###autoload (defun exwm-layout-set-fullscreen (&optional id) "Make window ID fullscreen." @@ -169,9 +172,25 @@ :drawable exwm--container)))) (setq exwm--floating-frame-position (vector (slot-value geometry 'x) (slot-value geometry 'y))))) - (exwm-layout--resize-container exwm--id exwm--container 0 0 + ;; Expand the workspace frame & its container to fill the whole screen. + (exwm-workspace--set-fullscreen exwm--frame t t) + ;; Raise the workspace container (in case there are docks). + (xcb:+request exwm--connection + (make-instance 'xcb:ConfigureWindow + :window (frame-parameter exwm--frame 'exwm-workspace) + :value-mask xcb:ConfigWindow:StackMode + :stack-mode xcb:StackMode:Above)) + ;; Expand the X window and its container to fill the whole screen. + ;; Rationale: Floating X windows may not be positioned at (0, 0) + ;; due to the extra border. + (exwm-layout--resize-container nil exwm--container 0 0 + (exwm-workspace--current-width) + (exwm-workspace--current-height) + t) + (exwm-layout--resize-container nil exwm--id 0 0 (exwm-workspace--current-width) - (exwm-workspace--current-height)) + (exwm-workspace--current-height) + t) ;; Raise the X window. (xcb:+request exwm--connection (make-instance 'xcb:ConfigureWindow @@ -193,6 +212,8 @@ (with-current-buffer (if id (exwm--id->buffer id) (window-buffer)) (unless exwm--fullscreen (user-error "Not in full-screen mode.")) + ;; Restore the size of this workspace. + (exwm-workspace--set-fullscreen exwm--frame) (if exwm--floating-frame ;; Restore the floating frame. (xcb:+request exwm--connection |