about summary refs log tree commit diff
path: root/exwm.el
diff options
context:
space:
mode:
authorPhilip <pipcet@gmail.com>2015-08-24T19·09+0000
committerPhilip <pipcet@gmail.com>2015-08-24T19·12+0000
commit94bdbfc0da7c8ef14acdc8aa4e73dc1c8fee9700 (patch)
treeddfe7add7d2dee590f8d366eefbef930067c3ebd /exwm.el
parent5882015eb5a21cb859794388e21d6dc023764480 (diff)
Avoid using the "no window manager" code in Emacs
        * exwm.el (exwm--on-ClientMessage): Handle fullscreen requests
	for frames.
	(exwm-init): Initialize workspaces after unlocking events.

	* exwm-workspace.el (exwm-workspace--init): Create frames as
	invisible, then make them visible only once their OverrideRedirect
	property has been set.

	* exwm-randr.el (exwm-randr--refresh): New frame parameter
	`exwm-geometry'.

	* exwm-layout.el (exwm-layout--set-frame-fullscreen): New
        function.

The Emacs code is buggy, see https://github.com/ch11ng/exwm/issues/39

https://github.com/ch11ng/exwm/pull/42
Diffstat (limited to 'exwm.el')
-rw-r--r--exwm.el18
1 files changed, 16 insertions, 2 deletions
diff --git a/exwm.el b/exwm.el
index 7dffa87aec..a52e11419d 100644
--- a/exwm.el
+++ b/exwm.el
@@ -441,6 +441,20 @@
             (props (list (elt data 1) (elt data 2)))
             (buffer (exwm--id->buffer id))
             props-new)
+        ;; only support _NET_WM_STATE_FULLSCREEN / _NET_WM_STATE_ADD for frames
+        (when (and (not buffer)
+                   (memq xcb:Atom:_NET_WM_STATE_FULLSCREEN props)
+                   (= action xcb:ewmh:_NET_WM_STATE_ADD))
+          (dolist (f exwm-workspace--list)
+            (when (equal (frame-parameter f 'exwm-outer-id) id)
+	      (exwm-layout--set-frame-fullscreen f)
+	      (xcb:+request
+                  exwm--connection
+                  (make-instance 'xcb:ewmh:set-_NET_WM_STATE
+                                 :window id
+                                 :data (vector
+                                        xcb:Atom:_NET_WM_STATE_FULLSCREEN)))
+	      (xcb:flush exwm--connection))))
         (when buffer                    ;ensure it's managed
           (with-current-buffer buffer
             ;; _NET_WM_STATE_MODAL
@@ -609,14 +623,14 @@
         ;; (xcb:icccm:init exwm--connection)
         (xcb:ewmh:init exwm--connection)
         (exwm--lock)
-        (exwm-workspace--init)
         (exwm--init-icccm-ewmh)
         (exwm-layout--init)
         (exwm-floating--init)
         (exwm-manage--init)
         (exwm-input--init)
         (exwm--unlock)
-        ;; Manage exiting windows
+        (exwm-workspace--init)
+        ;; Manage existing windows
         (exwm-manage--scan)
         (run-hooks 'exwm-init-hook)))))