[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/exwm 801185c 27/64: Fix buffer switch problems
From: |
Chris Feng |
Subject: |
[elpa] externals/exwm 801185c 27/64: Fix buffer switch problems |
Date: |
Thu, 17 Sep 2015 23:17:59 +0000 |
branch: externals/exwm
commit 801185c7cc2c257ac2e8ed9a3aa8e8119c56ad1f
Author: Chris Feng <address@hidden>
Commit: Chris Feng <address@hidden>
Fix buffer switch problems
* Prevent switching to floating windows or windows on other workspaces
* Provide a workaround for `ido-mode` (can be enabled with
`(exwm-enable-ido-workaround)`)
---
exwm-layout.el | 8 +++++++-
exwm.el | 24 ++++++++++++++++++++++++
2 files changed, 31 insertions(+), 1 deletions(-)
diff --git a/exwm-layout.el b/exwm-layout.el
index 5d056af..f2d4eb0 100644
--- a/exwm-layout.el
+++ b/exwm-layout.el
@@ -198,7 +198,13 @@
(exwm-layout--hide exwm--id)
(exwm-layout--show exwm--id (car windows))
(dolist (i (cdr windows))
- (set-window-buffer i placeholder)))))))))
+ (set-window-buffer i placeholder))))))
+ ;; Make sure windows floating / on other workspaces are excluded
+ (dolist (window (window-list frame 0))
+ (with-current-buffer (window-buffer window)
+ (when (and (eq major-mode 'exwm-mode)
+ (or exwm--floating-frame (not (eq frame exwm--frame))))
+ (set-window-buffer window placeholder)))))))
(defun exwm-layout--on-minibuffer-setup ()
"Refresh layout when minibuffer grows."
diff --git a/exwm.el b/exwm.el
index 95b6742..7e909cd 100644
--- a/exwm.el
+++ b/exwm.el
@@ -707,6 +707,30 @@
(add-hook 'window-setup-hook 'exwm-init t) ;for Emacs
(add-hook 'after-make-frame-functions 'exwm-init t))) ;for Emacs Client
+(defun exwm--ido-buffer-window-other-frame (orig-fun buffer)
+ "Wrapper for `ido-buffer-window-other-frame' to exclude invisible windows."
+ (let* ((window (funcall orig-fun buffer))
+ (frame (window-frame window)))
+ ;; Exclude windows on other workspaces
+ (unless (and (memq frame exwm-workspace--list)
+ (not (eq frame exwm-workspace--current)))
+ window)))
+
+(defun exwm--fix-ido-buffer-window-other-frame ()
+ "Fix `ido-buffer-window-other-frame'."
+ (advice-add 'ido-buffer-window-other-frame :around
+ 'exwm--ido-buffer-window-other-frame))
+
+(defun exwm-enable-ido-workaround ()
+ "Enable workarounds for `ido-mode'."
+ (add-hook 'exwm-init-hook 'exwm--fix-ido-buffer-window-other-frame))
+
+(defun exwm-disable-ido-workaround ()
+ "Disable workarounds for `ido-mode'."
+ (remove-hook 'exwm-init-hook 'exwm--fix-ido-buffer-window-other-frame)
+ (advice-remove 'ido-buffer-window-other-frame
+ 'exwm--ido-buffer-window-other-frame))
+
(provide 'exwm)
- [elpa] externals/exwm 5298489 18/64: Fix some input focus issues, (continued)
- [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, 2015/09/17
- [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 <=
- [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
- [elpa] externals/exwm d998b42 34/64: Provide hooks run when the floating state of a window changes (close #28), Chris Feng, 2015/09/17
- [elpa] externals/exwm 15ad591 35/64: Fix bug when moving a window to the current workspace, Chris Feng, 2015/09/17
- [elpa] externals/exwm 43b00d2 36/64: fix buffer renaming, Chris Feng, 2015/09/17
- [elpa] externals/exwm 2d07429 39/64: Merge branch 'move-window-fix' of https://github.com/pipcet/exwm into pipcet-move-window-fix, Chris Feng, 2015/09/17