Commit graph

512 commits

Author SHA1 Message Date
Chris Feng
98847a9cda Merge branch 'medranocalvo/reduce-workspace-switch-flicker' into externals/exwm 2018-10-14 00:00:00 +00:00
Chris Feng
5c9fcc0cd4 Merge branch 'medranocalvo/fix-minibuffer-only-focus-jump' into externals/exwm 2018-10-14 00:00:00 +00:00
Adrián Medraño Calvo
24287f2691 Reduce flicker when switching workspaces
* exwm-workspace.el (exwm-workspace-switch): Hide the old
workspace after having shown the new one when switching to avoid
flicker.
2018-10-08 12:00:00 +00:00
Adrián Medraño Calvo
57d0e9e1d3 Support binding mouse events in line-mode
* 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.
2018-10-08 12:00:00 +00:00
Adrián Medraño Calvo
c9984ca216 Fix focus jumps with minibuffer-only frames
* 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.
2018-10-08 12:00:00 +00:00
Adrián Medraño Calvo
dff1ef6a3c Simplify input handling
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.
2018-10-08 12:00:00 +00:00
Chris Feng
472f7cb82b Simplify debugging and fix dynamic-scoping `eval'
* 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'.
2018-09-16 00:00:00 +00:00
Chris Feng
5903080b6e Merge branch 'medranocalvo/restack-after-map' into externals/exwm 2018-09-09 00:00:00 +00:00
Chris Feng
05977d05ff Merge branch 'medranocalvo/xcb-logging' into externals/exwm 2018-09-09 00:00:00 +00:00
Chris Feng
72bba1176c ; Minor fixes for Calvo's patch set. 2018-09-09 00:00:00 +00:00
Adrián Medraño Calvo
6978c1f45c Restack X-Windows after being mapped to ensure EnterNotify events fire
* 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).
2018-09-04 12:00:00 +00:00
Adrián Medraño Calvo
ac1372eb11 Command for toggling debugging output
* exwm-core.el (exwm-debug-toggle): New function for toggling
debugging output.
(exwm-mode-map): Use it.
2018-09-04 12:00:00 +00:00
Adrián Medraño Calvo
3419337f52 Substitute overlapping keybindings
* exwm-core.el (exwm-mode-map): Change keybindings to avoid
overlap.
2018-09-04 12:00:00 +00:00
Adrián Medraño Calvo
74ef19ff44 Use XELB's debugging facilities
* exwm-debug.el: Move to XELB as `xcb-debug'.
* exwm-core.el (exwm--log): Use it.
(exwm--log): Support switching debugging output at runtime.
2018-09-04 12:00:00 +00:00
James Ferguson
dd57c5eebb Explicitly specify frame for cursor warping conditional 2018-09-02 16:18:06 +08:00
James Ferguson
2399a0bb22 Fix cursor warping conditional for cursor left of frame 2018-09-02 16:18:06 +08:00
Adrián Medraño Calvo
5f6b866cfe Refresh layout after activating/deactivating workspaces
* 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.
2018-08-30 12:00:00 +00:00
Chris Feng
2b1ed2ce70 Merge branch 'medranocalvo/fix-x-window-vanish' into externals/exwm 2018-08-19 00:00:00 +00:00
Chris Feng
be10e261cc Merge branch 'medranocalvo/exwm-log-buffer' into externals/exwm 2018-08-19 00:00:00 +00:00
Adrián Medraño Calvo
d4a772f536 ; Comment layout algorithm. 2018-08-19 00:00:00 +00:00
Adrián Medraño Calvo
29f2289a75 Consistently name helper windows
* 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.
2018-08-19 00:00:00 +00:00
Chris Feng
b6a3b7b3ad ; Unimportant tweaks 2018-08-19 00:00:00 +00:00
Adrián Medraño Calvo
f820217d00 Split exwm-layout--refresh into three functions
* 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.
2018-08-16 12:00:00 +00:00
Adrián Medraño Calvo
633065ad55 Don't assume order of `get-buffer-window-list' results
It only guarantees that the first result *if* the buffer appears on the
selected window.
2018-08-16 12:00:00 +00:00
Adrián Medraño Calvo
11fecb5186 Use more explicit argument for excluding minibuffers
* exwm-layout.el (exwm-layout--refresh): Use a more intuitive
value for specifying exclusion of minibuffers.
2018-08-16 12:00:00 +00:00
Adrián Medraño Calvo
5c1aa4dc31 Consider windows of the frame being refreshed, not the selected one at the time exwm-layout--refresh runs
* exwm-layout.el (exwm-layout--refresh): Consider windows of the
frame being refreshed instead of the selected frame.
2018-08-16 12:00:00 +00:00
Adrián Medraño Calvo
33dec8d1a3 Trace more functions 2018-08-13 12:00:00 +00:00
Adrián Medraño Calvo
ac600f0916 Commands for interacting with the log buffer remotely
* exwm-debug.el (exwm-debug--clear, exwm-debug--mark): New
functions.
2018-08-13 12:00:00 +00:00
Adrián Medraño Calvo
8d15a39c4d Print log output to an EXWM-specific messages buffer
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.
2018-08-13 12:00:00 +00:00
Chris Feng
4d43e3119a Avoid using `set-mouse-position' to warp pointer
* exwm-workspace.el (exwm-workspace-switch): Warp pointer with the
WarpPointer request.
2018-08-12 00:00:00 +00:00
Chris Feng
e6527227b3 Exclude irrelevant X windows when refreshing
* exwm-layout.el (exwm-layout--refresh): Only check X windows on the
workspace being examined.
2018-08-12 00:00:00 +00:00
Chris Feng
aebcb0344f When mapping an X window check if it's on an active workspace
* exwm-layout.el (exwm-layout--refresh): Avoid mapping X windows on
inactive workspaces.
2018-08-05 00:00:00 +00:00
Chris Feng
13a14579cc Fix issues with destroying full screen X windows
* 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.
2018-07-29 00:00:00 +00:00
Chris Feng
7e5750392c Bump version to 0.19 2018-07-18 00:00:00 +08:00
Chris Feng
f45e9b9273 Fix XTerm crash on startup
* exwm-input.el (exwm-input--set-focus): Applications like XTerm
crashes on receiving WM_TAKE_FOCUS so only send it to X windows
accepting it.
2018-07-15 00:00:00 +08:00
Chris Feng
bc5f0b3ffa ; Use `derived-mode-p'. 2018-07-15 00:00:00 +08:00
Chris Feng
1364f80f09 Add support for automatic cursor warping
* exwm-workspace.el (exwm-workspace-warp-cursor): New user option.
(exwm-workspace-switch): Automatically warp cursor after workspace
switch.
2018-07-15 00:00:00 +08:00
Chris Feng
c1b6a296a8 Shrink Emacs frames with X request
* 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.
2018-07-15 00:00:00 +08:00
Chris Feng
6be729847e Also send a WM_TAKE_FOCUS when setting focus with SetInputFocus
* exwm-input.el (exwm-input--set-focus): Send an extra WM_TAKE_FOCUS
event to workaround the key replay issue with Xorg 1.20 when keyboard
is grabbed.
2018-07-15 00:00:00 +08:00
Chris Feng
4bb2d87a8d Revert "Grab & Replay key events with XI2 and XTEST"
This reverts commit 0680be104f.
2018-07-15 00:00:00 +08:00
Chris Feng
0680be104f Grab & Replay key events with XI2 and XTEST
; 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.
2018-06-18 22:33:38 +08:00
Chris Feng
b75c89cae2 Fix systemtray position when menu-bar / tool-bar is enabled
* exwm-systemtray.el (exwm-systemtray--on-workspace-switch)
(exwm-systemtray--on-randr-refresh): Take menu-bar / tool-bar into
account when placing systemtray.
2018-05-27 23:29:36 +08:00
Chris Feng
df8de92113 Provide a fallback value for X window geometry
* exwm-manage.el (exwm-manage--update-geometry): Ditto.
2018-05-20 16:14:01 +08:00
Chris Feng
0037cba87b Avoid hiding full screen X windows unexpectedly
* 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.
2018-05-13 23:57:36 +08:00
Paul Eggert
ff4ae82fd7 Port to 32-bit Emacs on master branch 2018-04-15 14:53:01 -07:00
Chris Feng
87db8b42a3 Preserve keyboard grab state after quitting fullscreen mode
* exwm-layout.el (exwm-layout-set-fullscreen)
(exwm-layout-unset-fullscreen, exwm-layout-toggle-fullscreen): Ditto.
2018-04-01 23:38:48 +08:00
Chris Feng
fbdcd42b0a Add support for various key processing variables
* exwm-input.el (exwm-input--mimic-read-event): New function for
handling `extra-keyboard-modifiers' and `keyboard-translate-table'.
(exwm-input--cache-event): Do not unread events here.
(exwm-input--on-KeyPress-line-mode)
(exwm-input--on-KeyPress-char-mode): Compare with preprocessed events
and unread raw ones.

* exwm-input.el (exwm-input--on-KeyPress-line-mode): Add support for
`overriding-terminal-local-map'.
2018-04-01 23:30:19 +08:00
Chris Feng
f4aa8389fc Fix a compatibility issue with Emacs 24
* exwm-core.el (exwm--defer): `time-add' in Emacs 24 only accept lists.
2018-03-23 23:57:18 +08:00
Chris Feng
10eb27eddc Fix local simulation keys
* exwm-input.el (exwm-input--on-KeyPress-line-mode): Do not test
`exwm-mode-map' to see if a key should be forwarded to Emacs as it's
overridden when local simulation keys are present.
2018-03-23 23:55:28 +08:00
Chris Feng
02b1be7160 Avoid entering line-mode after exit minibuffer
* exwm-input.el (exwm-input--on-pre-command): Keys should be forwarded
to the X window (if its Emacs window is currently selected) after
exiting the minibuffer.
2018-03-23 23:53:05 +08:00