Recover the difference between the input mode selected by the user and
actual one, which might be transient. This was inadvertently removed in
recent changes.
* exwm-core.el (exwm--selected-input-mode): New variable.
* exwm-input.el (exwm-input-grab-keyboard)
(exwm-input-release-keyboard): Use it.
* exwm-layout.el (exwm-layout-unset-fullscreen): Return to the
selected input mode.
* exwm-workspace.el (exwm-workspace-switch): On startup EXWM switches
to workspace 0 by force so the rest code can not assume the frames
before and after a switch different.
* exwm-input.el (exwm-input--event-passthrough-p): Predicate
checking whether an event should be forwarded to Emacs.
(exwm-input--on-KeyPress-line-mode): Use it.
* exwm-input.el (exwm-input--cache-event): Protect against
translations swallow the event.
* exwm-input.el (exwm-input--on-ButtonPress-line-mode)
(exwm-input--on-ButtonPress-char-mode): New functions.
(exwm-input--on-ButtonPress): Forward bound mouse events to Emacs
when in line-mode.
* exwm-input.el (exwm-input--update-focus): Focus the minibuffer's
frame, which is different than that of the
`minibuffer-selected-window' on minibuffer-only frames.
(exwm-input--on-minibuffer-setup, exwm-input--init)
(exwm-input-exit): Remove unneeded function.
No functional change.
* exwm-input.el (exwm-input--current-input-mode): New function
indicating keyboard input mode.
(exwm-input--on-KeyPress, exwm-input--update-mode-line): Use
`exwm-input--current-input-mode'.
(exwm-input-grab-keyboard, exwm-input-release-keyboard)
(exwm-input--update-mode-line): Simplify.
* exwh-core.el (exwm--on-KeyPress): Remove variable, use
`exwm--keyboard-grabbed' and `exwm-input--current-input-mode'
instead.
* exwm-core.el (exwm-debug): New global minor mode to replace
`exwm-debug-on' and `exwm-debug-toggle'.
* exwm-manage.el (exwm-manage--get-configurations): Use
lexical-scoping `eval'.
* exwm-manage.el (exwm-manage--on-MapNotify, exwm-manage--init):
Restack X windows after being mapped in order to ensure they receive
an EnterNotify event (does not happen under XQuartz).
* exwm-workspace.el (exwm-workspace--set-active): Refresh layout
after activating or deactivating workspaces.
* exwm-layout.el (exwm-layout--refresh-workspace): Hide X windows on
inactive workspaces.
* exwm.el (exwm--init-icccm-ewmh): Avoid naming the root window.
(exwm--wmsn-acquire): Use the symbol name in the window name.
* exwm-systemtray.el (exwm-systemtray--embedder-window): Rename
`exwm-systemtray--embedder' consistency.
(exwm-systemtray--init): Use symbol names in the window name.
* exwm-layout.el (exwm-layout--refresh): Split in three functions
for clarity.
(exwm-layout--refresh-workspace, exwm-layout--refresh-other)
(exwm-layout--refresh-floating): New functions.
Using `message' to log debugging information is cumbersome, as the output
appears constantly in the minibuffer, obscuring prompts and other information.
In the case of long messages, it might resize the minibuffer, which causes EXWM
to perform additional actions due to the log output.
This change reimplements EXWM debug logging using a separate
buffer (*EXWM-DEBUG*). Basic functionality, like scrolling when point is at the
end of the buffer is maintained.
* exwm-core.el (exwm--log): Use `exwm-debug--message' instead of
`message'. Prefix all messages with the name of the function.
Make FORMAT-STRING argument optional.
* exwm-debug.el: New file.
(exwm-debug-buffer): New variable holding the buffer where debug
messages are output to.
(exwm-debug--message): New function printing a message to
`exwm-debug-buffer'.
(exwm-debug--backtrace): New function printing a backtrace.
* exwm-manage.el (exwm-manage--unmanage-window): Set the Emacs window
of an full screen X window as non-dedicated before killing its buffer
so as not to cause other side effects.
* exwm-manage.el (exwm-manage--on-ConfigureRequest): There's a problem
in shrinking Emacs frames with `set-frame-width' and
`set-frame-height'. Use `exwm--set-geometry' instead.
; A change has been made in Xorg server 1.20 that replaying a key
; event with keyboard grabbed would generate extra focus change and
; enter/leave events. This basically breaks line-mode for apps like
; Firefox. This commit reimplements the grab & replay functionality
; with XI2 and XTEST.
* exwm-input.el (exwm-input--devices): New variable for caching slave
keyboards.
(exwm-input--update-devices): Update it and re-grab keys if necessary.
(exwm-input--on-Hierarchy): Event listener for the Hierarchy event
that would in turn call `exwm-input--update-devices' to update the
cache.
* exwm-input.el (exwm-input--on-KeyPress): Use XI2 KeyPress events.
(exwm-input--on-KeyRelease): Event listener for the KeyRelease events.
(exwm-input--grab-global-prefix-keys): Use XI2 and also select
KeyRelease events.
(exwm-input--on-KeyPress-line-mode): Use XI2 KeyPress events and
replay key events with XTEST.
(exwm-input--on-KeyPress-char-mode, exwm-input--grab-keyboard)
(exwm-input--release-keyboard): Use XI2 KeyPress events.
* exwm-input.el (exwm-input--init): Initialize the XI2 and XTEST
extensions; add listeners for XI2 KeyPress, KeyRelease and Hierarchy
events.
* exwm-systemtray.el (exwm-systemtray--on-workspace-switch)
(exwm-systemtray--on-randr-refresh): Take menu-bar / tool-bar into
account when placing systemtray.
* exwm-layout.el (exwm-layout-set-fullscreen)
(exwm-layout-unset-fullscreen): Set the Emacs window of a full screen
X window dedicated to its buffer such that newly created X windows
won't replace it.