Commit graph

656 commits

Author SHA1 Message Date
Steven Allen
2f4e6fea7e
Don't leave the inner window behind when moving floating windows (#73)
Previously, EXWM would leave the inner window behind when dragging
around floating windows until the mouse was released. Now, the inner
window will be dragged along without any lag.

* exwm-floating.el (exwm-floating--do-moveresize): drag the inner window
along with the outer window.
2024-08-18 14:33:09 +00:00
Manuel Giraud
f00b5ca655
Fix on-Notify (#71)
`cl-case' matches symbols directly but xcb:randr:Notify:* are variables. This likely never worked.

* exwm-randr.el (exwm-randr--on-Notify): replace cond with cl-case.
2024-07-18 12:19:46 +00:00
Daniel Mendler
770520cf97
Bump xelb dependency 2024-07-08 23:24:58 +02:00
Daniel Mendler
5fe0e27a6c
Bump Compat dependency 2024-07-08 23:24:37 +02:00
Daniel Mendler
512d0f0ef9
Bump version 0.31 2024-07-08 12:24:00 +02:00
Daniel Mendler
841ead8141
exwm-xsettings: Use color-dark-p from Compat 2024-07-07 18:43:18 +02:00
Daniel Mendler
87c429561f
Require compat 29.1
See emacs-exwm/xelb/commit/2d451e5d5d16fbee881d5607a156c3bdf7f6bcaa
2024-07-07 18:38:07 +02:00
Nicholas Vollmer
94c9f369dd exwm-layout-toggle-fullscreen: work non-interactively
Previous behavior required explicitly passing an ID when called from lisp
programs. New behavior attempts to set the ID to window-buffer when not
explicitly passed as an argument. A user-error is thrown if current-buffer has
no X window ID.

See: https://github.com/emacs-exwm/exwm/issues/60
2024-06-21 17:56:21 +00:00
Daniel Mendler
41d1e6c1c3
Deprecate xinitrc
The example configuration should not be used directly. Instead copy the
relevant settings to your X initialization script. See #57.

* xinitrc: Print warning when used.
2024-06-15 09:17:21 +02:00
Steven Allen
dad0668fc8 RandR: Track the config timestamp instead of the sequence number
The sequence number tracks how many request's we've sent, the config
timestamp tracks the last time the screen configuration was changed. The
previous logic only worked because we tended to send a lot of X messages
between screen change events, but that's no longer the case now that
we're using a different connection.

* exwm-randr.el (exwm-randr--prev-screen-change-timestamp): rename
`sequence` to `timestamp`.
(exwm-randr--on-ScreenChangeNotify): use `config-timestamp` instead of
`~sequence`.
2024-06-11 20:19:03 -07:00
Steven Allen
dd95ff193a ; Fix last change in exwm-randr.el
* exwm-randr.el (exwm-randr--init): explicitly return from
exwm-randr--init.
2024-06-09 08:14:32 -07:00
Steven Allen
dd9c11125f Make exwm-randr-mode use a separate X connection
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
2024-06-08 23:24:08 +00:00
Daniel Mendler
382bdd899c
Deprecate exwm-config
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.
2024-06-07 12:33:40 +02:00
Daniel Mendler
cc8592d30f
exwm-config: Remove obsolete alias exwm-config-default
* exwm-config.el (exwm-config-default): Remove obsolete alias.
2024-06-06 19:29:39 +02:00
Daniel Mendler
c3d1bdabb0
; exwm--global-minor-mode-body: Fix docstring
* exwm-core.el (exwm--global-minor-mode-body): Fix docstring.
2024-06-06 19:28:00 +02:00
Nicholas Vollmer
4042de16fd add exwm--client-message-functions
* 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
2024-06-06 14:40:42 +00:00
Daniel Mendler
d41de490e3
exwm-systemtray--init, exwm-xsettings--init: Idempotent initialization
* exwm-systemtray.el (exwm-systemtray--init),
  exwm-xsettings.el (exwm-xsettings--init):
  Return early if already initialized.
2024-06-06 10:12:02 +02:00
Daniel Mendler
63bde86545
Restore non-obsolete exwm-debug variable
* exwm-core.el (exwm-debug): Reintroduce exwm-debug variable.
2024-06-06 10:11:48 +02:00
Nicholas Vollmer
9e965fd2af satisfy checkdoc
* exwm-background.el (exwm-background--connected-p): Add docstring.
(exwm-background--connect): Add docstring.
* exwm-core.el (exwm-debug-log-time-function):
(exwm-debug): Rename to exwm-debug-mode; define obsolete alias for old name.
(exwm--debug): Update docstring to reflect above name change.
(exwm--log): condition on exwm-debug-mode
(exwm-mode-map): update exwm-debug-mode binding
* exwm-floating.el (exwm-floating--set-allowed-actions):
Rename TILLING parameter to TILED-P; update docstring.
(exwm-floating--start-moveresize): Add parameters to docstring.
(exwm-floating--do-moveresize): Add parameter to docstring.
* exwm-input.el (exwm-input-prefix-keys): Remove embedded keybinding from docstring.
(exwm-input--on-PropertyNotify): Add parameter to docstring.
(exwm-input--on-EnterNotify): Add parameter to docstring.
(exwm-input--on-keysyms-update): Add docstring.
(exwm-input--set-active-window): Add parameter to docstring.
(exwm-input--on-ButtonPress): Add parameter to docstring.
(exwm-input--on-KeyPress): Add parameter to docstring.
(exwm-input--on-CreateNotify): Add parameter to docstring.
(exwm-input--grab-global-prefix-keys): Add docstring.
(exwm-input--set-key): Add docstring.
(exwm-input-set-key): Add parameter to docstring.
(exwm-input--unread-event): Add docstring.
(exwm-input--translate): Add docstring.
(exwm-input--cache-event): Add parameter to docstring.
(exwm-input--on-KeyPress-line-mode): Rename parameter; add parameter to docstring.
(exwm-input--on-KeyPress-char-mode): Rename parameter; add parameter to docstring.
(exwm-input-grab-keyboard): Add parameter to docstring.
(exwm-input-release-keyboard): Add parameter to docstring.
(exwm-input-toggle-keyboard): Add parameter to docstring.
(exwm-input-send-next-key): Rename parameter; mention limit in docstring.
(exwm-input--set-simulation-keys): Rename parameter; add parameter to docstring.
(exwm-input--read-keys): Add docstring.
(exwm-input-set-simulation-key): Add parameters to docstring.
(exwm-input-send-simulation-key): Rename parameter; add parameter to docstring.
* exwm-randr.el (exwm-randr--on-ScreenChangeNotify): Add parameter to docstring.
(exwm-randr--on-Notify): Add parameter to docstring.
(exwm-randr--on-ConfigureNotify): Add parameter to docstring.
* exwm-xim.el (exwm-xim--on-ClientMessage): Add parameter to docstring.
* exwm.el (exwm-restart): Remove question mark from prompt arg
(exwm-enable): Remove question mark from prompt arg; add parameter to docstring.
(exwm--confirm-kill-terminal): Remove question mark from prompt arg.
(exwm--confirm-kill-emacs): Ensure prompt ends in question mark.
2024-06-06 09:56:47 +02:00
Daniel Mendler
588f6ca043
; Fix make-obsolete calls for the enable functions
Don't use hashed symbols, since this will lead to byte compilation warnings.
Also refer to the currently released version.
2024-06-04 17:27:43 +02:00
Daniel Mendler
693ade989f
Use appropriate customization groups for newly added modes 2024-06-04 17:24:07 +02:00
Daniel Mendler
2fd5ab1039
; Remove autoloads from obsolete enable functions 2024-06-04 16:55:49 +02:00
Daniel Mendler
f9f90dcf8b
; Update module commentaries 2024-06-04 16:55:41 +02:00
Nicholas Vollmer
5516f24d5e
Use global minor modes for EXWM features (#46) 2024-06-04 16:55:06 +02:00
Daniel Mendler
3e6bfe36af
Bump version to 0.30
Same version as 0.29. Bump only required to trigger ELPA rebuild.
2024-05-24 09:19:18 +02:00
Daniel Mendler
3b28c051f5
Bump version to 0.29 2024-05-23 19:19:41 +02:00
Daniel Mendler
956e7eb175
Depend on xelb 0.19 2024-05-23 19:19:19 +02:00
Daniel Mendler
9b130b2e9a
; Fix single quote docstring warning
* exwm-input.el (exwm-input-prefix-keys): Fix docstring.
2024-05-17 11:28:28 +02:00
Steven Allen
236f3ca467
Correctly activate windows even if they're not in the iconic state (#32)
* 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
2024-04-03 14:08:39 -07:00
Daniel Mendler
bf921084b4
; Make more lambdas visible to the byte compiler
* exwm-core.el (exwm-mode-menu), exwm-floating.el (exwm-floating-border-width):
  Make lambdas visible to the byte compiler.
2024-03-16 17:40:11 +01:00
Daniel Mendler
0ef8e04f27
exwm-mode-menu: Make lambdas visible to the byte compiler
* exwm-core.el (exwm-mode-menu): Use quasi quoting. Make lambdas visible to the
  byte compiler.
2024-03-16 17:02:11 +01:00
Daniel Mendler
a959f91c75
Move evaluated mode-name expression to exwm--mode-name
* exwm-core.el (exwm--mode-name): New function.
  (exwm-mode): Use it.
2024-03-16 16:55:37 +01:00
Daniel Mendler
61d97532fa
exwm-mode: Disable command, abbrev and syntax table
* exwm-core.el (exwm-mode): Disable :interactive, :syntax-table and
  :abbrev-table.
2024-03-16 14:37:16 +01:00
Daniel Mendler
99442909be
window-pixel-width-before-size-change is available since Emacs 26
* exwm-layout.el (exwm-layout--init, exwm-layout--exit): Remove fboundp check.
2024-03-15 19:08:00 +01:00
Daniel Mendler
1ebd135f45
window-preserve-size is available since Emacs 25
* exwm-workspace.el (exwm-workspace--on-minibuffer-setup): Remove fboundp check.
2024-03-15 19:07:45 +01:00
Daniel Mendler
182102767e
Use xcb:icccm:-ManagerSelection (#16)
* 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'.
2024-02-12 23:55:19 +01:00
Steven Allen
a6e66f5e33
Simplify and improve focus handling (#10)
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`.
2024-02-05 07:32:51 -08:00
Daniel Mendler
44e74bcc07
Ensure that default-directory is a directory name in EXWM buffers.
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'.
2024-02-04 22:39:06 +01:00
Steven Allen
fbc1e81ed6
Set the EXWM buffer's default directory to match the process's CWD (#14)
* 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).
2024-02-04 12:57:58 -08:00
Steven Allen
c2856d15e8
Remove redundant with-current-buffer in manage-window (#13)
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.
2024-02-04 12:49:33 -08:00
Steven Allen
2bb9a5787e Use '=' instead of 'eq' to compare numbers.
* exwm.el (exwm--update-desktop):
* exwm-layout.el (exwm-layout--hide):
  Use `=` instead of `eq` for numeric comparison.
2024-01-24 06:05:33 +01:00
Steven Allen
0e365a0058 Use color-values instead of x-color-values
* exwm-core.el (exwm--color->pixel): Use `color-values` (introduced in
  Emacs 21) instead of `x-color-values` (deprecated in Emacs 30).
2024-01-24 05:48:08 +01:00
Daniel Mendler
089e0c8683 Move xsettings classes to xelb 2024-01-15 20:30:50 +01:00
Daniel Mendler
eb28ebf165
; README: Refer to the user guide for installation instructions 2024-01-14 12:32:02 +01:00
Daniel Mendler
5acb8bea8a
New customization group exwm-xsettings
* exwm-xsettings.el (exwm-xsettings): New customization group.
2024-01-14 01:07:39 +01:00
Daniel Mendler
c033fc00f3
New customization group exwm-debug
The group was already used, but the docstring was missing.

* exwm-core.el (exwm-debug): New customization group.
2024-01-14 01:07:33 +01:00
Daniel Mendler
f3c03ebbc3
; README: Fix feature list formatting 2024-01-13 20:43:00 +01:00
Daniel Mendler
8980c03a6b
; Commentary: Update list of features 2024-01-13 20:38:09 +01:00
Steven Allen
ff4edaab89 Implement the XSETTINGS protocol
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)
2024-01-13 20:23:55 +01:00
Daniel Mendler
c573ff143a Drop :version keywords from defgroup
These may refer to an Emacs version and may have been added by mistake.
2024-01-13 20:23:24 +01:00