about summary refs log tree commit diff
path: root/exwm-layout.el (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-02-19 Support displaying floating X windows on all workspacesChris Feng1-1/+3
; Setting _NET_WM_DESKTOP to 0xffffffff makes an X windows appearing ; on all desktops (EWMH). It's tricky to do it for tiling X windows ; so it's not implemented. * exwm-core.el (exwm--desktop): New buffer-local variable recording the value of _NET_WM_DESKTOP. * exwm-layout.el (exwm-layout--hide): Do not hide X windows with this property set to 0xffffffff. * exwm.el (exwm--update-desktop): New function for fetching the value of _NET_WM_DESKTOP and setting `exwm--desktop'. * exwm-manage.el (exwm-manage--manage-window): Use it. * exwm-workspace.el (exwm-workspace--set-desktop): Also update `exwm--desktop'.
2018-02-19 Add customization settingsChris Feng1-35/+40
; Also fix documentations.
2018-02-18 Make X windows container-lessChris Feng1-143/+35
; 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-02-04 Avoid crashing Emacs by resizing its frame into 0x0Chris Feng1-2/+2
* exwm-floating.el (exwm-floating--do-moveresize): * exwm-layout.el (exwm-layout-enlarge-window): Resizing a frame into 0x0 crashes Emacs so additional checks are required.
2018-01-14 Raise docks after quitting full screen modeChris Feng1-0/+8
* exwm-layout.el (exwm-layout-unset-fullscreen): Raise docks lowered when entering full screen mode.
2017-12-31 Update copyright year to 2018Chris Feng1-1/+1
2017-11-19 Fix various input focus issuesChris Feng1-5/+4
* 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-02-05 Fix checkdoc warningsChris Feng1-2/+2
2017-02-05 Update copyright year to 2017Chris Feng1-1/+1
2016-09-23 Use X window bordersChris Feng1-3/+7
; 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 Remember the geometries of floating X windowsChris Feng1-0/+2
* exwm-floating.el (exwm-floating--stop-moveresize): * exwm-layout.el (exwm-layout-enlarge-window): Update the geometry after resizing.
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-12 Check for _NET_WM_STATE_FULLSCREEN on managingChris Feng1-4/+5
* exwm-core.el (exwm--fullscreen): Removed. (exwm--ewmh-state): New variable for recording the _NET_WM_STATE hint. * exwm-core.el (exwm-mode-menu, exwm-mode-map): * exwm-layout.el (exwm-layout-set-fullscreen) (exwm-layout-unset-fullscreen): * exwm-manage.el (exwm-manage--unmanage-window) (exwm-manage--on-ConfigureRequest): * exwm-workspace.el (exwm-workspace-switch, exwm-workspace-swap) (exwm-workspace-move): * exwm.el (exwm-reset, exwm--on-ClientMessage): Use the new variable. * exwm-manage.el (exwm-manage--update-ewmh-state): New function for updating _NET_WM_STATE. (exwm-manage--manage-window): Update _NET_WM_STATE and check for _NET_WM_STATE_FULLSCREEN.
2016-08-10 Adapt for the changes in `window-configuration-change-hook'Chris Feng1-4/+10
* exwm-layout.el (exwm-layout--refresh): Accept frame as an optional argument. (exwm-layout--init): Add `exwm-layout--refresh' to `window-size-change-functions' when appropriate.
2016-08-06 * exwm-layout.el (exwm-layout--show): Fix the position of floatingChris Feng1-15/+23
X windows.
2016-08-01 Fix emacsclient issuesChris Feng1-3/+5
* 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-21 Fix input focus issues revealed by recent commitsChris Feng1-3/+1
* 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-19 Fix various minor issuesChris Feng1-1/+1
; Coding style fixes * exwm-core.el (exwm-mode-menu exwm-mode-map): Use `exwm-workspace--count'. * exwm-workspace.el (exwm-workspace--set-fullscreen) (exwm-workspace--on-focus-in, exwm-workspace--set-desktop): Use `exwm-workspace--position'. * exwm-workspace.el (exwm-workspace-swap, exwm-workspace-move): Renamed from `exwm-workspace-swap-workspace' and `exwm-workspace-move-workspace'. * exwm-workspace.el (exwm-workspace--update-ewmh-props): Update comments. * exwm-workspace.el (exwm-workspace--switch-map-nth-prefix): Fix a calculation. * exwm-workspace.el (exwm-workspace-switch): Fix a potential timer problem. * exwm-workspace.el (exwm-workspace-swap, exwm-workspace-move) (exwm-workspace--remove-frame-as-workspace): Update workspace and clients involved. * exwm-workspace.el (exwm-workspace--remove-frame-as-workspace): Remove workspace first.
2016-07-17 Work with workspace frames instead of indicesAdrián Medraño Calvo1-4/+2
* 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-2/+3
* 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-1/+2
* 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/+8
* exwm-systemtray.el : * exwm-manage.el : * exwm-layout.el : * exwm-input.el : * exwm-floating.el : * exwm-core.el : Add missing function declarations.
2016-07-16 Add RandR support for docks and reuse workareasChris Feng1-5/+9
* exwm-workspace (exwm-workspace--update-struts): Add RandR support for docks. * exwm-workspace (exwm-workspace--workareas): New variable for storing workareas. (exwm-workspace--update-workareas): Update workareas and set _NET_WORKAREA (replaces `exwm-workspace--set-workareas'). (exwm-workspace--set-fullscreen): Reuse workareas for resizing and drop optional arguments. (exwm-workspace--resize-minibuffer-frame) (exwm-workspace--on-ConfigureNotify): Reuse workareas for resizing/reposition the (optional) dedicated minibuffer frame. * exwm-layout.el (exwm-layout-set-fullscreen): Do not use `exwm-workspace--set-fullscreen' here. * exwm-manage.el (exwm-manage--unmanage-window): * exwm-randr.el (exwm-randr--refresh): * exwm.el (exwm--update-struts-legacy, exwm--update-struts-partial): Update workareas before resizing workspaces. * exwm.el (exwm--update-struts-legacy, exwm--update-struts-partial): Remove the corresponding record on receiving invalid struts. * exwm-workspace.el (exwm-workspace--get-geometry): New utility function for retrieving workspace geometry.
2016-07-15 Add multi-dock support and fix fullscreen issues with dockChris Feng1-2/+23
* exwm.el (exwm--update-strut-legacy, exwm--update-strut-partial) (exwm--update-strut): Rename (strut => struts). * exwm-manage.el (exwm-manage--manage-window): Listen for UnmapNotify/DestroyNotify events of docks to stop tracking them. (exwm-manage--unmanage-window): Remove dock from tracking list when it's unmapped/destroyed. * exwm-workspace.el (exwm-workspace--id-struts-alist): New variable for tracking docks. (exwm-workspace--struts): Now it stores merged struts. (exwm-workspace--update-struts): New function for doing the 'merge'. * exwm.el (exwm--update-struts-legacy, exwm--update-struts-partial): Now update struts for multiple docks. * exwm-layout.el (exwm-layout-set-fullscreen) (exwm-layout-unset-fullscreen): * exwm-manage.el (exwm-manage--unmanage-window): Fix fullscreen mode with dock. * exwm-workspace.el (exwm-workspace--set-fullscreen): Add optional arguments for ignoring struts / resizing container only. (exwm-workspace-switch): Restack workspace/docks appropriately.
2016-07-13 Add/improve some ICCCM/EWMH featuresChris Feng1-25/+43
* 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 Add initial support for dock (panel) applicationsChris Feng1-28/+0
* exwm-layout.el (exwm-layout--fullscreen-frame-count) (exwm-layout--set-frame-fullscreen): Moved to workspace module. * exwm-workspace.el (exwm-workspace--fullscreen-frame-count) (exwm-workspace--set-fullscreen): Moved from layout module. * exwm-manage.el (exwm-manage--manage-window): Update struts for dock applications. * exwm-workspace.el (exwm-workspace--strut) (exwm-workspace--strut-is-partial): New variables for storing struts. (exwm-workspace--resize-minibuffer-frame) (exwm-workspace--on-ConfigureNotify): Take struts into consideration. * exwm.el (exwm--update-strut-legacy, exwm--update-strut-partial) (exwm--update-strut): New functions for updating _NET_WM_STRUT or _NET_WM_STRUT_PARTIAL. (exwm--on-PropertyNotify): Update struts on corresponding event. (exwm--init-icccm-ewmh): Declare _NET_WM_STRUT and _NET_WM_STRUT_PARTIAL as supported. * exwm-workspace.el (exwm-workspace--update-workareas): Dedicated function for updating _NET_WORKAREA. * exwm-randr.el (exwm-randr--refresh): * exwm-workspace.el (exwm-workspace--init): Use `exwm-workspace--update-workareas'. * exwm.el (exwm--init-icccm-ewmh): Do not set _NET_WORKAREA here.
2016-06-17 * exwm-layout.el (exwm-layout--show): Resize the X windowChris Feng1-5/+6
if the minibuffer is active but with line height 1.
2016-05-23 Add cleanup codes for Emacs daemonChris Feng1-1/+13
* 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-04-03 Some commands should be called interactivelyChris Feng1-3/+3
* exwm-layout.el (exwm-layout-set-fullscreen, exwm-layout-unset-fullscreen) (exwm-layout-show-mode-line): * exwm.el (exwm-reset): Call `exwm-input-grab-keyboard' and `exwm-input-release-keyboard' interactively.
2016-03-25 Fix emacsclient issuesChris Feng1-6/+9
* exwm-layout.el (exwm-layout--on-minibuffer-setup) (exwm-layout--on-echo-area-change): * exwm-workspace.el (exwm-workspace--on-minibuffer-setup) (exwm-workspace--on-minibuffer-exit, exwm-workspace--on-echo-area-dirty) (exwm-workspace--on-echo-area-clear): Exclude non-graphical frames. * exwm.el (exwm--server-eval-at): Avoid using `x-dispaly-name'.
2016-03-19 Restore a sensible buffer when replacing EXWM buffersAdrián Medraño Calvo1-21/+50
* exwm-layout.el (exwm-layout--other-buffer-exclude-exwm-mode-buffers) (exwm-layout--other-buffer-exclude-buffers): New variables. (exwm-layout--other-buffer-predicate): Allow excluding EXWM buffers or buffers from a given set. (exwm-layout--refresh): Replace EXWM buffers with sensible buffers depending on the situation. When in non-workspace/non-floating frames, with some non-EXWM buffer; when the EXWM buffer is displayed elsewhere, some buffer previously displayed in that window (making sure it has been recently covered).
2016-03-19 Use `buffer-predicate' frame parameter to prevent switching to visible EXWM ↵Adrián Medraño Calvo1-0/+11
buffers * exwm-layout.el (exwm-layout--other-buffer-predicate): New function to be set as `buffer-predicate' frame parameter. * exwm-workspace.el (exwm-workspace--init): Use above function on workspace frames.
2016-03-19 Set the correct buffer before checking the `major-mode'Adrián Medraño Calvo1-7/+7
* exwm-layout.el (exwm-layout--refresh): Make sure we test the `major-mode' of the first buffer of the floating frame.
2016-03-19 Minor cleanupAdrián Medraño Calvo1-4/+4
* exwm-layout.el (exwm-layout--refresh): Reuse car.
2016-03-16 Exclude unmanaged floating X windows when refreshingChris Feng1-2/+4
* exwm-layout.el (exwm-layout--refresh): Do not show unmanaged floating X windows.
2016-03-07 Restack fullscreen X windowsChris Feng1-7/+22
* exwm-layout.el (exwm-layout-set-fullscreen) (exwm-layout-unset-fullscreen): Raise and lower fullscreen X windows respectively.
2016-02-26 Do not wait for WM_STATE property eventsChris Feng1-21/+22
* exwm-layout.el (exwm-layout--show, exwm-layout--hide): Save the state directly.
2016-02-26 Minor fixes for layout and workspaceChris Feng1-1/+2
* exwm-layout.el (exwm-layout-show-mode-line): Force update mode-line. * exwm-workspace.el (exwm-workspace--update-minibuffer): Treat nil as empty string.
2016-02-20 Prevent Emacs frames from restacking themselvesChris Feng1-33/+55
Putting Emacs frames (workspace frames, floating frames) into dedicated containers greatly simplifies the stacking order management and totally fixes relevant issues. * exwm-floating.el (exwm-floating--set-floating): Create floating frame container. Remove redundant stacking order modification code. (exwm-floating--unset-floating): Destroy the floating frame container. No need to reparent the X window container. (exwm-floating--do-moveresize): Resize the floating frame container. * exwm-input.el (exwm-input--update-focus): No need to restack frames. * exwm-layout.el (exwm-layout--show, exwm-layout--set-frame-fullscreen) (exwm-layout-enlarge-window): Resize the floating frame container. * exwm-manage.el (exwm-manage--on-ConfigureRequest): Re-enable stacking order modification on ConfigureRequest. * exwm-workspace.el (exwm-workspace--confirm-kill-emacs): Reparent out all frames on exit. No need to remove selected events or created resources. (exwm-workspace--init): Create workspace frame containers. * exwm-layout.el (exwm-layout-set-fullscreen): * exwm-manage.el (exwm-manage--unmanage-window): Remove a redundant call to `xcb:flush'. * exwm-manage.el (exwm-manage--unmanage-window): Force unmap the X window. Unmap the floating frame before reparent it.
2016-02-20 Prevent/Reduce flickering issues with floating X windowsChris Feng1-9/+10
* exwm-floating.el (exwm-floating--set-floating) (exwm-floating--unset-floating): Prevent flickering when creating/removing a floating X window. * exwm-layout.el (exwm-layout--show): Show X windows after resizing to prevent flickering. * exwm-manage.el (exwm-manage--unmanage-window): Reduce flickering by hiding the container. (exwm-manage--kill-buffer-query-function): Prevent flickering by hiding the container (except that the X window destroys itself after receiving the WM_DELETE_WINDOW client message).
2016-02-19 Fix system tray issues after updating workspacesChris Feng1-7/+17
* exwm-workspace.el (exwm-workspace-switch-hook): New hook run by `exwm-workspace-switch'. * exwm-randr.el (exwm-randr-refresh-hook): New hook run by `exwm-randr--refresh'. * exwm-systemtray.el (exwm-systemtray--on-randr-refresh) (exwm-systemtray--on-workspace-switch, exwm-systemtray--init): Update the system tray in `exwm-randr-refresh-hook' and `exwm-workspace-switch-hook'. * exwm-layout.el (exwm-layout--set-frame-fullscreen): * exwm-workspace.el (exwm-workspace--post-init): Wait until all workspace frames are set fullscreen. * exwm-workspace.el (exwm-workspace--current-width) (exwm-workspace--current-height): New functions for retrieving the width and height of the current workspace. * exwm-layout.el (exwm-layout-set-fullscreen): * exwm-manage.el (exwm-manage--manage-window) (exwm-manage--on-ConfigureRequest): * exwm-systemtray.el (exwm-systemtray--refresh, exwm-systemtray--init): * exwm-workspace.le (exwm-workspace--resize-minibuffer-frame) (exwm-workspace--on-ConfigureNotify): Switch to `exwm-workspace--current-width' and `exwm-workspace--current-height'. * exwm-core.el: * exwm-floating.el: * exwm-floating.el: * exwm-input.el: * exwm-layout.el: * exwm-manage.el: * exwm-randr.el: * exwm-systemtray.el: * exwm-workspace.el: * exwm.el: Clean up loading file. Set/Unset some functions as commands. * README.md: Add intro to system tray.
2016-02-18 Fix floating X window bugs introduced by 9c95c03eChris Feng1-11/+18
* exwm-floating.el (exwm-floating--set-floating): Make floating frames invisible before resizing them. (exwm-floating--fit-frame-to-window): Removed since unused. * exwm-layout.el (exwm-layout-hide-mode-line, exwm-layout-show-mode-line): Use set frame height instead of exwm-floating--fit-frame-to-window. * exwm-core.el (exwm-mode): Replace `exwm-manage--close-window' with `exwm-manage--kill-buffer-query-function'. * exwm-floating.el (exwm-floating--unset-floating): Reparent out floating frames. * exwm-manage.el (exwm-manage--unmanage-window): Reparent out floating frames. Hide floating frames. (exwm-manage--close-window, exwm-manage--kill-buffer-query-function): Rename `exwm-manage--close-window' since it's only used in `kill-buffer-query-functions'. Reparent out floating frames.
2016-02-07 Eliminate compilation warningsChris Feng1-0/+1
2016-02-07 Add some useful key bindingsChris Feng1-0/+33
* exwm-core.el (exwm--floating-mode-line-format, exwm--mode-line-format) (exwm-mode-map): * exwm-floating.el (exwm-floating-hide-mode-line) (exwm-floating-show-mode-line): * exwm-layout.el (exwm-layout-hide-mode-line, exwm-layout-show-mode-line) (exwm-layout-toggle-mode-line): Allow hide/show mode-line for all `exwm-mode' buffers with 'C-c M'. * exwm-config.el (exwm-config-default): Add simulation keys for 'C-d' and 'C-k'.
2016-02-06 Resize minibuffer only when it's in its own frameFelix Lange1-3/+4
0e4055d3392 introduced a few calls to exwm-workspace--resize-minibuffer in various places. This function only works when the minibuffer is displayed in its own frame but was called unconditionally in some cases. Fix it by wrapping all calls in an appropriate conditional and add an assertion. Also rename the function so it is clearer that it resizes a frame, which might prevent calling it unconditionally in the future.
2016-02-06 Improve bc80eefeChris Feng1-0/+2
* exwm-layout.el (exwm-layout--set-frame-fullscreen): * exwm-randr.el (exwm-randr--refresh): * exwm-workspace.el (exwm-workspace--resize-minibuffer): (exwm-workspace-switch): * exwm.el (exwm--on-ClientMessage): Calling `exwm-workspace-switch' in bc80eefe does not work correctly sometimes. This commit improves it by directly specify the geometry info rather than getting it from Emacs frame.
2016-02-06 Add auto-hiding minibuffer supportChris Feng1-6/+19
* exwm-floating.el (exwm-floating--set-floating): Take auto-hiding minibuffer into account when calculating available height. (exwm-floating--unset-floating): Restack the container to avoid further restacking. * exwm-input.el (exwm-input--update-focus): Use more accurate restacking. (exwm-input--on-minibuffer-setup): Replaced by `exwm-layout--on-minibuffer-setup' and `exwm-workspace--on-minibuffer-setup'. (exwm-input-command-whitelist, exwm-input--during-command) (exwm-input--on-KeyPress-line-mode): The functionality of `exwm-input-command-whitelist' is replaced by `exwm-input--during-command', which can automatically tell whether functions like `read-event' are being called. (exwm-input--init): Add/remove corresponding hooks. * exwm-layout.el (exwm-layout--on-minibuffer-setup): Also set input focus. (exwm-layout--on-echo-area-change): New function for refreshing layout when the size of echo area changes. (exwm-layout--init): Track size changes for fixed minibuffer and echo area. * exwm-manage.el (exwm-manage--on-ConfigureRequest): Never grant restacking requests initiated by other clients. * exwm-workspace.el (exwm-workspace--minibuffer): New variable for the auto-hiding minibuffer. (exwm-workspace-minibuffer-position): For setting the position of the auto-hiding minibuffer. (exwm-workspace-display-echo-area-timeout): Seconds before echo area auto-hides. (exwm-workspace--display-echo-area-timer): The corresponding timer. (exwm-workspace-switch): Configure the auto-hiding minibuffer when switching workspace. (exwm-workspace--update-minibuffer): New function for adjusting the height of the auto-hiding minibuffer. (exwm-workspace--on-ConfigureNotify): New function for configuring the container of the auto-hiding minibuffer. (exwm-workspace--display-buffer): New function for forcing `minibuffer-completion-help' to use the workspace frame. (exwm-workspace--show-minibuffer, exwm-workspace--hide-minibuffer): New functions for showing/hiding the auto-hiding minibuffer (container). (exwm-workspace--on-minibuffer-setup, exwm-workspace--on-minibuffer-exit): New functions called when the auto-hiding minibuffer entered/exists. (exwm-workspace--on-echo-area-dirty, exwm-workspace--on-echo-area-clear): New functions when the auto-hiding echo area is ready to show/hide. (exwm-workspace--init): Set up the auto-hiding minibuffer and workspace frames. Track sizes changes for auto-hiding minibuffer and echo area. No need to set OverrideRedirect on workspace frames. * exwm.el (exwm--init-icccm-ewmh): Correct the value of _NET_WORKAREA.
2016-02-03 Merge branch 'feat/virtual-root'Chris Feng1-82/+75
2016-02-03 Rework the X windows hierarchy modelChris Feng1-82/+75
This commit add workspace and X window containers support to avoid using Emacs frames as the parents of X windows. This should make it easier to set input focus. * exwm-core.el (exwm--container, exwm--floating-frame-position): New file local variables. (exwm--floating-frame-geometry): Removed file local variable. * exwm-floating.el (exwm-floating--set-floating) (exwm-floating--unset-floating, exwm-floating--do-moveresize) (exwm-floating-move): Use container. (exwm-floating--fit-frame-to-window): No longer adjust stacking order. (exwm-floating--fit-frame-to-window): The first member is changed to buffer. (exwm-floating--start-moveresize): Use container. Correctly set input focus. * exwm-input.el (exwm-input--redirected, exwm-input--on-focus-in): Removed. (exwm-input--on-buffer-list-update): Remove the restriction on floating frames which is no longer valid. (exwm-input--update-focus): Adjust stacking order. (exwm-input--on-minibuffer-setup): New function for setting focus on the Emacs frame when entering minibuffer. (exwm-input--on-KeyPress-line-mode): No longer compensate FocusOut event. (exwm-input--grab-keyboard, exwm-input--release-keyboard): Local keys are now grabbed on the X window container. (exwm-input--init): Add `exwm-input--on-minibuffer-setup' to `minibuffer-setup-hook'. * exwm-layout.el (exwm-layout--resize-container): New function to resize/reposition both the X window and its container. (exwm-layout--show, exwm-layout--hide): Use container. (exwm-layout-set-fullscreen): Use container. No longer save width and height. (exwm-layout-unset-fullscreen, exwm-layout--set-frame-fullscreen): Use container. (exwm-layout--refresh): Update a frame parameter. Remove dead code. * exwm-manage.el (exwm-manage--manage-window): Reparent unmanaged X windows to the workspace. Create X window container as the parent of the X window. (exwm-manage--unmanage-window): Unmap/destroy container when appropriate. Use the position of container. (exwm-manage--unmanage-window): Destroy the container. * exwm-randr.el (exwm-randr--refresh): Resize workspace using container. * exwm-workspace.el (exwm-workspace-switch): Raise workspace. Correctly set input focus. (exwm-workspace--on-focus-in): Removed. (exwm-workspace-move-window): Reparent to workspace container. (exwm-workspace--init): Create workspace frames as visible. Create workspace containers. Remove exwm-workspace--on-focus-in from focus-in-hook. Update _NET_VIRTUAL_ROOTS. * exwm.el (exwm-init): No longer disable hourglass window. Initialize workspace module before input. * exwm-core.el (exwm--debug): New macro for setting debug forms. * exwm-floating.el (exwm-floating--set-floating): No longer do `exwm--lock' and `exwm--unlock' since `make-frame' is already adviced to take care of everything. Correctly set input focus to the newly created floating X window. * exwm-core.el (exwm--floating-edges): Removed file local variable. * exwm-floating.el (exwm-floating--set-floating) (exwm-floating--unset-floating): * exwm-layout.el (exwm-layout--show, exwm-layout-enlarge-window): * exwm-manage.el (exwm-manage--on-ConfigureRequest): No longer use floating geometry. * exwm-input.el (exwm-input--update-global-prefix-keys): Grab global keys on workspaces containers instead of the root window (or input focus would transfer to the workspace containing the pointer when the grab is active). * exwm-workspace.el (exwm-workspace-switch): No longer move mouse.
2016-02-02 Update copyright year to 2016Chris Feng1-1/+1