This commit add workspace and X window containers support to avoid using
Emacs frames as the parents of X windows. This should make it easier to
set input focus.
* exwm-core.el (exwm--container, exwm--floating-frame-position): New file
local variables.
(exwm--floating-frame-geometry): Removed file local variable.
* exwm-floating.el (exwm-floating--set-floating)
(exwm-floating--unset-floating, exwm-floating--do-moveresize)
(exwm-floating-move): Use container.
(exwm-floating--fit-frame-to-window): No longer adjust stacking order.
(exwm-floating--fit-frame-to-window): The first member is changed to
buffer.
(exwm-floating--start-moveresize): Use container. Correctly set input
focus.
* exwm-input.el (exwm-input--redirected, exwm-input--on-focus-in): Removed.
(exwm-input--on-buffer-list-update): Remove the restriction on floating
frames which is no longer valid.
(exwm-input--update-focus): Adjust stacking order.
(exwm-input--on-minibuffer-setup): New function for setting focus on the
Emacs frame when entering minibuffer.
(exwm-input--on-KeyPress-line-mode): No longer compensate FocusOut event.
(exwm-input--grab-keyboard, exwm-input--release-keyboard): Local keys are
now grabbed on the X window container.
(exwm-input--init): Add `exwm-input--on-minibuffer-setup' to
`minibuffer-setup-hook'.
* exwm-layout.el (exwm-layout--resize-container): New function to
resize/reposition both the X window and its container.
(exwm-layout--show, exwm-layout--hide): Use container.
(exwm-layout-set-fullscreen): Use container. No longer save width and
height.
(exwm-layout-unset-fullscreen, exwm-layout--set-frame-fullscreen): Use
container.
(exwm-layout--refresh): Update a frame parameter. Remove dead code.
* exwm-manage.el (exwm-manage--manage-window): Reparent unmanaged X windows
to the workspace. Create X window container as the parent of the X window.
(exwm-manage--unmanage-window): Unmap/destroy container when appropriate.
Use the position of container.
(exwm-manage--unmanage-window): Destroy the container.
* exwm-randr.el (exwm-randr--refresh): Resize workspace using container.
* exwm-workspace.el (exwm-workspace-switch): Raise workspace.
Correctly set input focus.
(exwm-workspace--on-focus-in): Removed.
(exwm-workspace-move-window): Reparent to workspace container.
(exwm-workspace--init): Create workspace frames as visible.
Create workspace containers.
Remove exwm-workspace--on-focus-in from focus-in-hook.
Update _NET_VIRTUAL_ROOTS.
* exwm.el (exwm-init): No longer disable hourglass window.
Initialize workspace module before input.
* exwm-core.el (exwm--debug): New macro for setting debug forms.
* exwm-floating.el (exwm-floating--set-floating): No longer do `exwm--lock'
and `exwm--unlock' since `make-frame' is already adviced to take care of
everything. Correctly set input focus to the newly created floating
X window.
* exwm-core.el (exwm--floating-edges): Removed file local variable.
* exwm-floating.el (exwm-floating--set-floating)
(exwm-floating--unset-floating):
* exwm-layout.el (exwm-layout--show, exwm-layout-enlarge-window):
* exwm-manage.el (exwm-manage--on-ConfigureRequest):
No longer use floating geometry.
* exwm-input.el (exwm-input--update-global-prefix-keys): Grab global keys
on workspaces containers instead of the root window (or input focus would
transfer to the workspace containing the pointer when the grab is active).
* exwm-workspace.el (exwm-workspace-switch): No longer move mouse.
* exwm-input.el (exwm-input--on-MappingNotify, exwm-input--init): Remove
the event listener for MappingNotify event (it should be handled in the
underling library instead).
* exwm-core.el (exwm-mode): Use the return value of
exwm-manage--close-window.
* exwm-manage.el (exwm-manage--close-window): Kill empty buffers; Handle X
windows that does not support _NET_WM_PING.
(exwm-manage--kill-client): Kill X windows supporting _NET_WM_PID with
both SIGKILL and KillClient.
* exwm-floating.el (exwm-floating--set-floating): Reparent floating frames
as late as possible.
* exwm-manage.el (exwm-manage--unmanage-window): Hide floating frames first
on unmanagement.
* exwm-workspace.el (exwm-workspace-switch, exwm-workspace--on-focus-in):
Delay closing minibuffer until Emacs is idle. This prevent nonlocal exits
from interrupting remaining code.
* exwm-workspace.el (exwm-workspace-switch, exwm-workspace--on-focus-in):
Use handle-switch-frame instead of exwm-workspace--switch-count to filter
out events.
* exwm-workspace.el (exwm-workspace--init): Delay making workspaces
fullscreen.
* exwm-workspace.el (exwm-workspace-move-window):
* exwm-floating.el (exwm-floating--set-floating):
* exwm-layout.el (exwm-layout--refresh):
`set-buffer-major-mode` does not accept buffer names.
* exwm-core.el (exwm--make-emacs-idle-for): Removed.
* exwm-workspace.el (exwm-workspace--switch-count): New variable.
(exwm-workspace-switch): Increase exwm-workspace--switch-count when
necessary; Remove the call to exwm--make-emacs-idle-for.
(exwm-workspace--on-focus-in): Consume exwm-workspace--switch-count.
* exwm-workspace.el (exwm-workspace--on-focus-in): Close active minibuffer.
* exwm-workspace.el (exwm-workspace-switch): An active minibuffer on another
workspace might cause problems for input. Closing it should be
sufficient.
* exwm-input.el (exwm-input-command-whitelist): New variable.
(exwm-input--on-KeyPress-line-mode): Allow certain commands which receive
inputs without using the minibuffer to work in line-mode.
* exwm-manage.el (exwm-manage--manage-window): Restrict the check of
_MOTIF_WM_HINTS to only Java applications (since some other applications
like Evince would also set it).
Some subrs (e.g. x-file-dialog) create X windows and block the execution of
EXWM, so they won't work normally. This commit partly fixes this issue by
invoking them in a subordinate Emacs instance and trying to fetch the
result back.
* exwm.el (exwm-blocking-subrs): New variable for specify such subrs.
* exwm.el (exwm-enable, exwm--server-name, exwm--server-stop)
(exwm--server-eval-at): The implementation.
* exwm-core.el:
* exwm-floating.el:
* exwm-layout.el:
* exwm-manage.el:
* exwm-randr.el:
Evaluate constants at compile-time.
* README.md: Renamed from README.org to make the 'Commentary:' section
used by GNU ELPA instead.
* exwm.el: Depends on XELB version 0.3.
* exwm-input.el (exwm-input--on-KeyPress-line-mode, exwm-input-prefix-keys):
Allow users to disable 'C-c' prefixed keys; Add 'C-c' to / remove 'M-!'
from the default prefix keys.
* exwm-workspace.el (exwm-workspace--x-create-frame, exwm-workspace--init):
Advice `x-create-frame' to prevent it from hanging EXWM, making e.g.
speedbar working.
* exwm-floating.el (exwm-floating--set-floating): Remove the now unnecessary
request that sets override-redirect on floating frames.
* exwm-manage.el (exwm-manage--manage-window): Only grab left/middle/right
buttons.
* exwm-input.el (exwm-input--on-ButtonPress): Only perform click-to-focus on
unfocused X windows.
* exwm-input.el (exwm-input--update-focus): Do not focus an X window on
another workspace, but instead keep focusing on the current one and set
exwm--urgency parameter on that frame.
* exwm-input.el (exwm-input--fake-key): Send KeyRelease event (some
applications reply on it).
* exwm-core.el: New buffer-local variable exwm--mwm-hints.
* exwm-manage.el: New variable exwm--atom-_MOTIF_WM_HINTS for holding the
value of _MOTIF_WM_HINTS atom; new function exwm--update-mwm-hints for
updating the _MOTIF_WM_HINTS property of an X window.
* exwm-manage.el (exwm-manage--init): Intern the _MOTIF_WM_HINTS atom.
* exwm-manage.el (exwm-manage--manage-window): Avoid managing windows
without decoration (implied by _MOTIF_WM_HINTS).
* exwm-input.el (exwm-input--on-KeyPress-char-mode): Compensate FocusOut
event by sending a synthetic FocusIn event to prevent the change of cursor
style (e.g. box to hollow) when pointer is in an X window.
* exwm-floating.el (exwm-floating--set-floating): Set exwm--floating-edges
as absolute edges (the relative edges can be easily determined).
* exwm-layout.el (exwm-layout--show): Send correct absolute positions to
floating X windows.
* exwm-floating.el (exwm-floating--stop-moveresize, exwm-floating-move): Send
ConfigureNotify events after moving floating X windows.
to its buffer
* exwm-workspace.el (exwm-workspace-show-all-buffers, exwm-workspace-switch)
(exwm-workspace-move-window, exwm-workspace-switch-to-buffer): Show buffers
on other workspaces if `exwm-workspace-show-all-buffers' is non-nil.
* exwm-layout.el (exwm-layout-show-all-buffers, exwm-layout--refresh): Allow
moving an X window by switch to its corresponding buffer from another
workspace when `exwm-layout-show-all-buffers' is non-nil.
* exwm.el (exwm--ido-buffer-window-other-frame): Handle the case when
`exwm-layout-show-all-buffers' is non-nil.
* exwm-floating.el (exwm-floating--set-floating): Handle the case when
*scratch* buffer is killed.
* exwm-workspace.el (exwm-workspace-switch-to-buffer): Renamed from
`exwm-workspace-switch-to-window' to better reflect its role.
* exwm-floating.el: Remove an invalid TODO item.
* exwm-floating.el (exwm-floating--set-floating)
(exwm-floating-hide-mode-line, exwm-floating-show-mode-line): Set
window-size-fixed only for fixed-size floating windows.
* exwm-floating.el (exwm-floating-move): New function for moving a floating
window.
* exwm-layout.el (exwm-layout-enlarge-window)
(exwm-layout-enlarge-window-horizontally, exwm-layout-shrink-window)
(exwm-layout-shrink-window-horizontally): New commands for interactively
resizing a floating window.
* exwm-workspace.el (exwm-workspace-move-window): Hide buffer on the original
Emacs window when moving an X window to the current workspace.
* exwm-workspace.el: New function exwm-workspace-switch-to-window for
interactively moving an X window on another workspace to the current one.
The _NET_CLIENT_LIST_STACKING EWMH property is essential for e.g. the tabbar of
chromium to work correctly.
* exwm-input.el: Remove invalid TODO item.
* exwm.el (exwm--init-icccm-ewmh): Add xcb:Atom:_NET_CLIENT_LIST and
xcb:Atom:_NET_CLIENT_LIST_STACKING to _NET_SUPPORTED.
* exwm-layout.el (exwm-layout--refresh): Update _NET_CLIENT_LIST_STACKING.
* exwm-manage.el (exwm-manage--manage-window, exwm-manage--unmanage-window):
Update _NET_CLIENT_LIST.
* exwm-core.el: new buffer-local variable exwm--floating-mode-line-format for
saving mode-line-format when mode-line is hidden
* exwm-floating.el (exwm-floating--fit-frame-to-window)
(exwm-floating-hide-mode-line, exwm-floating-show-mode-line): new functions
for resizing frames, hiding/showing mode-line respectively;
(exwm-floating--set-floating): use exwm-floating--fit-frame-to-window to
resize frames