Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix app shortcuts in fullscreen #70

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions exwm-core.el
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ If CONN is non-nil, use it instead of the value of the variable
One of `line-mode' or `char-mode'.")
(defvar-local exwm--input-mode 'line-mode
"Actual input mode, i.e. whether mouse and keyboard are grabbed.")
(defvar-local exwm--fullscreen-previous-configuration nil
"Stores window configuration to restore when unsetting fullscreen.")
;; Properties
(defvar-local exwm--desktop nil "_NET_WM_DESKTOP.")
(defvar-local exwm-window-type nil "_NET_WM_WINDOW_TYPE.")
Expand Down
18 changes: 13 additions & 5 deletions exwm-layout.el
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,14 @@ See variable `exwm-layout-auto-iconify'."
:stack-mode xcb:StackMode:Above))
(cl-pushnew xcb:Atom:_NET_WM_STATE_FULLSCREEN exwm--ewmh-state)
(exwm-layout--set-ewmh-state exwm--id)
(unless exwm--floating-frame
;; Store window configuration and leave the window of the buffer's window
;; as the sole window. This makes commands such as `other-window` more
;; intuitive.
(setq exwm--fullscreen-previous-configuration (current-window-configuration))
(delete-other-windows))
(xcb:flush exwm--connection)
(set-window-dedicated-p (get-buffer-window) t)
(exwm-input--release-keyboard exwm--id)))
(set-window-dedicated-p (get-buffer-window) t)))

;;;###autoload
(cl-defun exwm-layout-unset-fullscreen (&optional id)
Expand All @@ -229,6 +234,11 @@ See variable `exwm-layout-auto-iconify'."
(exwm-layout--set-ewmh-state exwm--id)
(if exwm--floating-frame
(exwm-layout--show exwm--id (frame-root-window exwm--floating-frame))
(when exwm--fullscreen-previous-configuration
;; Restore the window configuration as it was before switching to
;; fullscreen.
(set-window-configuration exwm--fullscreen-previous-configuration)
(setq exwm--fullscreen-previous-configuration nil))
(xcb:+request exwm--connection
(make-instance 'xcb:ConfigureWindow
:window exwm--id
Expand All @@ -240,9 +250,7 @@ See variable `exwm-layout-auto-iconify'."
(when window
(exwm-layout--show exwm--id window))))
(xcb:flush exwm--connection)
(set-window-dedicated-p (get-buffer-window) nil)
(when (eq 'line-mode exwm--selected-input-mode)
(exwm-input--grab-keyboard exwm--id))))
(set-window-dedicated-p (get-buffer-window) nil)))

;;;###autoload
(defun exwm-layout-toggle-fullscreen (&optional id)
Expand Down