about summary refs log tree commit diff
path: root/exwm-input.el (follow)
AgeCommit message (Collapse)AuthorFilesLines
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.
2016-07-19 Add support for attachable/detachable minibufferChris Feng1-18/+5
* exwm-workspace.el (exwm-workspace--update-minibuffer-height): Renamed from `exwm-workspace--update-minibuffer' to better reflect its usage. * exwm-input.el (exwm-input--update-focus): Directly put the floating X window at top since the minibuffer is no longer a sibling. * exwm-workspace.el (exwm-workspace--resize-minibuffer-frame): Calculate position in absolute coordinate; put minibuffer at bottom by default; resize the minibuffer frame with ConfigureWindow rather than `set-frame-width'. (exwm-workspace-switch): No need to reparent minibuffer any more. (exwm-workspace--on-ConfigureNotify): Calculate position in absolute coordinate. (exwm-workspace--show-minibuffer, exwm-workspace--hide-minibuffer): Show/Hide the minibuffer by adjusting the stacking order rather than mapping/unmapping. (exwm-workspace--init): Map the minibuffer frame container on creation. * exwm-workspace.el (exwm-workspace--minibuffer-attached-p): New function telling whether the minibuffer is attached. (exwm-workspace--attached-minibuffer-height): New variable storing the height of the attached minibuffer. (exwm-workspace-attach-minibuffer, exwm-workspace-detach-minibuffer): New functions for attaching/detaching the minibuffer. * exwm-workspace.el (exwm-workspace--show-minibuffer): Remove the workaround for minibuffer cursor (seems fixed).
2016-07-17 Work with workspace frames instead of indicesAdrián Medraño Calvo1-6/+4
* exwm.el (exwm--on-ClientMessage): * exwm-workspace.el (exwm-workspace-switch) (exwm-workspace-move-window, exwm-workspace-switch-to-buffer): * exwm-layout.el (exwm-layout--refresh): * exwm-input.el (exwm-input--update-focus) (exwm-input--on-ButtonPress): Accept frame as well as workspace index as argument. * exwm-workspace.el (exwm-workspace--workspace-from-frame-or-index): New function.
2016-07-17 New function exwm-workspace--workspace-pAdrián Medraño Calvo1-1/+2
* exwm-workspace.el (exwm-workspace--workspace-p): New function. * exwm-input.el (exwm-input--on-ButtonPress): * exwm-workspace.el (exwm-workspace-switch): * exwm-layout.el (exwm-layout--refresh): Use it.
2016-07-17 Add `exwm-workspace--position' helperAdrián Medraño Calvo1-2/+3
* exwm-workspace.el (exwm-workspace--position): New function. * exwm-layout.el (exwm-layout--refresh): * exwm-input.el (exwm-input--on-ButtonPress): * exwm-workspace.el (exwm-workspace--update-switch-history): * exwm.el (exwm--on-ClientMessage, exwm-workspace--init): Use it.
2016-07-17 Add missing declarationsAdrián Medraño Calvo1-0/+3
* exwm-systemtray.el : * exwm-manage.el : * exwm-layout.el : * exwm-input.el : * exwm-floating.el : * exwm-core.el : Add missing function declarations.
2016-07-17 Add major mode menuChris Feng1-1/+5
* exwm-core.el (exwm--keyboard-grabbed): New buffer-local variable for recoding grabbing state. (exwm-mode-menu, exwm-mode-map): Add major mode menu. * exwm-input.el (exwm-input-set-key): Update prefix keys when a global binding is interactively set. (exwm-input-grab-keyboard, exwm-input-release-keyboard): Update grabbing state.
2016-07-15 Fix a `unread-command-events' issue for Emacs 24Chris Feng1-2/+14
* exwm-input.el (exwm-input--unread-event) (exwm-input--on-KeyPress-line-mode): Use `unread-command-events' differently on Emacs 24 and 25.
2016-07-14 Fix various stability issuesChris Feng1-2/+4
* exwm-input.el (exwm-input--on-KeyPress-line-mode) (exwm-input--on-KeyPress-char-mode): Append events at the tail. * exwm-manage.el (exwm-manage--unmanage-window): Remove the _NET_WM_DESKTOP property when an X window is withdrawn. * exwm-systemtray.el (exwm-systemtray--init): * exwm-workspace.el (exwm-workspace--confirm-kill-emacs): Issue warning rather than error when there's an existing tray running. * exwm.el (exwm--on-ClientMessage): The buffer window can be on a floating frame.
2016-07-13 Add/improve some ICCCM/EWMH featuresChris Feng1-1/+18
* exwm-floating.el (exwm-floating--set-allowed-actions) (exwm-floating--set-floating, exwm-floating--unset-floating): Add _NET_WM_ALLOWED_ACTIONS support. * exwm-floating.el (exwm-floating--set-floating) (exwm-floating--unset-floating): Support initial state hint. * exwm.el (exwm--update-hints): Fetch initial state. (exwm--update-state, exwm--on-PropertyNotify): WM_STATE is not intended to be read. * exwm-core.el (exwm-state): * exwm-floating.el (exwm-floating-hide): * exwm-input.el (exwm-input--update-focus): * exwm-layout.el (exwm-layout--set-state) (exwm-layout--iconic-state-p, exwm-layout--show, exwm-layout--hide): * exwm-manage.el (exwm-manage--on-MapRequest): Improve WM_STATE support. * exwm-input.el (exwm-input--set-focus): * exwm-input.el (exwm-input--update-focus) (exwm-input--set-active-window): * exwm.el (exwm--on-ClientMessage): Add _NET_ACTIVE_WINDOW support. * exwm-layout.el (exwm-layout--set-client-list-stacking): Improve _NET_CLIENT_LIST_STACKING support. * exwm-manage.el (exwm-manage--set-client-list) (exwm-manage--manage-window, exwm-manage--unmanage-window): Improve _NET_CLIENT_LIST support. * exwm-manage.el (exwm-manage--manage-window): * exwm-workspace.el (exwm-workspace--set-desktop) (exwm-workspace-move-window): * exwm.el (exwm--on-ClientMessage): Add _NET_WM_DESKTOP support. * exwm-randr.el (exwm-randr--refresh): * exwm-workspace.el (exwm-workspace--set-desktop-geometry) (exwm-workspace--init): Add _NET_DESKTOP_GEOMETRY support. * exwm-workspace.el (exwm-workspace--set-desktop-geometry): Renamed from `exwm-workspace--update-desktop-geometry'. * exwm-randr.el (exwm-randr--refresh): Improve _NET_WORKAREA support. * exwm-workspace.el (exwm-workspace--set-fullscreen): Correct variables names. * exwm-workspace.el (exwm-workspace--init): * exwm.el (exwm--init-icccm-ewmh): Set _NET_NUMBER_OF_DESKTOPS in workspace module. * exwm-workspace.el (exwm-workspace--init): * exwm.el (exwm--init-icccm-ewmh): Set _NET_DESKTOP_VIEWPORT in workspace module. * exwm.el (exwm--on-ClientMessage): Improve _NET_CURRENT_DESKTOP support. * exwm.el (exwm--on-ClientMessage): Add _NET_CLOSE_WINDOW support. * exwm.el (exwm--on-ClientMessage): Add WM_CHANGE_STATE support. * exwm.el (exwm--init-icccm-ewmh): Update supported atoms.
2016-07-12 * exwm-input.el (exwm-input--on-KeyPress-char-mode): No need toChris Feng1-3/+1
force events to be added to `this-command-keys' (and it causes problems).
2016-07-12 Fix a bug of simulation keysChris Feng1-2/+8
* exwm-input.el (exwm-input--on-KeyPress-line-mode) (exwm-input--on-KeyPress-char-mode): Force events to be added to `this-command-keys'. (exwm-input-send-next-key): The read event can now be (t . EVENT).
2016-06-17 Allow buffer-local simulation keysChris Feng1-1/+16
* exwm-input.el (exwm-input-set-local-simulation-keys): New function for setting buffer-local simulation keys. (exwm-input--local-simulation-keys): New internal variable. (exwm-input--update-simulation-prefix-keys): Modify either `exwm-mode-map' or the local keymap accordingly.
2016-05-24 * exwm-input.el (exwm-input--update-focus): Do not update input focusChris Feng1-1/+7
when there's an active minibjffer
2016-05-23 Add cleanup codes for Emacs daemonChris Feng1-3/+17
* exwm-floating.el (exwm-floating--exit): * exwm-input.el (exwm-input--exit): * exwm-layout.el (exwm-layout--exit): * exwm-manage.el (exwm-manage--exit): * exwm-randr.el (exwm-randr--exit): * exwm-systemtray.el (exwm-systemtray--exit): * exwm-workspace.el (exwm-workspace--exit): New functions for cleanup each module. * exwm-input.el (exwm-input--on-pre-command, exwm-input--on-post-command) (exwm-input--init): Name lambda functions. * exwm-layout.el (exwm-layout--timer, exwm-layout--init): Save timer. * exwm-randr.el (exwm-randr-enable): Register the cleanup function. * exwm-systemtray.el (exwm-systemtray--init): Force refresh atoms in XEMBED and system tray protocols. (exwm-systemtray-enable): Register the cleanup function. * exwm-workspace.el (exwm-workspace--client): Save the server process. (exwm-workspace--confirm-kill-emacs): Add emacsclient-specific cleanup codes. (exwm-workspace--timer): Save the timer. (exwm-workspace--init): Save the server process and timer; fix problems with emacsclient frames. * exwm.el (exwm-init): Always select the newly created frame; force refresh ICCCM & EWMH atoms. (exwm-exit-hook): New hook for holding cleanup codes. (exwm--exit): Run `exwm-exit-hook', execute cleanup codes for each module and reset the environment.
2016-03-08 Use `cl-case' instead of `case'Chris Feng1-1/+1
2016-03-07 Change input mode of window being clickedAdrián Medraño Calvo1-28/+44
When clicking a mode-line of other window to switch the EXWM input mode, `window-buffer' does not return the window whose mode-line has been clicked, but the current one. This change ensures that the right window has its input mode and mode-line updated. * exwm-input.el (exwm-input--update-mode-line): Factor out setting `mode-line-process'. (exwm-input--grab-keyboard, exwm-input--release-keyboard) (exwm-input-grab-keyboard, exwm-input-release-keyboard): Make sure the buffer of the window being clicked has its input mode updated.
2016-03-01 Avoid unnecessary input focus changes in line-modeChris Feng1-6/+2
* exwm-input.el (exwm-input--grab-keyboard, exwm-input--release-keyboard): Grab keys on X windows instead to prevent unexpected input focus changes. * exwm-workspace.el (exwm-workspace--show-minibuffer): The workaround for cursor flickering issue is no more needed.
2016-02-23 Make input focus revert to pointer rootChris Feng1-1/+2
* exwm-input.el (exwm-input--set-focus): Input focus should not revert to parent (which was the Emacs frame) any more.