about summary refs log tree commit diff
path: root/exwm-input.el (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-03-06 Cleanup exwm-input on exitAdrián Medraño Calvo1-0/+1
* exwm-input.el (exwm-input--exit): Remove missing hook reset window variable.
2018-03-06 Support disabling default `exwm-mode-map' bindingsAdrián Medraño Calvo1-1/+1
* exwm-input.el (exwm-input--on-KeyPress-line-mode): Use `lookup-key' to check whether a the event is defined in the `exwm-mode-map' keymap.
2018-03-04 Fix local simulation keysChris Feng1-10/+11
* exwm-input.el (exwm-input--set-simulation-keys): Try the local binding first do not clear the hash table (rely on GC).
2018-02-26 Forward keys defined in `exwm-mode-map' to Emacs by defaultChris Feng1-2/+7
* exwm-input.el (exwm-input-prefix-keys): Remove ?\C-c. (exwm-input--on-KeyPress-line-mode): * exwm-core.el (): Detect keys in `exwm-mode-map' in line-mode.
2018-02-26 Improve the Customize interface for simulation keysChris Feng1-28/+56
* exwm-input.el (exwm-input--set-simulation-keys): New function for actullay setting simulation keys. (exwm-input-simulation-keys, exwm-input-set-local-simulation-keys) (exwm-input--init): Use this instead of `exwm-input-set-simulation-keys'. (exwm-input-set-simulation-keys): Make obsolete. (exwm-input--read-keys): New function for reading an arbitrary key sequence. (exwm-input-set-simulation-key): New command for setting a new simulation key (which can be saved in the Customize interface).
2018-02-26 Add Customize interface for global keysChris Feng1-3/+36
* exwm-input.el (exwm-input--set-key): New function for actually setting the binding. (exwm-input-global-keys): New user option for customizing global keys. (exwm-input-set-key): Update `exwm-input-global-keys' and call `exwm-input--set-key' (exwm-input--init): Initialize global keys.
2018-02-22 Grab global keys on top-level X windowsChris Feng1-40/+40
* exwm-input.el (exwm-input--on-CreateNotify): New function for grabbing global keys on newly created X windows. (exwm-input--update-global-prefix-keys): Grab global keys on top-level X windows instead of the root window. (exwm-input--grab-global-prefix-keys): New function for grabbing global keys on X windows. (exwm-input--release-keyboard): Grab global keys in char-mode. (exwm-input--init): Select CreateNotify events. * exwm-core.el (exwm--unlock): * exwm-input.el (exwm-input--on-FocusIn, exwm-input--init): Do not handle FocusIn events on the root window.
2018-02-20 Fix unexpected focus change after a global key binding is activatedChris Feng1-4/+3
* exwm-core.el (exwm--unlock): Select FocusChange events on the root window. * exwm-input.el (exwm-input--on-FocusIn): Input focus should stay on the current workspace when the root window receives a FocusIn event.
2018-02-20 Add Customize interface for simulation keysChris Feng1-29/+91
* exwm-input.el (exwm-input-simulation-keys): New user option for setting simulation keys. (exwm-input--init): Initialize simulation keys from this variable. * exwm-input.el (exwm-input--simulation-prefix-keys) (exwm-input--on-KeyPress-line-mode) (exwm-input--update-simulation-prefix-keys) (exwm-input-set-simulation-keys, exwm-input-set-local-simulation-keys) (exwm-input-send-simulation-key): `exwm-input--simulation-keys' is now a hash table storing both simulation keys and prefix keys. (exwm-input--unset-simulation-keys): Clear the hash table. (exwm-input--exit): Use `exwm-input--unset-simulation-keys'. * exwm-core.el (exwm--kmacro-map, exwm-mode-menu): Adapt to the change of `exwm-input--simulation-keys'. * exwm-config.el (exwm-config-default): Update the example.
2018-02-19 Add customization settingsChris Feng1-82/+125
; Also fix documentations.
2018-02-18 Make X windows container-lessChris Feng1-68/+44
; This is an attempt to make (managed) X windows container-less, i.e. direct children of the root window. This is mainly to make EXWM compatible with third-party compositors. Other issues like wrong absolute position should also get resolved by the way. The workspace containers ("virtual roots") are also removed. However Emacs frames are still wrapped in containers to avoid unexpected stack reordering. * exwm-cm.el: Make this module obsolete as EXWM supports third-party compositors now. * exwm-core.el (exwm--container): * exwm-floating.el (exwm-floating--set-floating) (exwm-floating--unset-floating, exwm-floating-hide) (exwm-floating--start-moveresize, exwm-floating--stop-moveresize) (exwm-floating--do-moveresize, exwm-floating-move): * exwm-input.el (exwm-input--update-focus): * exwm-layout.el (exwm-layout--show, exwm-layout--hide) (exwm-layout-set-fullscreen, exwm-layout-unset-fullscreen): * exwm-manage.el (exwm-manage--manage-window, exwm-manage--unmanage-window) (exwm-manage--kill-buffer-query-function, exwm-manage--kill-client): * exwm-workspace.el (exwm-workspace--set-fullscreen, exwm-workspace-switch) (exwm-workspace-move-window, exwm-workspace--add-frame-as-workspace) (exwm-workspace--remove-frame-as-workspace): Make adaptions for container-less X windows. * exwm-workspace.el (exwm-workspace--update-ewmh-props): * exwm.el (exwm--init-icccm-ewmh, exwm--exit-icccm-ewmh): No longer use virtual roots. * exwm-input.el (exwm-input--on-workspace-list-change) (exwm-input--update-global-prefix-keys, exwm-input--init, exwm-input--exit): From now on global key bindings are grabbed on the root window so it's no long required to re-grab them each time the workspace list changes. As a result `exwm-input--on-workspace-list-change' and its corresponding references are discarded. It remains to be seen if this change will raise input focus issues. * exwm-manage.el (exwm-manage--manage-window): Explicitly set the workspace for newly managed X windows. * exwm-floating.el (exwm-floating--set-floating): Avoid implicit reference to the current workspace. * exwm-core.el (exwm--set-geometry): New function for setting the geometry of an X window. * exwm-layout.el (exwm-layout--resize-container): Replaced by `exwm-layout--resize-container'. * exwm-core.el (exwm--guide-window): New global variable recording the guide X window. * exwm.el (exwm--init-icccm-ewmh): Set it. * exwm-input.el (exwm-input--post-init): New function containing staffs for initialization but should better get called after the event loop starts. * exwm.el (exwm-init): Use it.
2018-01-14 Support key translation in line-modeChris Feng1-0/+15
* exwm-input.el (exwm-input--translate): New function for translating keys according to `input-decode-map', `local-function-key-map' and `key-translation-map'. (exwm-input--cache-event): Use it.
2017-12-31 ; Add missing autoload cookies.Chris Feng1-0/+1
2017-12-31 Add support for `mouse-autoselect-window'Chris Feng1-0/+45
; This feature requires both `mouse-autoselect-window` and ; `focus-follows-mouse' being set. Delaying autoselection is not ; supported yet. * exwm-core.el (exwm--client-event-mask): Select the EnterNotify event on each X window when `mouse-autoselect-window' is set. * exwm-input.el (exwm-input--on-EnterNotify): New function for making `mouse-autoselect-window' work on X windows. (exwm-input--init): Listen to EnterNotify event when `mouse-autoselect-window' is set.
2017-12-31 Update copyright year to 2018Chris Feng1-1/+1
2017-12-10 ; Eliminate a compilation warning.Chris Feng1-10/+10
2017-11-26 Re-grab global keys on keyboard updateChris Feng1-1/+5
* exwm-input.el (exwm-input--on-keysyms-update): New function for re-grabbing global keys. (exwm-input--init): Register it to XELB.
2017-11-24 Another fix for input focus issuesChris Feng1-15/+14
* exwm-core.el (exwm--defer): * exwm-input.el (exwm-input--update-focus-defer): Avoid unnecessarily long delay. * exwm-input.el (exwm-input--on-FocusIn): Filter out FocusIn events generated as a result of grab/ungrab or when the keyboard is grabbed.
2017-11-19 Fix various input focus issuesChris Feng1-18/+19
* exwm-input.el (exwm-input--on-buffer-list-update): Cancel the frame redirection introduced by 421c0512f7. * exwm-input.el (exwm-input--on-buffer-list-update): Only ignore temp buffers just switched from. * exwm-input.el (exwm-input--update-focus-commit): New function for ensuring the input focus lock can always be released. (exwm-input--update-focus-defer, exwm-input--update-focus): Use it. * exwm-input.el (exwm-input--update-focus): No need to select frames; only transfer X input focus. * exwm-core.el (exwm--defer): New macro for correcting the use of `run-with-idle-timer' by taking `current-idle-time' into account. * exwm-input.el (exwm-input--update-focus-defer) (exwm-input--update-focus): * exwm-layout.el (exwm-layout--on-minibuffer-setup) (exwm-layout--on-echo-area-change): * exwm-manage.el (exwm-manage--unmanage-window) (exwm-workspace--prompt-delete): * exwm-workspace.el (exwm-workspace-switch) (exwm-workspace--add-frame-as-workspace): Use it.
2017-11-09 Update the workarounds for `unread-command-events'Chris Feng1-6/+2
* exwm-input.el (exwm-input--unread-event): Update the note. (exwm-input-send-next-key): Remove the workaround.
2017-11-05 Filter out events relating to temp buffersChris Feng1-3/+6
* exwm-input.el (exwm-input--on-buffer-list-update): Filter out events relating to temp buffers by detecting if temp-buffer is present.
2017-09-10 Avoid comparing raw button eventsChris Feng1-26/+6
* 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-04-23 ; Do not cache events for non-`exwm-mode' buffersChris Feng1-3/+5
2017-03-05 ; Update the workaround for bug#23980Chris Feng1-1/+1
2017-02-24 ; Expose `exwm-input-line-mode-passthrough' as a public interface.Chris Feng1-3/+3
2017-02-22 Use let instead of setq when setting exwm-input--line-mode-passthroughSteven Allen1-10/+9
That way, exwm won't clobber user modifications to this variable.
2017-02-05 Fix checkdoc warningsChris Feng1-2/+2
2017-02-05 Update copyright year to 2017Chris Feng1-1/+1
2017-01-03 Prevent certain frame parameters from being saved/restoredChris Feng1-1/+5
* 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.
2016-11-13 Grab global prefix keys with num-lock mask set.Chris Feng1-1/+8
* 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-10-06 Fix a possible deadlockChris Feng1-2/+9
* 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 Fix problems with active minibufferChris Feng1-40/+43
* 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-09-23 Allow selecting an X window from another workspaceChris Feng1-8/+2
* 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-22 Add support for keyboard macroChris Feng1-1/+5
* 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 ; Remove dead codeChris Feng1-13/+11
2016-08-24 Add toggle commandsChris Feng1-0/+10
* exwm-input.el (exwm-input-toggle-keyboard): New command for toggling keyboard mode. * exwm-layout.el (exwm-layout-toggle-fullscreen): New command for toggling fullscreen mode. * exwm-core.el (exwm-mode-menu, exwm-mode-map): Use them.
2016-08-14 Only check input focus for globally active modelChris Feng1-31/+30
* exwm-input.el (exwm-input--set-focus): Partly revert 810b471.
2016-08-09 Update timestamp for WM_TAKE_FOCUS ClientMessageChris Feng1-31/+98
* exwm-input.el (exwm-input--timestamp-window) (exwm-input--timestamp-atom, exwm-input--timestamp-callback): New variables for updating timestamp. (exwm-input--set-focus): Send WM_TAKE_FOCUS ClientMessage with updated timestamp. (exwm-input--update-timestamp): New utility function for fetching timestamp. (exwm-input--on-PropertyNotify): New function for handling PropertyNotify event to extract the timestamp. (exwm-input--init): Create resources for updating timestamp; attach the event listener. (exwm-input--on-ButtonPress, exwm-input--on-KeyPress): * exwm.el (exwm--on-PropertyNotify): No longer update timestamp. * exwm-input.el (exwm-input--set-focus): Avoid setting input focus on already focused X windows, or when the input focus in not on a Emacs frame if globally active model is in use. * exwm-floating.el (exwm-floating--set-floating): * exwm-workspace.el (exwm-workspace-move-window) (exwm-workspace--add-frame-as-workspace, exwm-workspace--init): Set 'exwm-id' frame parameter as the numerical (inner) frame X ID.
2016-08-06 Avoid setting input focus on workspace containersChris Feng1-11/+34
* exwm-input.el (exwm-input--on-FocusIn): Set input focus to the workspace frame when input focus is received by a workspace container. (exwm-input--on-workspace-list-change): Select FocusChange event mask on workspace containers. (exwm-input--init): Attach the event listener; adapt function calls.
2016-08-01 Fix emacsclient issuesChris Feng1-3/+7
* exwm-workspace.el (exwm-workspace--client-p): New function for testing emacsclient frames. (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-input.el (exwm-input--on-buffer-list-update) (exwm-input--on-minibuffer-setup): * exwm-layout.el (exwm-layout--on-minibuffer-setup) (exwm-layout--on-echo-area-change): Use it. * exwm-workspace.el (exwm-workspace--add-frame-as-workspace): Always clear the 'client' frame parameter. (exwm-workspace--init): Fix a typo.
2016-07-31 ; Eliminate compile warningsChris Feng1-1/+1
2016-07-30 Add restart supportChris Feng1-1/+5
* exwm-input.el (exwm-input--exit): Cancel timers. * exwm-manage.el (exwm-manage--manage-window): Add reparented X windows to save-set. * exwm-systemtray.el (exwm-systemtray--embed): Add embeded icons to save-set. * exwm-workspace.el (exwm-workspace--confirm-kill-emacs): No need to unmanage; also hide Emacs frames; always call `exwm--exit'. * exwm.el (exwm-restart): New command for restarting EXWM. (exwm--exit-icccm-ewmh): New function for cleaning up ICCCM/EWMH properties. (exwm-exit-hook): Update doc string. (exwm--exit): Call `exwm--exit-icccm-ewmh' and do not reset variables.
2016-07-30 Grab global keys on newly created workspacesChris Feng1-2/+13
* exwm-input.el (exwm-input--update-global-prefix-keys): Label grabbed workspaces and re-grab keys only when keys change or there are newly created workspaces. (exwm-input--init, exwm-input--exit): Use the function in `exwm-workspace-list-change-hook'.
2016-07-30 Fix input focus transfer between workspacesChris Feng1-4/+10
* exwm-input.el (exwm-input--set-focus): Make input focus revert to parent by default (to prevent input focus from following pointer). * exwm-input.el (exwm-input--update-focus): Switch to another workspace if input focus is transfered to it. * exwm-workspace.el (exwm-workspace--on-focus-in, exwm-workspace--init) (exwm-workspace--exit): Remove `exwm-workspace--on-focus-in' and related uses.
2016-07-29 Sync with XELBChris Feng1-19/+35
* exwm-input.el (exwm-input--update-global-prefix-keys) (exwm-input--on-KeyPress-line-mode, exwm-input--on-KeyPress-char-mode) (exwm-input--fake-key, exwm-input--init): Sync with XELB. * exwm-input.el (exwm-input--on-KeyPress) (exwm-input--on-KeyPress-line-mode): Resend XKB events with SendEvent since AllowEvents in ReplayKeyboard mode doesn't seem to work.
2016-07-26 Always update input focus on entering minibufferChris Feng1-0/+7
* exwm-input.el (exwm-input--on-minibuffer-setup): New function for setting input focus on the workspace frame. (exwm-input--init): Add the function to `minibuffer-setup-hook'. * exwm-workspace.el (exwm-workspace--on-minibuffer-setup): Avoid setting input focus here.
2016-07-25 Minor fixes for past few commitsChris Feng1-1/+1
* exwm-input.el (exwm-input--unread-event): Temporarily disable it due to bug#23980. * exwm-workspace.el (exwm-workspace--init): Set the default frame internal border to 0. * exwm-workspace.el (exwm-workspace--remove-frame-as-workspace): Fix a typo.
2016-07-22 ; * exwm-input.el: Prevent moving/resizing a tiling X window.Chris Feng1-23/+31
2016-07-21 Fix input focus issues revealed by recent commitsChris Feng1-24/+55
* exwm-input.el (exwm-input--update-focus-window) (exwm-input--on-buffer-list-update, exwm-input--update-focus-interval) (exwm-input--update-focus-lock, exwm-input--update-focus-defer-timer) (exwm-input--update-focus-timer, exwm-input--update-focus-defer) (defun exwm-input--update-focus): Rework the input focus update mechanism, mainly to overcome the input focus update contention. * exwm-input.el (defun exwm-input--update-focus): Use `select-window' instead of `exwm-workspace-switch'; calling the latter is too expensive. * exwm-layout.el (exwm-layout--on-minibuffer-setup): Drop a unnecessary line. * exwm-workspace.el (exwm-workspace-switch): Set input focus to the new workspace frame.
2016-07-21 Minor cleanupsChris Feng1-1/+1
; Eliminate compile warnings. ; Rename frame parameter 'exwm--urgency' to 'exwm-urgency'. ; Simplify expressions.