Commit graph

106 commits

Author SHA1 Message Date
Chris Feng
fc542bbcc9 ; Eliminate compile warnings 2016-07-31 13:16:51 +08:00
Chris Feng
a3dba8edd9 Fix restarting issues
* exwm-workspace.el (exwm-workspace--confirm-kill-emacs):
* exwm.el (exwm-restart): Run `kill-emacs-hook' early; do not check for
X windows before restarting.
2016-07-31 13:14:43 +08:00
Chris Feng
1e78045f95 Add restart support
* 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 19:01:33 +08:00
Chris Feng
8061e93878 ; * exwm-workspace.el (exwm-workspace-switch): Input focus should be set
; on the frame where the target window resides.
2016-07-30 18:57:27 +08:00
Taichi Uemura
0b0982b5ac set fullscreen-frame-count to 0 on exiting 2016-07-30 18:48:09 +09:00
Chris Feng
d225f191a9 Fit the *Completions* buffer
* exwm-workspace.el (exwm-workspace--on-minibuffer-setup): Work around
the *Completions* buffer not getting fitted problem.

* exwm.el (exwm-enable): Enable `window-resize-pixelwise'.
2016-07-30 10:17:57 +08:00
Chris Feng
6bfedf8bf7 Fix input focus transfer between workspaces
* 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-30 10:00:11 +08:00
Chris Feng
e6bf1b45ad Always update input focus on entering minibuffer
* 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-26 21:42:22 +08:00
Chris Feng
f4d89d7e2f Minor fixes for past few commits
* 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-25 12:14:26 +08:00
Chris Feng
6ecd8b921f Fix issues with deleting the last workspace
* exwm-workspace.el (exwm-workspace-delete): Prevent deleting the last
workspace.

* exwm-workspace.el (exwm-workspace--remove-frame-as-workspace): Create
a new workspace if the last one is deleted.
2016-07-22 12:29:01 +08:00
Chris Feng
d86db3edd6 Add minibuffer toggle command
* exwm-workspace.el (exwm-workspace-toggle-minibuffer): Add minibuffer
toggle command.

* exwm-core.el (exwm-mode-menu, exwm-mode-map): Substitute minibuffer
attach/detach commands with minibuffer toggle command.

* exwm-workspace.el (exwm-workspace-toggle-minibuffer): Insert various
auto load cookies.
2016-07-22 12:26:29 +08:00
Chris Feng
86777c54f3 Improve the performance of workspace creation
* exwm-workspace.el (exwm-workspace--add-frame-as-workspace): Do not run
`exwm-workspace-list-change-hook' when create workspace in the background.
(exwm-workspace-switch-create): Run the hook once.
(exwm-workspace--prompt-add): Run the hook.
2016-07-21 13:02:07 +08:00
Chris Feng
76ced38ae4 Fix input focus issues revealed by recent commits
* 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 12:51:37 +08:00
Chris Feng
0c114d97b7 Fix workspace creation and deletion
* exwm-workspace.el (exwm-workspace-switch)
(exwm-workspace-switch-create): Move support for creating missing
workspaces from the former to the latter..
(exwm-workspace-switch-create-limit): New variable limiting the number
of new workspaces allowed to create each time.

* exwm-workspace.el (exwm-workspace--prompt-add)
(exwm-workspace--prompt-delete): New commands for adding and deleting
workspaces from the `read-from-minibuffer' prompt.
(exwm-workspace--prompt-add-allowed)
(exwm-workspace--prompt-delete-allowed): New variables telling whether
the above two commands are allowed to run.
(exwm-workspace--switch-map): Change "+" / "-" to use the new commands.
* exwm-workspace.el (exwm-workspace-switch, exwm-workspace-swap)
(exwm-workspace-move-window): Use this new feature.

* exwm-workspace.el (exwm-workspace-add, exwm-workspace-delete): Since
they are not used by the keymap any more, drop the use of idle timer.

* exwm-workspace.el (exwm-workspace--create-silently): New variable
indicating whether new workspaces should be created in the background.
(exwm-workspace--add-frame-as-workspace): Support creating new
workspaces in the background.

* exwm-workspace.el (exwm-workspace--on-ConfigureNotify):
Update workareas if it's not up to date.

* exwm-randr.el (exwm-randr--refresh): Raise the standalone minibuffer
when refreshed.

* exwm-config.el (exwm-config-default): Add `exwm-workspace-number' and
`exwm-workspace-switch-create'.
2016-07-21 12:48:12 +08:00
Chris Feng
f48b8eafb0 Minor fixes
* exwm-core.el (exwm-mode-menu, exwm-mode-map): Add workspace
attach/detach commands.

* exwm-workspace.el (exwm-workspace--add-frame-as-workspace):
Cleanup containers.

* exwm-workspace.el (exwm-workspace--update-ewmh-props): Create the
frame in size 1x1 (Lucid build does no support zero sized frames).

* exwm-workspace.el (exwm-workspace--post-init): Reset the 'fullscreen'
frame parameter for emacsclient.
2016-07-21 12:44:05 +08:00
Chris Feng
6571bb5761 Minor cleanups
; Eliminate compile warnings.
; Rename frame parameter 'exwm--urgency' to 'exwm-urgency'.
; Simplify expressions.
2016-07-21 12:41:51 +08:00
Chris Feng
3909f65bae Add support for attachable/detachable minibuffer
* 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-19 19:23:37 +08:00
Chris Feng
624c72945a Fix an bug for emacsclient
* exwm-workspace.el (exwm-workspace--init): Always create one initial
workspace by default.
2016-07-19 19:18:00 +08:00
Chris Feng
37e51e65ad Fix a workspace switch issue
* exwm-workspace.el (exwm-workspace--switch-map-nth-prefix):
Add more checking conditions.
2016-07-19 19:16:19 +08:00
Chris Feng
b409d873b6 Merge branch 'medranocalvo/dynamic-workspaces' into externals/exwm 2016-07-19 11:01:19 +08:00
Chris Feng
2ebeec1257 Adapt dynamic workspace for RandR module
* exwm-workspace.el (exwm-workspace-list-change-hook):
New hook run when the workspace list is modified.
* exwm-randr.el (exwm-randr--init, exwm-randr--exit):
* exwm-workspace.el (exwm-workspace-swap, exwm-workspace-move)
(exwm-workspace--add-frame-as-workspace)
(exwm-workspace--remove-frame-as-workspace):
Use it.
2016-07-19 10:34:38 +08:00
Chris Feng
4c9afc25b3 Adapt dynamic workspace for floating module
* exwm-workspace.el (exwm-workspace--add-frame-as-workspace):
Fix the checking criteria of floating frames; Copy RandR frame
parameters from the first workspace frame (rather than the selected one
which can be a floating frame).

* exwm-workspace.el (exwm-workspace--remove-frame-as-workspace):
Check frame type first.
2016-07-19 10:33:11 +08:00
Chris Feng
622618ac6e Improve the handling of workspaces
* exwm-workspace.el (exwm-workspace--prompt-for-workspace):
Add an optional argument to modify prompt.
(exwm-workspace-switch, exwm-workspace-swap)
(exwm-workspace-move, exwm-workspace-move-window): Use it.

* exwm-workspace.el (exwm-workspace-number): Re-introduce the variable
(now it stands for the initial workspace number).
(exwm-workspace--init): Create remaining initial workspaces.

* exwm-workspace.el (exwm-workspace-add, exwm-workspace-delete):
New commands for adding/deleting workspaces.
(exwm-workspace--switch-map): Add "+"/"-" to increase/descrease
workspace number.

* exwm-workspace.el (exwm-workspace-switch): Automatically add missing
workspaces.

* exwm.el (exwm--on-ClientMessage): Support _NET_NUMBER_OF_DESKTOPS
client message for adjusting workspace number.
2016-07-19 10:30:21 +08:00
Chris Feng
73d890aad4 Fix various minor issues
; 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-19 10:24:23 +08:00
Chris Feng
c22f35620f Fix 2 dock-related issues
* exwm-floating.el (exwm-floating--set-floating): Add a workaround to
prevent accidental move of Emacs frame when struts are set.

* exwm-workspace.el (exwm-workspace--update-workareas): Make legacy
docks working.
2016-07-18 12:55:27 +08:00
Chris Feng
1a716d3939 * exwm-workspace.el (exwm-workspace--init): Rebalance parentheses. 2016-07-18 01:46:46 +08:00
Adrián Medraño Calvo
d0797d03de Remove `exwm-worspace-number'
No longer fill initial workspace list, nor limit the number of
workspaces to `exwm-worspace-number'.

Users are free to create as many as they like by hitting 'C-x 5 2' or
running `make-frame'.

The initial workspace list can be set up by creating frames in a
configuration file.  For example, to start up with 4 workspaces:

    (dolist (i 3)
      (make-frame))

The interactive workspace switcher is improved to support selecting
workspaces with a many-digits position.

	* exwm-workspace.el (exwm-workspace-number): Remove variable, as
	we no longer have a fixed number of workspaces.
	(exwm-workspace--switch-map)
	(exwm-workspace--switch-map-nth-prefix)
	(exwm-workspace--switch-map-select-nth): Improve support for
	selecting workspaces with multiple-digit positions (e.g. workspace
	number 12).
	(exwm-workspace--add-frame-as-workspace, exwm-workspace--init):
	Remove limit on number of workspaces.
	(exwm-workspace--init): Stop creating workspaces at startup.
	* exwm-config.el (exwm-config-default): Bind keys to namespaces
	0-9 in the default configuration.
2016-07-17 12:00:00 +00:00
Adrián Medraño Calvo
0fbc725de1 Support adding and removing workspaces
Frames created via `make-frame' are added to the workspace list;
`delete-frame' removes them from the list.  Floating frames,
non-graphical frames, as well as those associated to different
displays are ignored.

When deleting a workspace, care is taken to reparent that all X clients
another workspace.

	* exwm-workspace.el (exwm-workspace--add-frame-as-workspace)
	(exwm-workspace--remove-frame-as-workspace): New functions that
	intercept created and deleted frames and configure them as EXWM
	workspaces.
	(exwm-workspace--update-ewmh-props): New function to update
	desktop-related EWMH properties after workspace changes.
	(exwm-workspace--init): Use
	`exwm-workspace--add-frame-as-workspace' to create the initial
	workspaces.
2016-07-17 12:00:00 +00:00
Adrián Medraño Calvo
f4b8cc47c7 Support moving workspaces
* exwm-workspace.el (exwm-workspace-move-workspace): New function
	to move a workspace to a certain position.
2016-07-17 12:00:00 +00:00
Adrián Medraño Calvo
e4911181d3 Support swapping workspaces
* exwm-workspace.el (exwm-workspace-swap-workspaces): New
	function to interchange the position of two workspaces.
2016-07-17 12:00:00 +00:00
Adrián Medraño Calvo
2de2d42586 Factor out prompt for workspace
* exwm-workspace.el (exwm-workspace--prompt-for-workspace): New
	function to interactively ask the user for a workspace.
	(exwm-workspace-switch, exwm-workspace-move-window): Use it.
2016-07-17 12:00:00 +00:00
Adrián Medraño Calvo
07120a0562 Work with workspace frames instead of indices
* 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 12:00:00 +00:00
Adrián Medraño Calvo
35e1655dc5 Move defvars to the top
* exwm-workspace.el (exwm-workspace--current)
	(exwm-workspace-current-index): Do it.
2016-07-17 12:00:00 +00:00
Adrián Medraño Calvo
9018545726 New function exwm-workspace--workspace-p
* 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 12:00:00 +00:00
Adrián Medraño Calvo
8e2da00b6e Add helper for counting number of workspaces
* exwm-workspace.el (exwm-workspace--count): New function.
	* exwm-randr.el (exwm-randr--refresh):
	* exwm-workspace.el (exwm-workspace--switch-map)
	(exwm-workspace--update-switch-history, exwm-workspace-switch)
	(exwm-workspace-move-window, exwm-workspace--init)
	(exwm-workspace--post-init): Use it.
2016-07-17 12:00:00 +00:00
Adrián Medraño Calvo
ed6a18a697 Add `exwm-workspace--position' helper
* 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 12:00:00 +00:00
Adrián Medraño Calvo
cd1372eaec Apply minibuffer in own frame configuration to created frames
* exwm-workspace.el
	(exwm-workspace--modify-all-x-frames-parameters): Helper function
	to non-destructively modify `window-system-default-frame-alist'.
	(exwm-workspace--init): Use above function to default all frames
	to the shared minibuffer when
	`exwm-workspace--minibuffer-own-frame-p' is true.
2016-07-17 12:00:00 +00:00
Adrián Medraño Calvo
18fc95def2 Minor cleanup
* exwm-workspace.el (exwm-workspace--update-workareas): Use
	`make-list' instead of looping.

2016-07-16  Adrián Medraño Calvo  <amcalvo@amclap>
2016-07-17 12:00:00 +00:00
Chris Feng
4ac71a7ddc Add RandR support for docks and reuse workareas
* 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-16 14:34:57 +08:00
Chris Feng
7f12d9fc7a Add multi-dock support and fix fullscreen issues with dock
* 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-15 20:04:56 +08:00
Chris Feng
39dc328157 Fix various stability issues
* 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-14 22:08:27 +08:00
Chris Feng
6c8255bf39 Add/improve some ICCCM/EWMH features
* 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-13 19:36:50 +08:00
Chris Feng
650ed0013c Add initial support for dock (panel) applications
* 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-07-12 18:35:51 +08:00
Chris Feng
0863f41490 * exwm-workspace.el (exwm-workspace--init): Remove possible
internal borders of workspace frames.
2016-07-12 12:14:36 +08:00
Chris Feng
1b2ae3749e Add cleanup codes for Emacs daemon
* 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-05-23 19:13:42 +08:00
Chris Feng
dc0c0f5131 Always add `exwm-workspace--on-focus-in'
* exwm-workspace.el (exwm-workspace--init):
`exwm-workspace--on-focus-in' should always be added to `focus-in-hook'.
2016-05-21 12:50:10 +08:00
Chris Feng
ddbbeda285 Fix 2 multi-monitor issues
* exwm-workspace.el (exwm-workspace--on-focus-in, exwm-workspace--init):
Handle unexpected frame switch in `focus-in-hook'.

* exwm-floating.el (exwm-floating--set-floating): If the absolute position
is (0, 0) then the relative position is also the same.
2016-04-07 21:03:42 +08:00
Chris Feng
fa204e1367 Fix emacsclient issues
* 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-25 13:57:42 +08:00
Adrián Medraño Calvo
e4704479a8 Use `other-buffer' instead of "*scratch*"
* exwm-workspace.el (exwm-workspace-move-window): Display
`other-buffer' instead of "*scratch*" in the window whose buffer
has been made floating.
2016-03-19 00:00:00 +00:00
Adrián Medraño Calvo
3763195fe3 Use `buffer-predicate' frame parameter to prevent switching to visible EXWM 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 00:00:00 +00:00