* exwm-systemtray.el (exwm-systemtray--refresh-background-color):
Add optional parameter REMAP to force redrawing of the background.
(exwm-systemtray--on-theme-change): Use it.
* exwm-systemtray.el (exwm-systemtray-background-color): Add
support for using current workspace's background color as system
tray background color.
(exwm-systemtray--refresh-background-color): New function to set
the background color upon theme changes or workspace switches.
(exwm-systemtray--on-workspace-switch)
(exwm-systemtray--on-theme-change): Use it.
(exwm-systemtray--init): React to theme changes.
We were using the Emacs' frame's depth, but not the visual nor colormap.
This failed with Emacs 29 and its support for 32-bit depths.
We now use the default screen's visual: using a non-default visual in
the system tray requires support for embedding icons with different
visuals, which is not implemented. We restrict our limited transparency
support to Emacs frames with depth equal to the default visual's detph.
* exwm-core.el (exwm--get-visual-depth-colormap): New function.
* exwm-systemtray.el (exwm-systemtray--init): Use root window's
visual, depth and colormap. Reset all attributes that refer
(perhaps due to defaults) to the parent window, as it might have a
different visual, depth or colormap.
(exwm-systemtray--init): Set _NET_SYSTEM_TRAY_VISUAL.
(exwm-systemtray-background-color): Emit a warning when
transparency is selected but not supported.
(exwm-systemtray--set-background-color): New function to set
embedder window background.
(exwm-systemtray--embedder-window-depth): Add variable.
(exwm-systemtray--transparency-supported-p): New function to check
whether transparency is supported.
* exwm.el (exwm--on-ClientMessage): Take care of focusing
workspace frames when a _NET_ACTIVE_WINDOW message is received for
a workspace frame. This is responsibility of the window manager
when it advertises _NET_ACTIVE_WINDOW support, which we do.
Emacs versions before 29 took care of setting the input focus to
the frame.
Thanks-to: Po Lu for the work on Emacs and assistance with this
issue.
* exwm-core.el (exwm--get-visual-depth-colormap): New function.
* exwm-workspace.el (exwm-workspace--add-frame-as-workspace): Use
Emacs' frame's visual, depth and colormap. Reset all attributes
that refer (also by default) to the parent window (the root
window), as it might have a different visual, depth or colormap.
Special-thanks-to: Elijah Malaby <qwe12345678910@gmail.com> for figuring out the
changes needed to suport 32-bit visuals and proposing the initial
version of this improvement.
* exwm-core.el (exwm--terminal-p): Add function.
* exwm.el (exwm--confirm-kill-terminal): Use it.
* exwm-input.el (exwm-input--on-buffer-list-update): Use it.
(exwm-input--on-minibuffer-setup)
(exwm-input--on-minibuffer-exit): Use it.
(exwm-input--on-minibuffer-exit): Use the minibuffer's selected
window's frame or selected frame instead of current workspace.
(exwm-input--on-echo-area-dirty): Removed test, as it's checked in
`exwm-input--on-minibuffer-setup'.
* exwm-layout.el (exwm-layout--on-minibuffer-setup)
(exwm-layout--on-echo-area-change): Use it.
(exwm-layout--on-echo-area-change): Refresh layout the
frame of selected window's minibuffer if it's an EXWM frame.
* exwm-workspace.el (exwm-workspace--update-minibuffer-height)
(exwm-workspace--on-minibuffer-setup)
(exwm-workspace--on-minibuffer-exit)
(exwm-workspace--on-echo-area-dirty)
(exwm-workspace--on-echo-area-clear)
(exwm-workspace--on-delete-frame): Use it.
* exwm-workspace.el (exwm-workspace--client-p-hash-table): Remove
variable.
(exwm-workspace--client-p): Remove function.
EXWM removed the `client' frame parameter from workspace frames,
perhaps in order to lead Emacs to ask for confirmation before
quitting. This change leaves the `client' frame parameter in
place. Emacs no longer asks for confirmation when killing the
emacsclient session. A followup commit will correct this.
* exwm-workspace.el (exwm-workspace--add-frame-as-workspace)
(exwm-workspace--init-minibuffer-frame, exwm-workspace--init)
(exwm-workspace--exit, exwm-workspace--post-init): Remove special
handling for `client' frames. They become workspaces just like
any other frame.
Check whether frames are alive upon teardown, as it might not be
the case when the terminal is killed as
`delete-terminal-functions' might be invoked after the terminal is
deleted.
* exwm-core.el (exwm--terminal): New variable holding the terminal
EXWM runs under.
(exwm-init, exwm-exit): Set and unset it.
* exwm.el (exwm--on-delete-terminal): New function for exiting
EXWM when the terminal is deleted.
(exwm-init): Use it.
* exwm.el (exwm--confirm-kill-terminal, exwm-init): Ask for
confirmation before deleting terminal.
* exwm-workspace.el (exwm-workspace--fullscreen-workspace): New
function. Ensure the frame is alive.
(exwm-workspace--add-frame-as-workspace): Use it.
(exwm-workspace--exit-minibuffer-frame): Cancel
`exwm-workspace--display-echo-area-timer'.
(exwm-workspace--exit-minibuffer-frame): Ensure the minibuffer
frame is alive.
(exwm-workspace--exit): Ignore dead workspace frames.
* exwm-workspace.el (exwm-workspace--get-next-workspace): Return
nil when there's only one frame.
(exwm-workspace--on-delete-frame)
(exwm-workspace--remove-frame-as-workspace): Create a workspace
when removing the last one, for X windows to be moved to.
* exwm-workspace.el (exwm-workspace--prompt-delete)
(exwm-workspace--set-desktop): Stop explicitly moving X windows to
other workspace; dealt with by
`exwm-workspace--remove-frame-as-workspace'.
(exwm-workspace--get-remove-frame-next-workspace): Remove
function. Refactored into `exwm-workspace--get-next-workspace'
and `exwm-workspace--remove-frame-as-workspace'.
(exwm-workspace--get-next-workspace): Add function.
(exwm-workspace--remove-frame-as-workspace): Move X windows to
next workspace.
* exwm-workspace.el (exwm--client-p-hash-table): New variable.
(exwm-workspace--client-p): Use `exwm--client-p-hash-table' to
store which workspace frames are client frames instead of
frequently invoking `frame-parameter'.
* exwm-layout.el (exwm-layout-set-fullscreen,
exwm-layout-unset-fullscreen): Use `exwm--id' for interactive use.
(exwm-layout-unset-fullscreen): Mandatorily clear fullscreen states.
* exwm-xim.el (exwm-xim--handle-forward-event-request): Send all key
events to Emacs while invoking an input method (don't rely on its
keymap definition).
* exwm-input.el (exwm-input-input-mode-change-hook): Add new hook
for code to run upon input mode change.
(exwm-input--grab-keyboard, exwm-input--release-keyboard): Run it.
* exwm-workspace.el (exwm-workspace-switch): Stop aborting
recursive edit upon switching workspaces. Users should handle it
just like in regular Emacs (possibly customizing
`enable-recursive-minibuffers').
* exwm-workspace.el (exwm-workspace-switch): Abort recursive edit
before switching to other workspace. This avoids the usual
`set-window-configuration' calls (e.g., by `eval-expression') to
switch *us back to the previous workspace.