Commit graph

352 commits

Author SHA1 Message Date
Chris Feng
21351f6be3 Be more precise when choosing the init hook
* exwm.el (exwm-enable): Run `exwm-init' in
`after-make-frame-functions' only for emacsclient and
`window-setup-hook' only for ordinary sessions.
2017-11-09 01:28:50 +08:00
Chris Feng
088818fedb Update the workarounds for `unread-command-events'
* exwm-input.el (exwm-input--unread-event): Update the note.
(exwm-input-send-next-key): Remove the workaround.
2017-11-09 01:17:58 +08:00
Ram Krishnan
93d96757b6 Fix for "Selecting deleted buffer" exception 2017-11-05 08:13:09 -08:00
Chris Feng
dea874e240 Filter out events relating to temp buffers
* exwm-input.el (exwm-input--on-buffer-list-update): Filter out events
relating to temp buffers by detecting if temp-buffer is present.
2017-11-05 22:34:05 +08:00
Chris Feng
3edf2e8880 Fix systemtray applications crash when restarting
* exwm-systemtray.el (exwm-systemtray--exit): Reparent out the tray
embedder to protect tray icons.
2017-10-09 00:29:05 +08:00
Chris Feng
75eb43e1e0 Avoid comparing raw button events
* exwm-input.el (exwm-input--move-keysym, exwm-input--move-mask)
(exwm-input--resize-keysym, exwm-input--resize-mask): Removed.
(exwm-input--on-ButtonPress): Compare using Emacs events rather than
raw X11 events or it would fail with num-lock no.
(exwm-input--init): No longer cache raw keysym/state for button events.
2017-09-10 18:00:01 +08:00
Chris Feng
7bc4ea5a6e Update systemtray when initializing
* exwm-systemtray.el (exwm-systemtray--init): Systemtray is not placed
correctly when there's a panel launched before EXWM.
2017-08-31 01:00:51 +08:00
Chris Feng
46dfaeb031 Avoid reusing dedicated window
* exwm-floating.el (exwm-floating--unset-floating):
* exwm-manage.el (exwm-manage--on-MapRequest):
Do not select a dedicated window for displaying a buffer.
2017-08-31 00:58:39 +08:00
Chris Feng
4eda6dde41 Bump version to 0,15 2017-08-02 23:05:57 +08:00
Chris Feng
7d967e7361 Allow customizing workspace indexes
* exwm-workspace.el (exwm-workspace-index-map): New variable for
customizing workspace indexes.
(exwm-workspace--update-switch-history): Use it.
2017-07-16 17:08:24 +08:00
Chris Feng
19515dc074 Allow switching to a workspace by selecting one X window on it
* exwm-workspace.el (exwm-workspace-switch-to-buffer): Only allows it
when `exwm-layout-show-all-buffers' is nil.
2017-05-31 00:12:22 +08:00
Chris Feng
851ed8c280 Fix X display name comparison
* exwm-workspace--add-frame-as-workspace
(exwm-workspace--add-frame-as-workspace): Manually compare X display
names as there's no built-in function handles this correctly.
2017-05-30 01:25:58 +08:00
Chris Feng
2babc8d070 Bump version to 0.14 2017-05-07 18:43:42 +08:00
Chris Feng
267ebd7f55 Force repositioning floating Emacs frames
* exwm-floating.el (exwm-floating--set-floating): Ditto.
2017-05-07 18:40:08 +08:00
Chris Feng
2b7449ea42 ; Do not cache events for non-`exwm-mode' buffers 2017-04-23 23:39:06 +08:00
Chris Feng
d4cfa564be Avoid comparing X display names
* exwm-workspace.el (exwm-workspace--add-frame-as-workspace): An X
display name set by XELB can be different from (but equivalent with)
the one set by Emacs.
2017-04-16 21:46:07 +08:00
Chris Feng
7a5bb1156d Only add graphic frames to `exwm-manage--frame-outer-id-list'
* exwm-manage.el (exwm-manage--add-frame, exwm-manage--remove-frame):
Add checks for graphic frames.
2017-04-10 00:30:43 +08:00
Chris Feng
52dc261624 Manually run focus-in-hook' and focus-out-hook'
; Since X windows are managed by EXWM, the current Emacs frame should
always be considered focused logically.

* exwm-workspace.el (exwm-workspace-switch): Manually run
`focus-in-hook' and `focus-out-hook'.
(exwm-workspace--handle-focus-in, exwm-workspace--handle-focus-out):
New functions for overriding `handle-focus-in' and `handle-focus-out'.
(exwm-workspace--init, exwm-workspace--exit): Override
`handle-focus-in' and `handle-focus-out'
2017-03-05 01:10:43 +08:00
Chris Feng
eebf764edd ; Update the workaround for bug#23980 2017-03-05 01:09:26 +08:00
Chris Feng
b79a3c52a5 Merge branch 'Stebalien/expose-line-mode-passthrough' into externals/exwm 2017-02-24 23:30:02 +08:00
Chris Feng
d0e9895748 ; Expose `exwm-input-line-mode-passthrough' as a public interface. 2017-02-24 23:25:02 +08:00
Chris Feng
f299ca5ed7 Fix systemtray position
* exwm-workspace.el (exwm-workspace--update-workareas-hook): New hook
run when workareas get updated.
(exwm-workspace--update-workareas): Run the hook.
* exwm-systemtray.el (exwm-systemtray--on-workspace-switch)
(exwm-systemtray--on-randr-refresh): Take struts into account when
calculating the position for systemtray.
(exwm-systemtray--on-struts-update): Alias of
`exwm-systemtray--on-randr-refresh'.
(exwm-systemtray--init, exwm-systemtray--exit): Manipulate
`exwm-workspace--update-workareas-hook'.
2017-02-24 23:13:52 +08:00
Steven Allen
46e1d7a754 Use let instead of setq when setting exwm-input--line-mode-passthrough
That way, exwm won't clobber user modifications to this variable.
2017-02-22 10:05:41 -08:00
Chris Feng
0ae1e7327e Bump version to 0.13 2017-02-12 23:11:27 +08:00
Chris Feng
6723436052 Correct a renamed variable
* exwm-core.el (exwm--kmacro-map): Correct
`exwm-input--during-key-sequence' that was left out in 089afdc8.
2017-02-10 22:14:56 +08:00
Chris Feng
d69e7075ad Add a menu entry to `exwm-mode-map'
* exwm-core.el (exwm-mode-menu): Add a menu entry for closing X windows.
2017-02-05 17:51:43 +08:00
Chris Feng
f221f837cb Fix checkdoc warnings 2017-02-05 17:50:52 +08:00
Chris Feng
9926d87b65 Update copyright year to 2017 2017-02-05 17:49:42 +08:00
Chris Feng
4c043471c5 Prevent certain frame parameters from being saved/restored
* exwm-input.el (exwm-input--init):
* exwm-randr.el (exwm-randr--init):
* exwm-workspace.el (exwm-workspace--init):
Add certain frame parameters into `frameset-filter-alist' to prevent
them from being saved/restored which makes little sense and is
problematic.
2017-01-03 00:14:33 +08:00
Chris Feng
b11ac2e6dc Fix a bug with zero floating border width
* exwm-manage.el (exwm-manage--manage-window): Avoid setting ColorMap
mask when creating an X window if floating border is zero.
2016-12-26 22:22:46 +08:00
Chris Feng
197745e6a4 Bump version to 0.12 2016-11-19 23:05:47 +08:00
Chris Feng
bb0c5f4c6b Grab global prefix keys with num-lock mask set.
* exwm-input.el (exwm-input--update-global-prefix-keys): Grab global
prefix keys with num-lock mask set, or those keys won't be activated
when num-lock is enabled.
2016-11-13 19:23:10 +08:00
Chris Feng
d0c2ca75f8 Fix a possible deadlock
* exwm-input.el (exwm-input--update-focus): Unlock before switching
workspace.  Also make sure the correct Emacs window is chosen for the
target workspace.
2016-10-06 19:26:53 +08:00
Chris Feng
09b4f09158 Avoid updating input focus when renaming buffers
* exwm-workspace.el (exwm-workspace-switch-to-buffer)
(exwm-workspace-rename-buffer): Do not update input focus.
2016-10-06 13:04:30 +08:00
Chris Feng
089afdc8cc Fix problems with active minibuffer
* exwm-floating.el (exwm-floating--unset-floating): Never use the
minibuffer window to display an `exwm-mode' buffer.

* exwm-input.el (exwm-input--on-buffer-list-update)
(exwm-input--update-focus): Allow updating input focus when the
minibuffer is active.
(exwm-input--update-focus): Handle the case when an auto-hiding
minibuffer is active.
(exwm-input--during-key-sequence): Renamed to
`exwm-input--line-mode-passthrough'.
(exwm-input--line-mode-passthrough): New variable for forcing all events
to be passed to Emacs in line-mode.
(exwm-input--on-KeyPress-line-mode, exwm-input-send-next-key): Use it.
(exwm-input--finish-key-sequence, exwm-input--init, exwm-input--exit):
Drop `exwm-input--finish-key-sequence'.
(exwm-input--line-mode-cache): New variable for caching incomplete key
sequences.
(exwm-input--cache-event): New function for handling new key events.
(exwm-input--on-KeyPress-line-mode, exwm-input--on-KeyPress-char-mode):
Use it.
2016-10-06 12:47:56 +08:00
Chris Feng
575162b6b6 Bump version to 0.11 2016-10-01 18:54:45 +08:00
Chris Feng
9a262e8221 Merge branch 'fjl/read-buffer-to-switch' into externals/exwm 2016-10-01 18:53:57 +08:00
Felix Lange
7d732d78f5 Use read-buffer-to-switch in exwm-workspace-switch-to-buffer
read-buffer-to-switch elides the current buffer from the list of
completions and selects a sane default.
2016-09-30 13:34:37 +02:00
Chris Feng
1c8101afbf Fix a frame resizing problem for Lucid build
* exwm-manage.el (exwm-manage--frame-outer-id-list): New variable for
storing frame window-outer-id's.
(exwm-manage--add-frame, exwm-manage--remove-frame): New functions for
adding/removing ids to/from the variable.
(exwm-manage--init): Add the functions to the corresponding hooks.
(exwm-manage--on-ConfigureRequest): Check for frames and avoid handling
them.
2016-09-25 19:58:16 +08:00
Chris Feng
7fbd5220f2 Fix `exwm-manage--kill-buffer-query-function'
* exwm-manage.el (exwm-manage--kill-buffer-query-function): Check
buffer-local variables for destroyed X windows; Avoid force killing
clients that support WM_DELETE_WINDOW but not _NET_WM_PING; Use
`y-or-n-p' instead for querying.
2016-09-25 19:54:13 +08:00
Chris Feng
6be75083c2 Use X window borders
; This commit replaces the internal borders of Emacs frames with X
; window borders.  This should make the flickering issue of floating X
; windows less serious.

* exwm-floating.el (exwm-floating--border-pixel)
(exwm-floating--border-colormap): New variables for storing border pixel
and its colormap.
(exwm-floating--set-floating): Do not set the internal border (and
background color) of floating frames; do not take
`exwm-floating-border-width' into account when calculating geometries;
set the border of floating X window containers.
(exwm-floating--unset-floating): No need to restore the position of X
windows any more; hide the border of floating X window containers.
(exwm-floating--init): Initialize the border pixel.
* exwm-layout.el (exwm-layout-set-fullscreen)
(exwm-layout-unset-fullscreen): Show/Hide container border respectively.
* exwm-manage.el (exwm-manage--manage-window): Set the border pixel and
colormap of X window containers.
* exwm-workspace.el (exwm-workspace-move-window): Do not set the
internal border and background color of floating frames.
* exwm.el (exwm--on-ClientMessage): Simplify the code for calculating
_NET_REQUEST_FRAME_EXTENTS.
2016-09-23 18:41:43 +08:00
Chris Feng
2597f74c7f Remember the geometries of floating X windows
* exwm-floating.el (exwm-floating--stop-moveresize):
* exwm-layout.el (exwm-layout-enlarge-window):
Update the geometry after resizing.
2016-09-23 18:36:09 +08:00
Chris Feng
0833e8dc4a Redirect KeyPress events sent to system tray icons
* exwm-systemtray.el (exwm-systemtray--embed): Select KeyPress events on
system tray icons.
(exwm-systemtray--on-KeyPress): New function for redirecting KeyPress
events.
(exwm-systemtray--init): Attach the event listener.

* exwm-systemtray.el (exwm-systemtray--init): Fix a typo.
2016-09-23 18:29:11 +08:00
Chris Feng
84dad20d66 Allow selecting an X window from another workspace
* exwm-input.el (exwm-input--on-buffer-list-update): Filter out
switch-frame events.
(exwm-input--update-focus): Switch workspace to set input focus on an X
window from another workspace.
2016-09-23 18:24:37 +08:00
Chris Feng
f96f565d54 Add support for keyboard macro
* exwm-core.el (exwm--kmacro-map): New keymap used when executing
keyboard macros.
(exwm-mode): Use `exwm--kmacro-map' to override the default keymap.
* exwm-input.el (exwm-input--on-KeyPress-line-mode): Send extra key
events when defining keyboard macros.
2016-09-22 19:10:38 +08:00
Chris Feng
43af6bb6a2 Drop support for _NET_WM_STATE_MODAL
; Modal X windows are not necessarily floating.

* exwm.el (exwm--on-ClientMessage, exwm--init-icccm-ewmh): Drop support
for _NET_WM_STATE_MODAL.
2016-09-22 19:08:13 +08:00
Chris Feng
2497c45a1d ; Remove dead code 2016-09-22 19:02:54 +08:00
Chris Feng
4287d31df1 Merge branch 'vedvyas/workspace-move-window-tweak' into externals/exwm 2016-08-31 19:27:46 +08:00
Chris Feng
b4517fbfa0 Force using visible buffers in `other-buffer'
* exwm-floating.el (exwm-floating--set-floating):
* exwm-workspace.el (exwm-workspace-move-window):
Buffers visible on other frames should be treated as invisible.  One
side effect is visible buffers on the current frame is also taken into
account.
2016-08-31 19:18:42 +08:00
Ved Vyas
9105f23121 Improve exwm-workspace-move-window behavior in specific case
This is a small change that improves the behavior of
`exwm-workspace-move-window` in the following situation:

0. `exwm-workspace-show-all-buffers` and `exwm-layout-show-all-buffers`
are `nil`*.
1. On active workspace `i`, there is X window `a` in the selected Emacs
window.
2. On workspace `j`, there is X window `b` in the selected Emacs window
on that workspace frame.
3. While workspace `i` is active, use `exwm-workspace-move-window` to
move `a` to workspace `j`.
4. Switch to workspace `j` and use `exwm-workspace-move-window` to move
`a` back to workspace `i`.

Expected behavior: X window `a` is once again shown in the selected
Emacs window on workspace `i` and X window `b` is once again shown in
the selected Emacs window on workspace `j`.

What is observed: `a` is OK but the selected Emacs window on workspace
`j` does not show `b`. However, `b` is the first candidate when doing a
`switch-to-buffer` in that Emacs window on workspace `j`.

I'm not sure if this is the correct and complete change required, but it
is working well so far.

*The expected behavior is observed with EXWM 0.10 if
exwm-{workspace,layout}-show-all-buffers are non-nil.
2016-08-30 12:10:45 -04:00