And make enabling it idempotent (part of #47).
* exwm-randr.el (exwm-randr--connection): create a separate connection
variable for EXWM randr, following up from this [1] GitHub discussion.
(*): switch to the new variable.
(exwm-randr--assert-connected): a new function to assert that randr is
enabled & connected (for interactive commands).
(exwm-randr-refresh): use the aformentioned function.
(exwm-randr-mode, exwm-randr-enable): move these to the top so we can
reference the mode variable.
[1]: https://github.com/emacs-exwm/exwm/pull/48#discussion_r1626741032
The example configuration should not be loaded directly. Instead copy the
relevant settings to your user configuration. Fix#57.
* exwm.el: Update commentary.
* exwm-config.el: Update commentary. Print warning when used.
(exwm-config-example, exwm-config-misc, exwm-config-ido): Mark as obsolete.
* exwm.el (exwm--client-message-functions):
Alist for dispatching client messages to handlers.
(exwm-init): set exwm--client-message-functions once exwmh support enabled.
(exwm--on-ClientMessage): delegate via exwm--client-message-functions,
decompose body into separate handlers.
See: https://github.com/ch11ng/exwm/issues/931
* exwm.el (exwm--on-ClientMessage): Handle the case where a window is
hidden but not iconic. This code would previously error in some cases
because a buffer wouldn't have an active window even when it was not in
the iconic state, likely due to a focus race somewhere.
fixes#28
* exwm-systemtray.el (xcb:systemtray:-ClientMessage): Remove class.
(exwm-systemtray--init): Use `xcb:icccm:-ManagerSelection' instead of
`xcb:systemtray:-ClientMessage'.
* exwm-xsettings.el (exwm-xsettings--init): Use `xcb:icccm:-ManagerSelection'
instead of `xcb:xsettings:-ClientMessage'.
Combine both focus update timers into one and ignore windows in "no
focus" frames.
* exwm-input.el
(exwm-input--on-buffer-list-update):
Avoid focusing windows in frames with the `no-accept-focus` frame
property.
(exwm-input--update-focus-defer-timer):
Remove the duplicate timer.
(exwm-input--update-focus-defer):
Use a single `exwm-input--update-focus-timer`.
(exwm-input--update-focus-commit):
Read `exwm-input--update-focus-window` instead of taking a window
as a parameter (this is what lets us combine the timers).
(exwm-input--update-focus-commit):
Use a let-bind instead of unwind-protect.
(exwm-input--exit):
Remove references to `exwm-input--update-focus-defer-timer`.
Otherwise `default-directory' could be /home/user instead of /home/user/ as is
expected by Emacs.
* exwm-manage.el (exwm-manage--update-default-directory): Use
`file-name-as-directory'.
* exwm-manage.el (exwm-manage--update-default-directory):
define a function to update the default-directory of an X window based on it's CID.
(exwm-manage--manage-window):
call `exwm-manage--update-update-default-directory` on manage (fixes#12).
All this logic runs in the context of the EXWM buffer. If there are
concerns about the X windows associating with a different buffer while
we're still trying to manage it, we probably have bigger problems.
* exwm-manage.el (exwm-manage--manage-window): assume that the current
buffer doesn't change.
Users can use this to configure system-wide themes, icons, fonts, etc.
* exwm-xsettings.el: Implement the XSETTINGS protocol (fixes
https://github.com/ch11ng/exwm/issues/876)
These functions and variables have been marked as obsolete over five years ago.
* exwm-input.el (exwm-input-set-simulation-keys): Remove obsolete function.
* exwm-randr.el (exwm-randr--refresh, exwm-randr-workspace-output-plist): Remove
obsolete aliases.