[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/exwm 63402b0 19/64: Correct layout refresh problems
From: |
Chris Feng |
Subject: |
[elpa] externals/exwm 63402b0 19/64: Correct layout refresh problems |
Date: |
Thu, 17 Sep 2015 23:17:56 +0000 |
branch: externals/exwm
commit 63402b0efc19a50e89d868fad3f91b134170aab6
Author: Chris Feng <address@hidden>
Commit: Chris Feng <address@hidden>
Correct layout refresh problems
* Relax the conditions to refresh layout; this may introduce some overheads
though
* Fix the problem when `*scratch*` buffer is killed; close #12
* Enhance `exwm-reset` by forcing layout refresh in it. This should allow
users
to overcome some layout bugs
---
exwm-layout.el | 34 ++++++++++++++++++----------------
exwm.el | 3 +++
2 files changed, 21 insertions(+), 16 deletions(-)
diff --git a/exwm-layout.el b/exwm-layout.el
index 1dd8333..906357e 100644
--- a/exwm-layout.el
+++ b/exwm-layout.el
@@ -157,23 +157,25 @@
(setq exwm--fullscreen nil)
(exwm-input-grab-keyboard)))
-(defvar exwm-layout--window-configuration (current-window-configuration)
- "Last saved window configuration, for avoiding unnecessary refreshes.")
-
(defun exwm-layout--refresh ()
"Refresh layout."
- (unless (compare-window-configurations exwm-layout--window-configuration
- (current-window-configuration))
- (exwm--log "Refresh layout")
- (setq exwm-layout--window-configuration (current-window-configuration))
- (let ((frame (selected-frame))
- windows)
- (if (not (memq frame exwm-workspace--list))
- ;; Refresh a floating frame
- (when (eq major-mode 'exwm-mode)
- (with-current-buffer (window-buffer (frame-first-window frame))
- (exwm-layout--show exwm--id (frame-first-window frame))))
- ;; Refresh the whole workspace
+ (let ((frame (selected-frame))
+ windows placeholder)
+ (if (not (memq frame exwm-workspace--list))
+ ;; Refresh a floating frame
+ (progn
+ (cl-assert (eq major-mode 'exwm-mode))
+ (let ((window (frame-first-window frame)))
+ (with-current-buffer (window-buffer window)
+ (exwm--log "Refresh floating window #x%x" exwm--id)
+ (exwm-layout--show exwm--id window))))
+ ;; Refresh the whole workspace
+ ;; Workspaces other than the active one can also be refreshed (RandR)
+ (exwm--log "Refresh workspace %s" frame)
+ (let ((placeholder (get-buffer "*scratch*")))
+ (unless placeholder ;create the *scratch* buffer if it's killed
+ (setq placeholder (get-buffer-create "*scratch*"))
+ (set-buffer-major-mode placeholder))
(dolist (pair exwm--id-buffer-alist)
(with-current-buffer (cdr pair)
;; Exclude windows on other workspaces and floating frames
@@ -183,7 +185,7 @@
(exwm-layout--hide exwm--id)
(exwm-layout--show exwm--id (car windows))
(dolist (i (cdr windows))
- (set-window-buffer i "*scratch*"))))))))))
+ (set-window-buffer i placeholder))))))))))
(defun exwm-layout--init ()
"Initialize layout module."
diff --git a/exwm.el b/exwm.el
index 984f8ee..7c9fa59 100644
--- a/exwm.el
+++ b/exwm.el
@@ -201,6 +201,8 @@
;; Force update input focus
(setq exwm-input--focus-id xcb:Window:None)
(exwm-input--update-focus)
+ ;; Force refresh
+ (exwm-layout--refresh)
(exwm-input-grab-keyboard))))
(defmacro exwm--with-current-id (id &rest body)
@@ -396,6 +398,7 @@
(exwm--update-protocols id t))
((= atom xcb:Atom:WM_STATE)
(exwm--update-state id t))
+ ((= atom xcb:Atom:_NET_WM_USER_TIME)) ;ignored
(t (exwm--log "Unhandled PropertyNotify: %s(%d)"
(x-get-atom-name atom) atom)))))))
- [elpa] externals/exwm 3fb90b9 12/64: Fix fullscreen issues, (continued)
- [elpa] externals/exwm 3fb90b9 12/64: Fix fullscreen issues, Chris Feng, 2015/09/17
- [elpa] externals/exwm 86764d2 07/64: Add basic RandR support, Chris Feng, 2015/09/17
- [elpa] externals/exwm 1e36a22 13/64: Check buffer mode in exwm-reset, Chris Feng, 2015/09/17
- [elpa] externals/exwm 14628a9 16/64: Fix race conditions when managing a window, Chris Feng, 2015/09/17
- [elpa] externals/exwm 5298489 18/64: Fix some input focus issues, Chris Feng, 2015/09/17
- [elpa] externals/exwm 3b9d0dd 17/64: Fixes for manage/unmanage window, Chris Feng, 2015/09/17
- [elpa] externals/exwm 42f4ec6 20/64: Show moved window by default, Chris Feng, 2015/09/17
- [elpa] externals/exwm 36bb579 21/64: Refresh when minibuffer grows (fix #10), Chris Feng, 2015/09/17
- [elpa] externals/exwm 2ad1a89 14/64: Various input fixes, Chris Feng, 2015/09/17
- [elpa] externals/exwm 84f0f03 15/64: Fix input focus lost after closing window, Chris Feng, 2015/09/17
- [elpa] externals/exwm 63402b0 19/64: Correct layout refresh problems,
Chris Feng <=
- [elpa] externals/exwm edc70eb 22/64: Remove redundant code caused by the concurrency of events, Chris Feng, 2015/09/17
- [elpa] externals/exwm 2d4104a 23/64: Fix emacsclient bugs, Chris Feng, 2015/09/17
- [elpa] externals/exwm 24b964b 25/64: Ignore repeated `MappingNotify` events, Chris Feng, 2015/09/17
- [elpa] externals/exwm 801185c 27/64: Fix buffer switch problems, Chris Feng, 2015/09/17
- [elpa] externals/exwm 1ce18af 28/64: Center floating windows by default, Chris Feng, 2015/09/17
- [elpa] externals/exwm 048994c 24/64: Remove redundant code caused by the concurrency of events (continued), Chris Feng, 2015/09/17
- [elpa] externals/exwm 35560a4 30/64: Minor fixes for emacsclient, Chris Feng, 2015/09/17
- [elpa] externals/exwm b755296 26/64: Remove redundant code caused by the concurrency of events (contd, 2), Chris Feng, 2015/09/17
- [elpa] externals/exwm 7bfd429 33/64: Honor `value-mask` field in ConfigureRequest event, Chris Feng, 2015/09/17
- [elpa] externals/exwm dba43b0 32/64: Fix input focus stealing, Chris Feng, 2015/09/17