[elpa] externals/xelb 2e4542c: Eliminate compile warnings

2018-08-19 Thread Chris Feng
branch: externals/xelb
commit 2e4542cae9e368847904590dbd95e84a329bcd7c
Author: Chris Feng 
Commit: Chris Feng 

Eliminate compile warnings
---
 xcb-types.el | 35 +--
 1 file changed, 17 insertions(+), 18 deletions(-)

diff --git a/xcb-types.el b/xcb-types.el
index be3e105..1343dfa 100644
--- a/xcb-types.el
+++ b/xcb-types.el
@@ -60,7 +60,7 @@
   (when xcb:debug-on
 `(message (concat "[XELB LOG] " ,format-string) ,@args)))
 
- Fix backward compatibility issues with Emacs < 25
+ Fix backward compatibility issues with Emacs 24
 
 (eval-and-compile
   (when (< emacs-major-version 25)
@@ -78,22 +78,21 @@
   spec-list)
,@body)
 
-;; Backport some new functions from Emacs 25
+;; Backport some functions to Emacs 24
 
 (eval-and-compile
   (unless (fboundp 'eieio-class-slots)
-(eval-and-compile
-  (defun eieio-class-slots (class)
-(let* ((tmp (class-v class))
-   (names (eieio--class-public-a tmp))
-   (initforms (eieio--class-public-d tmp))
-   (types (eieio--class-public-type tmp))
-   result)
-  (dotimes (i (length names))
-(setq result (nconc result (list (vector (elt names i)
- (elt initforms i)
- (elt types i))
-  result)
+(defun eieio-class-slots (class)
+  (let* ((tmp (get class 'eieio-class-definition))
+ (names (aref tmp 5))
+ (initforms (aref tmp 6))
+ (types (aref tmp 8))
+ result)
+(dotimes (i (length names))
+  (setq result (nconc result (list (vector (elt names i)
+   (elt initforms i)
+   (elt types i))
+result
 
 (eval-and-compile
   (unless (fboundp 'eieio-slot-descriptor-name)
@@ -453,10 +452,10 @@ Consider let-bind it rather than change its global 
value."))
 (defclass xcb:--struct ()
   nil)
 
-(cl-defmethod slot-unbound ((object xcb:--struct) class slot-name fn)
-  (xcb:-log "unbount-slot: %s" (list (eieio-class-name class)
- (eieio-object-name object)
-slot-name fn))
+(cl-defmethod slot-unbound ((_object xcb:--struct) _class _slot-name _fn)
+  (xcb:-log "unbount-slot: %s" (list (eieio-class-name _class)
+ (eieio-object-name _object)
+_slot-name _fn))
   nil)
 
 (defclass xcb:-struct (xcb:--struct)



[elpa] externals/exwm 8d15a39 01/12: Print log output to an EXWM-specific messages buffer

2018-08-19 Thread Chris Feng
branch: externals/exwm
commit 8d15a39c4d4928d9bc38bed63e2bb85e4536af45
Author: Adrián Medraño Calvo 
Commit: Adrián Medraño Calvo 

Print log output to an EXWM-specific messages buffer

Using `message' to log debugging information is cumbersome, as the output
appears constantly in the minibuffer, obscuring prompts and other 
information.
In the case of long messages, it might resize the minibuffer, which causes 
EXWM
to perform additional actions due to the log output.

This change reimplements EXWM debug logging using a separate
buffer (*EXWM-DEBUG*).  Basic functionality, like scrolling when point is 
at the
end of the buffer is maintained.

* exwm-core.el (exwm--log): Use `exwm-debug--message' instead of
`message'.  Prefix all messages with the name of the function.
Make FORMAT-STRING argument optional.

* exwm-debug.el: New file.
(exwm-debug-buffer): New variable holding the buffer where debug
messages are output to.
(exwm-debug--message): New function printing a message to
`exwm-debug-buffer'.
(exwm-debug--backtrace): New function printing a backtrace.
---
 exwm-core.el  |  15 +++--
 exwm-debug.el | 104 ++
 2 files changed, 116 insertions(+), 3 deletions(-)

diff --git a/exwm-core.el b/exwm-core.el
index ab5159c..66b7917 100644
--- a/exwm-core.el
+++ b/exwm-core.el
@@ -31,6 +31,7 @@
 (require 'xcb)
 (require 'xcb-icccm)
 (require 'xcb-ewmh)
+(require 'exwm-debug)
 
 (eval-and-compile
   (defvar exwm-debug-on nil "Non-nil to turn on debug for EXWM."))
@@ -70,10 +71,18 @@
 (declare-function exwm-workspace-move-window "exwm-workspace.el"
   (frame-or-index &optional id))
 
-(defmacro exwm--log (format-string &rest args)
-  "Print debug message."
+(defmacro exwm--log (&optional format-string &rest objects)
+  "Emit a message prepending the name of the function being executed.
+
+FORMAT-STRING is a string specifying the message to output, as in
+`format'.  The OBJECTS arguments specify the substitutions."
   (when exwm-debug-on
-`(message (concat "[EXWM] " ,format-string) ,@args)))
+(unless format-string (setq format-string ""))
+`(progn
+   (exwm-debug--message (concat "%s:\t" ,format-string "\n")
+(exwm-debug--compile-time-function-name)
+,@objects)
+   nil)))
 
 (defmacro exwm--debug (&rest forms)
   (when exwm-debug-on `(progn ,@forms)))
diff --git a/exwm-debug.el b/exwm-debug.el
new file mode 100644
index 000..89421da
--- /dev/null
+++ b/exwm-debug.el
@@ -0,0 +1,104 @@
+;;; exwm-debug.el --- Debugging helpers for EXWM  -*- lexical-binding: t -*-
+
+;; Copyright (C) 2015-2016 Free Software Foundation, Inc.
+
+;; Author: Chris Feng 
+;; Adrián Medraño Calvo 
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see .
+
+;;; Commentary:
+
+;; This module collects functions that help in debugging EXWM.
+
+;;; Code:
+
+(eval-and-compile
+  (defvar exwm-debug-on nil "Non-nil to turn on debug for EXWM."))
+
+(defvar exwm-debug-buffer
+  (when exwm-debug-on
+(let ((buffer (get-buffer-create "*EXWM-DEBUG*")))
+  (buffer-disable-undo buffer)
+  buffer))
+  "Buffer to write debug messages to.")
+
+(defun exwm-debug--call-stack ()
+  "Return the current call stack frames."
+  (let (frames frame
+;; No need to acount for our setq, while, let, ...
+(index 5))
+(while (setq frame (backtrace-frame index))
+  (push frame frames)
+  (cl-incf index))
+(cl-remove-if-not 'car frames)))
+
+(defmacro exwm-debug--compile-time-function-name ()
+  "Get the name of outermost definition at expansion time."
+  (let* ((frame (cl-find-if
+(lambda (frame)
+  (ignore-errors
+(let ((clause (car (cl-third frame
+  (or (equal clause 'defalias)
+  (equal clause 'cl-defmethod)
+(reverse (exwm-debug--call-stack
+(defn (cl-third frame))
+(deftype (car defn)))
+(cl-case deftype
+  ((defalias) (symbol-name (cl-cadadr defn)))
+  ((cl-defmethod) (symbol-name (cadr defn)))
+  (t ""
+
+(defmacro exwm-debug--with-debug-buffer (&rest forms)
+  "Evaluate FORMS making sure `exwm-debug-buffer' is co

[elpa] externals/exwm 633065a 06/12: Don't assume order of `get-buffer-window-list' results

2018-08-19 Thread Chris Feng
branch: externals/exwm
commit 633065ad55f84431db6aa380dc2467c38b5fbdcb
Author: Adrián Medraño Calvo 
Commit: Adrián Medraño Calvo 

Don't assume order of `get-buffer-window-list' results

It only guarantees that the first result *if* the buffer appears on the
selected window.
---
 exwm-layout.el | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/exwm-layout.el b/exwm-layout.el
index 18c2c27..8f3c47f 100644
--- a/exwm-layout.el
+++ b/exwm-layout.el
@@ -306,8 +306,10 @@ selected by `other-buffer'."
 ;; windows displaying an EXWM-buffer now displayed elsewhere; 
we
 ;; need to display with some other buffer there.
 (setq vacated-windows
-  (append vacated-windows (cdr (get-buffer-window-list
-(current-buffer) 'nomini 
t
+  (append vacated-windows (remove
+   window
+   (get-buffer-window-list
+(current-buffer) 'nomini t
 ;; Note down when an EXWM-buffer is being covered by this
 ;; buffer; we don't want it to reappear in some vacated window.
 (let ((prev-buffer (car-safe



[elpa] externals/exwm 2b1ed2c 12/12: Merge branch 'medranocalvo/fix-x-window-vanish' into externals/exwm

2018-08-19 Thread Chris Feng
branch: externals/exwm
commit 2b1ed2ce704de5b61391f34251c89e5187c4a593
Merge: be10e26 d4a772f
Author: Chris Feng 
Commit: Chris Feng 

Merge branch 'medranocalvo/fix-x-window-vanish' into externals/exwm
---
 exwm-layout.el | 125 +
 1 file changed, 72 insertions(+), 53 deletions(-)

diff --git a/exwm-layout.el b/exwm-layout.el
index 4aa4804..09a3498 100644
--- a/exwm-layout.el
+++ b/exwm-layout.el
@@ -267,75 +267,94 @@ selected by `other-buffer'."
   (unless frame
 (setq frame (selected-frame)))
   (exwm--log "frame=%s" frame)
+  (if (not (exwm-workspace--workspace-p frame))
+  (if (frame-parameter frame 'exwm-outer-id)
+  (exwm-layout--refresh-floating frame)
+(exwm-layout--refresh-other frame))
+(exwm-layout--refresh-workspace frame)))
+
+(defun exwm-layout--refresh-floating (frame)
+  "Refresh floating frame FRAME."
+  (exwm--log "Refresh floating %s" frame)
+  (let ((window (frame-first-window frame)))
+(with-current-buffer (window-buffer window)
+  (when (and (derived-mode-p 'exwm-mode)
+ ;; It may be a buffer waiting to be killed.
+ (exwm--id->buffer exwm--id))
+(exwm--log "Refresh floating window #x%x" exwm--id)
+(if (exwm-workspace--active-p exwm--frame)
+(exwm-layout--show exwm--id window)
+  (exwm-layout--hide exwm--id))
+
+(defun exwm-layout--refresh-other (frame)
+  "Refresh client or nox frame FRAME."
+  ;; Other frames (e.g. terminal/graphical frame of emacsclient)
+  ;; We shall bury all `exwm-mode' buffers in this case
+  (exwm--log "Refresh other %s" frame)
+  (let ((windows (window-list frame 'nomini)) ;exclude minibuffer
+(exwm-layout--other-buffer-exclude-exwm-mode-buffers t))
+(dolist (window windows)
+  (with-current-buffer (window-buffer window)
+(when (derived-mode-p 'exwm-mode)
+  (switch-to-prev-buffer window))
+
+(defun exwm-layout--refresh-workspace (frame)
+  "Refresh workspace frame FRAME."
+  (exwm--log "Refresh workspace %s" frame)
+  ;; Workspaces other than the active one can also be refreshed (RandR)
   (let (covered-buffers   ;EXWM-buffers covered by a new X window.
-vacated-windows   ;Windows previously displaying EXWM-buffers.
-windows)
-(if (not (exwm-workspace--workspace-p frame))
-(if (frame-parameter frame 'exwm-outer-id)
-;; Refresh a floating frame
-(let ((window (frame-first-window frame)))
-  (with-current-buffer (window-buffer window)
-(when (and (derived-mode-p 'exwm-mode)
-   ;; It may be a buffer waiting to be killed.
-   (exwm--id->buffer exwm--id))
-  (exwm--log "Refresh floating window #x%x" exwm--id)
-  (if (exwm-workspace--active-p exwm--frame)
-  (exwm-layout--show exwm--id window)
-(exwm-layout--hide exwm--id)
-  ;; Other frames (e.g. terminal/graphical frame of emacsclient)
-  ;; We shall bury all `exwm-mode' buffers in this case
-  (setq windows (window-list frame 0)) ;exclude minibuffer
-  (let ((exwm-layout--other-buffer-exclude-exwm-mode-buffers t))
-(dolist (window windows)
-  (with-current-buffer (window-buffer window)
-(when (derived-mode-p 'exwm-mode)
-  (switch-to-prev-buffer window))
-  ;; Refresh the whole workspace
-  ;; Workspaces other than the active one can also be refreshed (RandR)
-  (exwm--log "Refresh workspace %s" frame)
-  (dolist (pair exwm--id-buffer-alist)
-(with-current-buffer (cdr pair)
-  (when (and (not exwm--floating-frame) ;exclude floating X windows
- (or exwm-layout-show-all-buffers
- ;; Exclude X windows on other workspaces
- (eq frame exwm--frame)))
-(setq windows (get-buffer-window-list (current-buffer) 0))
+vacated-windows)  ;Windows previously displaying EXWM-buffers.
+(dolist (pair exwm--id-buffer-alist)
+  (with-current-buffer (cdr pair)
+(when (and (not exwm--floating-frame) ;exclude floating X windows
+   (or exwm-layout-show-all-buffers
+   ;; Exclude X windows on other workspaces
+   (eq frame exwm--frame)))
+  (let (;; List of windows in current frame displaying the `exwm-mode'
+;; buffers.
+(windows (get-buffer-window-list (current-buffer) 'nomini
+ frame)))
 (if (not windows)
 (when (eq frame exwm--frame)
+  ;; Hide it if it was being shown in this workspace.
   (exwm-layout--hide exwm--id))
   (let ((window (car windows)))
 (if (eq frame exwm--frame)
 

[elpa] externals/exwm 33dec8d 03/12: Trace more functions

2018-08-19 Thread Chris Feng
branch: externals/exwm
commit 33dec8d1a382f77b3bd8a64f8d56e8e06c2043b1
Author: Adrián Medraño Calvo 
Commit: Adrián Medraño Calvo 

Trace more functions
---
 exwm-core.el  |  2 ++
 exwm-input.el | 32 
 exwm-layout.el| 14 ++
 exwm-manage.el| 16 +++-
 exwm-workspace.el |  7 +++
 exwm.el   |  2 ++
 6 files changed, 72 insertions(+), 1 deletion(-)

diff --git a/exwm-core.el b/exwm-core.el
index 5c501e4..3159519 100644
--- a/exwm-core.el
+++ b/exwm-core.el
@@ -97,6 +97,7 @@ FORMAT-STRING is a string specifying the message to output, 
as in
 
 (defun exwm--lock (&rest _args)
   "Lock (disable all events)."
+  (exwm--log)
   (xcb:+request exwm--connection
   (make-instance 'xcb:ChangeWindowAttributes
  :window exwm--root
@@ -106,6 +107,7 @@ FORMAT-STRING is a string specifying the message to output, 
as in
 
 (defun exwm--unlock (&rest _args)
   "Unlock (enable all events)."
+  (exwm--log)
   (xcb:+request exwm--connection
   (make-instance 'xcb:ChangeWindowAttributes
  :window exwm--root
diff --git a/exwm-input.el b/exwm-input.el
index 57a2873..7885d18 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -157,6 +157,7 @@ This value should always be overwritten.")
 (defun exwm-input--set-focus (id)
   "Set input focus to window ID in a proper way."
   (when (exwm--id->buffer id)
+(exwm--log "id=#x%x" id)
 (with-current-buffer (exwm--id->buffer id)
   (exwm-input--update-timestamp
(lambda (timestamp id send-input-focus wm-take-focus)
@@ -187,6 +188,7 @@ This value should always be overwritten.")
 
 ARGS are additional arguments to CALLBACK."
   (setq exwm-input--timestamp-callback (cons callback args))
+  (exwm--log)
   (xcb:+request exwm--connection
   (make-instance 'xcb:ChangeProperty
  :mode xcb:PropMode:Replace
@@ -200,6 +202,7 @@ ARGS are additional arguments to CALLBACK."
 
 (defun exwm-input--on-PropertyNotify (data _synthetic)
   "Handle PropertyNotify events."
+  (exwm--log)
   (when exwm-input--timestamp-callback
 (let ((obj (make-instance 'xcb:PropertyNotify)))
   (xcb:unmarshal obj data)
@@ -218,6 +221,7 @@ ARGS are additional arguments to CALLBACK."
 (with-slots (time root event root-x root-y event-x event-y state) evt
   (setq buffer (exwm--id->buffer event)
 window (get-buffer-window buffer t))
+  (exwm--log "EnterNotify: buffer=%s; window=%s" buffer window)
   (when (and buffer window (not (eq window (selected-window
 (setq frame (window-frame window)
   frame-xid (frame-parameter frame 'exwm-id))
@@ -265,6 +269,8 @@ ARGS are additional arguments to CALLBACK."
  (eq (current-buffer) (window-buffer))
  (not (string-prefix-p " *temp*"
(buffer-name (car (last (buffer-list)))
+(exwm--log "current-buffer=%S selected-window=%S"
+   (current-buffer) (selected-window))
 (redirect-frame-focus (selected-frame) nil)
 (setq exwm-input--update-focus-window (selected-window))
 (exwm-input--update-focus-defer)))
@@ -296,6 +302,7 @@ ARGS are additional arguments to CALLBACK."
 (defun exwm-input--update-focus (window)
   "Update input focus."
   (when (window-live-p window)
+(exwm--log "focus-window=%s focus-buffer=%s" window (window-buffer window))
 (with-current-buffer (window-buffer window)
   (if (derived-mode-p 'exwm-mode)
   (if (not (eq exwm--frame exwm-workspace--current))
@@ -331,6 +338,10 @@ ARGS are additional arguments to CALLBACK."
   ;; The focus is on another workspace (e.g. it got clicked)
   ;; so switch to it.
   (progn
+(exwm--log "Switching to %s's workspace %s (%s)"
+   window
+   (window-frame window)
+   (selected-frame))
 (set-frame-parameter (selected-frame) 'exwm-selected-window
  window)
 (exwm--defer 0 #'exwm-workspace-switch (selected-frame)))
@@ -346,12 +357,14 @@ ARGS are additional arguments to CALLBACK."
 
 (defun exwm-input--on-minibuffer-setup ()
   "Run in `minibuffer-setup-hook' to set input focus."
+  (exwm--log)
   (unless (exwm-workspace--client-p)
 ;; Set input focus on the Emacs frame
 (x-focus-frame (window-frame (minibuffer-selected-window)
 
 (defun exwm-input--set-active-window (&optional id)
   "Set _NET_ACTIVE_WINDOW."
+  (exwm--log)
   (xcb:+request exwm--connection
   (make-instance 'xcb:ewmh:set-_NET_ACTIVE_WINDOW
  :window exwm--root
@@ -363,6 +376,8 @@ ARGS are additional arguments to CALLBACK."
 (mode xcb:Allow:SyncPointer)
 button-event window buffer frame)
 (xcb:unmarshal obj data)
+(exwm--log "major-mode=%s buffer=%s"
+major-mode (buffer-name (current-buffe

[elpa] externals/exwm f820217 07/12: Split exwm-layout--refresh into three functions

2018-08-19 Thread Chris Feng
branch: externals/exwm
commit f820217d00623489a655c79506816397319eb762
Author: Adrián Medraño Calvo 
Commit: Adrián Medraño Calvo 

Split exwm-layout--refresh into three functions

* exwm-layout.el (exwm-layout--refresh): Split in three functions
for clarity.
(exwm-layout--refresh-workspace, exwm-layout--refresh-other)
(exwm-layout--refresh-floating):  New functions.
---
 exwm-layout.el | 103 +++--
 1 file changed, 57 insertions(+), 46 deletions(-)

diff --git a/exwm-layout.el b/exwm-layout.el
index 8f3c47f..b8c5bb3 100644
--- a/exwm-layout.el
+++ b/exwm-layout.el
@@ -261,39 +261,50 @@ selected by `other-buffer'."
   ;; `window-configuration-change-hook' makes the frame selected.
   (unless frame
 (setq frame (selected-frame)))
+  (if (not (exwm-workspace--workspace-p frame))
+  (if (frame-parameter frame 'exwm-outer-id)
+  (exwm-layout--refresh-floating frame)
+(exwm-layout--refresh-other frame))
+(exwm-layout--refresh-workspace frame)))
+
+(defun exwm-layout--refresh-floating (frame)
+  "Refresh floating frame FRAME."
+  (exwm--log "Refresh floating %s" frame)
+  (let ((window (frame-first-window frame)))
+(with-current-buffer (window-buffer window)
+  (when (and (derived-mode-p 'exwm-mode)
+ ;; It may be a buffer waiting to be killed.
+ (exwm--id->buffer exwm--id))
+(exwm--log "Refresh floating window #x%x" exwm--id)
+(if (exwm-workspace--active-p exwm--frame)
+(exwm-layout--show exwm--id window)
+  (exwm-layout--hide exwm--id))
+
+(defun exwm-layout--refresh-other (frame)
+  "Refresh client or nox frame FRAME."
+  ;; Other frames (e.g. terminal/graphical frame of emacsclient)
+  ;; We shall bury all `exwm-mode' buffers in this case
+  (exwm--log "Refresh other %s" frame)
+  (let ((windows (window-list frame 'nomini)) ;exclude minibuffer
+(exwm-layout--other-buffer-exclude-exwm-mode-buffers t))
+(dolist (window windows)
+  (with-current-buffer (window-buffer window)
+(when (derived-mode-p 'exwm-mode)
+  (switch-to-prev-buffer window))
+
+(defun exwm-layout--refresh-workspace (frame)
+  "Refresh workspace frame FRAME."
+  (exwm--log "Refresh workspace %s" frame)
+  ;; Workspaces other than the active one can also be refreshed (RandR)
   (let (covered-buffers   ;EXWM-buffers covered by a new X window.
-vacated-windows   ;Windows previously displaying EXWM-buffers.
-windows)
-(if (not (exwm-workspace--workspace-p frame))
-(if (frame-parameter frame 'exwm-outer-id)
-;; Refresh a floating frame
-(let ((window (frame-first-window frame)))
-  (with-current-buffer (window-buffer window)
-(when (and (derived-mode-p 'exwm-mode)
-   ;; It may be a buffer waiting to be killed.
-   (exwm--id->buffer exwm--id))
-  (exwm--log "Refresh floating window #x%x" exwm--id)
-  (if (exwm-workspace--active-p exwm--frame)
-  (exwm-layout--show exwm--id window)
-(exwm-layout--hide exwm--id)
-  ;; Other frames (e.g. terminal/graphical frame of emacsclient)
-  ;; We shall bury all `exwm-mode' buffers in this case
-  (setq windows (window-list frame 'nomini))
-  (let ((exwm-layout--other-buffer-exclude-exwm-mode-buffers t))
-(dolist (window windows)
-  (with-current-buffer (window-buffer window)
-(when (derived-mode-p 'exwm-mode)
-  (switch-to-prev-buffer window))
-  ;; Refresh the whole workspace
-  ;; Workspaces other than the active one can also be refreshed (RandR)
-  (exwm--log "Refresh workspace %s" frame)
-  (dolist (pair exwm--id-buffer-alist)
-(with-current-buffer (cdr pair)
-  (when (and (not exwm--floating-frame) ;exclude floating X windows
- (or exwm-layout-show-all-buffers
- ;; Exclude X windows on other workspaces
- (eq frame exwm--frame)))
-(setq windows (get-buffer-window-list (current-buffer) 'nomini 
frame))
+vacated-windows)  ;Windows previously displaying EXWM-buffers.
+(dolist (pair exwm--id-buffer-alist)
+  (with-current-buffer (cdr pair)
+(when (and (not exwm--floating-frame) ;exclude floating X windows
+   (or exwm-layout-show-all-buffers
+   ;; Exclude X windows on other workspaces
+   (eq frame exwm--frame)))
+  (let ((windows (get-buffer-window-list (current-buffer) 'nomini 
frame)))
 (if (not windows)
 (when (eq frame exwm--frame)
   (exwm-layout--hide exwm--id))
@@ -318,20 +329,20 @@ selected by `other-buffer'."
prev-buffer
   

[elpa] externals/exwm d4a772f 10/12: ; Comment layout algorithm.

2018-08-19 Thread Chris Feng
branch: externals/exwm
commit d4a772f536eab469b17315e83d843ce3cba3092c
Author: Adrián Medraño Calvo 
Commit: Chris Feng 

; Comment layout algorithm.
---
 exwm-layout.el | 18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/exwm-layout.el b/exwm-layout.el
index b8c5bb3..98a27d0 100644
--- a/exwm-layout.el
+++ b/exwm-layout.el
@@ -304,25 +304,31 @@ selected by `other-buffer'."
(or exwm-layout-show-all-buffers
;; Exclude X windows on other workspaces
(eq frame exwm--frame)))
-  (let ((windows (get-buffer-window-list (current-buffer) 'nomini 
frame)))
+  (let (;; List of windows in current frame displaying the `exwm-mode'
+;; buffers.
+(windows (get-buffer-window-list (current-buffer) 'nomini
+ frame)))
 (if (not windows)
 (when (eq frame exwm--frame)
+  ;; Hide it if it was being shown in this workspace.
   (exwm-layout--hide exwm--id))
   (let ((window (car windows)))
 (if (eq frame exwm--frame)
 (when (exwm-workspace--active-p frame)
+  ;; Show it if `frame' is active.
   (exwm-layout--show exwm--id window))
+  ;; It was last shown in other workspace; move it here.
   (exwm-workspace-move-window frame exwm--id))
-;; Make sure this buffer is not displayed elsewhere.  Note down
-;; windows displaying an EXWM-buffer now displayed elsewhere; 
we
-;; need to display with some other buffer there.
+;; Vacate any other windows (in any workspace) showing this
+;; `exwm-mode' buffer.
 (setq vacated-windows
   (append vacated-windows (remove
window
(get-buffer-window-list
 (current-buffer) 'nomini t
-;; Note down when an EXWM-buffer is being covered by this
-;; buffer; we don't want it to reappear in some vacated window.
+;; Note any `exwm-mode' buffer is being covered by another
+;; `exwm-mode' buffer.  We want to avoid that `exwm-mode'
+;; buffer to be reappear in any of the vacated windows.
 (let ((prev-buffer (car-safe
 (car-safe (window-prev-buffers window)
   (and



[elpa] externals/exwm 11fecb5 05/12: Use more explicit argument for excluding minibuffers

2018-08-19 Thread Chris Feng
branch: externals/exwm
commit 11fecb5186ceac31aa4a78261da3969ddb6856ff
Author: Adrián Medraño Calvo 
Commit: Adrián Medraño Calvo 

Use more explicit argument for excluding minibuffers

* exwm-layout.el (exwm-layout--refresh): Use a more intuitive
value for specifying exclusion of minibuffers.
---
 exwm-layout.el | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/exwm-layout.el b/exwm-layout.el
index a03b6fb..18c2c27 100644
--- a/exwm-layout.el
+++ b/exwm-layout.el
@@ -278,7 +278,7 @@ selected by `other-buffer'."
 (exwm-layout--hide exwm--id)
   ;; Other frames (e.g. terminal/graphical frame of emacsclient)
   ;; We shall bury all `exwm-mode' buffers in this case
-  (setq windows (window-list frame 0)) ;exclude minibuffer
+  (setq windows (window-list frame 'nomini))
   (let ((exwm-layout--other-buffer-exclude-exwm-mode-buffers t))
 (dolist (window windows)
   (with-current-buffer (window-buffer window)
@@ -293,7 +293,7 @@ selected by `other-buffer'."
  (or exwm-layout-show-all-buffers
  ;; Exclude X windows on other workspaces
  (eq frame exwm--frame)))
-(setq windows (get-buffer-window-list (current-buffer) 0 frame))
+(setq windows (get-buffer-window-list (current-buffer) 'nomini 
frame))
 (if (not windows)
 (when (eq frame exwm--frame)
   (exwm-layout--hide exwm--id))
@@ -307,7 +307,7 @@ selected by `other-buffer'."
 ;; need to display with some other buffer there.
 (setq vacated-windows
   (append vacated-windows (cdr (get-buffer-window-list
-(current-buffer) 0 t
+(current-buffer) 'nomini 
t
 ;; Note down when an EXWM-buffer is being covered by this
 ;; buffer; we don't want it to reappear in some vacated window.
 (let ((prev-buffer (car-safe
@@ -323,7 +323,7 @@ selected by `other-buffer'."
   (switch-to-prev-buffer window)))
   ;; Make sure windows floating / on other workspaces are excluded
   (let ((exwm-layout--other-buffer-exclude-exwm-mode-buffers t))
-(dolist (window (window-list frame 0))
+(dolist (window (window-list frame 'nomini))
   (with-current-buffer (window-buffer window)
 (when (and (derived-mode-p 'exwm-mode)
(or exwm--floating-frame (not (eq frame exwm--frame



[elpa] externals/exwm 29f2289 09/12: Consistently name helper windows

2018-08-19 Thread Chris Feng
branch: externals/exwm
commit 29f2289a750c9cf8f0d5cd968d306ee953a7bc0d
Author: Adrián Medraño Calvo 
Commit: Chris Feng 

Consistently name helper windows

* exwm.el (exwm--init-icccm-ewmh): Avoid naming the root window.
(exwm--wmsn-acquire): Use the symbol name in the window name.
* exwm-systemtray.el (exwm-systemtray--embedder-window): Rename
`exwm-systemtray--embedder' consistency.
(exwm-systemtray--init):  Use symbol names in the window name.
---
 exwm-systemtray.el | 37 +
 exwm.el| 12 ++--
 2 files changed, 27 insertions(+), 22 deletions(-)

diff --git a/exwm-systemtray.el b/exwm-systemtray.el
index ba1e388..d3244ab 100644
--- a/exwm-systemtray.el
+++ b/exwm-systemtray.el
@@ -70,7 +70,7 @@ You shall use the default value if using auto-hide 
minibuffer."
 
 (defvar exwm-systemtray--connection nil "The X connection.")
 
-(defvar exwm-systemtray--embedder nil "The embedder window.")
+(defvar exwm-systemtray--embedder-window nil "The embedder window.")
 
 (defvar exwm-systemtray--list nil "The icon list.")
 
@@ -112,7 +112,7 @@ You shall use the default value if using auto-hide 
minibuffer."
   (xcb:+request exwm-systemtray--connection
   (make-instance 'xcb:ReparentWindow
  :window icon
- :parent exwm-systemtray--embedder
+ :parent exwm-systemtray--embedder-window
  :x 0
  ;; Vertically centered.
  :y (/ (- exwm-systemtray-height height*) 2)))
@@ -162,7 +162,8 @@ You shall use the default value if using auto-hide 
minibuffer."
   (make-instance 'xcb:xembed:EMBEDDED-NOTIFY
  :window icon
  :time xcb:Time:CurrentTime
- :embedder exwm-systemtray--embedder
+ :embedder
+ exwm-systemtray--embedder-window
  :version 0)
   exwm-systemtray--connection)))
   (push `(,icon . ,(make-instance 'exwm-systemtray--icon
@@ -190,7 +191,8 @@ You shall use the default value if using auto-hide 
minibuffer."
   "Refresh the system tray."
   ;; Make sure to redraw the embedder.
   (xcb:+request exwm-systemtray--connection
-  (make-instance 'xcb:UnmapWindow :window exwm-systemtray--embedder))
+  (make-instance 'xcb:UnmapWindow
+ :window exwm-systemtray--embedder-window))
   (let ((x exwm-systemtray-icon-gap)
 map)
 (dolist (pair exwm-systemtray--list)
@@ -207,14 +209,15 @@ You shall use the default value if using auto-hide 
minibuffer."
  exwm-workspace-current-index)))
   (xcb:+request exwm-systemtray--connection
   (make-instance 'xcb:ConfigureWindow
- :window exwm-systemtray--embedder
+ :window exwm-systemtray--embedder-window
  :value-mask (logior xcb:ConfigWindow:X
  xcb:ConfigWindow:Width)
  :x (- (aref workarea 2) x)
  :width x)))
 (when map
   (xcb:+request exwm-systemtray--connection
-  (make-instance 'xcb:MapWindow :window exwm-systemtray--embedder
+  (make-instance 'xcb:MapWindow
+ :window exwm-systemtray--embedder-window
   (xcb:flush exwm-systemtray--connection))
 
 (defun exwm-systemtray--on-DestroyNotify (data _synthetic)
@@ -230,7 +233,7 @@ You shall use the default value if using auto-hide 
minibuffer."
   (let ((obj (make-instance 'xcb:ReparentNotify)))
 (xcb:unmarshal obj data)
 (with-slots (window parent) obj
-  (when (and (/= parent exwm-systemtray--embedder)
+  (when (and (/= parent exwm-systemtray--embedder-window)
  (assoc window exwm-systemtray--list))
 (exwm-systemtray--unembed window)
 
@@ -325,7 +328,7 @@ You shall use the default value if using auto-hide 
minibuffer."
   (unless (exwm-workspace--minibuffer-own-frame-p)
 (xcb:+request exwm-systemtray--connection
 (make-instance 'xcb:ReparentWindow
-   :window exwm-systemtray--embedder
+   :window exwm-systemtray--embedder-window
:parent (string-to-number
 (frame-parameter exwm-workspace--current
  'window-id))
@@ -339,7 +342,7 @@ You shall use the default value if using auto-hide 
minibuffer."
   (unless (exwm-workspace--minibuffer-own-frame-p)
 (xcb:+request exwm-systemtray--connection
 (make-instance 'xcb:ConfigureWindow
-   :window exwm-systemtray--embedder
+   :window exwm-systemtray--emb

[elpa] externals/exwm updated (4d43e31 -> 2b1ed2c)

2018-08-19 Thread Chris Feng
ch11ng pushed a change to branch externals/exwm.

  from  4d43e31   Avoid using `set-mouse-position' to warp pointer
   new  29f2289   Consistently name helper windows
   new  8d15a39   Print log output to an EXWM-specific messages buffer
   new  ac600f0   Commands for interacting with the log buffer remotely
   new  33dec8d   Trace more functions
   new  b6a3b7b   ; Unimportant tweaks
   new  be10e26   Merge branch 'medranocalvo/exwm-log-buffer' into 
externals/exwm
   new  5c1aa4d   Consider windows of the frame being refreshed, not the 
selected one at the time exwm-layout--refresh runs
   new  11fecb5   Use more explicit argument for excluding minibuffers
   new  633065a   Don't assume order of `get-buffer-window-list' results
   new  f820217   Split exwm-layout--refresh into three functions
   new  d4a772f   ; Comment layout algorithm.
   new  2b1ed2c   Merge branch 'medranocalvo/fix-x-window-vanish' into 
externals/exwm


Summary of changes:
 exwm-core.el   |  25 +++---
 exwm-debug.el  | 113 +++
 exwm-input.el  |  32 
 exwm-layout.el | 139 +
 exwm-manage.el |  16 +-
 exwm-systemtray.el |  37 --
 exwm-workspace.el  |   7 +++
 exwm.el|  14 +++---
 8 files changed, 301 insertions(+), 82 deletions(-)
 create mode 100644 exwm-debug.el



[elpa] externals/exwm ac600f0 02/12: Commands for interacting with the log buffer remotely

2018-08-19 Thread Chris Feng
branch: externals/exwm
commit ac600f091630480188932ad8d2ee315c8ee84c8e
Author: Adrián Medraño Calvo 
Commit: Adrián Medraño Calvo 

Commands for interacting with the log buffer remotely

* exwm-debug.el (exwm-debug--clear, exwm-debug--mark): New
functions.
---
 exwm-core.el  |  5 +
 exwm-debug.el | 12 
 2 files changed, 17 insertions(+)

diff --git a/exwm-core.el b/exwm-core.el
index 66b7917..5c501e4 100644
--- a/exwm-core.el
+++ b/exwm-core.el
@@ -290,6 +290,11 @@ least SECS seconds later."
(/= ,i exwm-workspace-current-index)])
(number-sequence 0 (1- (exwm-workspace--count
 
+(exwm--debug
+  (let ((map exwm-mode-map))
+(define-key map "\C-c\C-l" #'exwm-debug--clear)
+(define-key map "\C-c\C-m" #'exwm-debug--mark)))
+
 (define-derived-mode exwm-mode nil "EXWM"
   "Major mode for managing X windows.
 
diff --git a/exwm-debug.el b/exwm-debug.el
index 89421da..cd2ec39 100644
--- a/exwm-debug.el
+++ b/exwm-debug.el
@@ -97,6 +97,18 @@ the passed OBJECTS.  See `format' for details."
  (debugger (lambda (&rest _) (exwm-debug--backtrace
  ,@forms))
 
+(defun exwm-debug--clear ()
+  "Clear the debug buffer."
+  (interactive)
+  (exwm-debug--with-debug-buffer
+   (erase-buffer)))
+
+(defun exwm-debug--mark ()
+  "Insert a mark in the debug buffer."
+  (interactive)
+  (exwm-debug--with-debug-buffer
+   (insert "\n")))
+
 
 
 (provide 'exwm-debug)



[elpa] externals/exwm be10e26 11/12: Merge branch 'medranocalvo/exwm-log-buffer' into externals/exwm

2018-08-19 Thread Chris Feng
branch: externals/exwm
commit be10e261cc05219067f4d6fac137f4a664ece12b
Merge: 29f2289 b6a3b7b
Author: Chris Feng 
Commit: Chris Feng 

Merge branch 'medranocalvo/exwm-log-buffer' into externals/exwm
---
 exwm-core.el  |  25 +---
 exwm-debug.el | 113 ++
 exwm-input.el |  32 
 exwm-layout.el|  14 +++
 exwm-manage.el|  16 +++-
 exwm-workspace.el |   7 
 exwm.el   |   2 +
 7 files changed, 202 insertions(+), 7 deletions(-)

diff --git a/exwm-core.el b/exwm-core.el
index ab5159c..8d5e6dd 100644
--- a/exwm-core.el
+++ b/exwm-core.el
@@ -31,9 +31,7 @@
 (require 'xcb)
 (require 'xcb-icccm)
 (require 'xcb-ewmh)
-
-(eval-and-compile
-  (defvar exwm-debug-on nil "Non-nil to turn on debug for EXWM."))
+(require 'exwm-debug)
 
 (defvar exwm--connection nil "X connection.")
 
@@ -70,10 +68,18 @@
 (declare-function exwm-workspace-move-window "exwm-workspace.el"
   (frame-or-index &optional id))
 
-(defmacro exwm--log (format-string &rest args)
-  "Print debug message."
+(defmacro exwm--log (&optional format-string &rest objects)
+  "Emit a message prepending the name of the function being executed.
+
+FORMAT-STRING is a string specifying the message to output, as in
+`format'.  The OBJECTS arguments specify the substitutions."
   (when exwm-debug-on
-`(message (concat "[EXWM] " ,format-string) ,@args)))
+(unless format-string (setq format-string ""))
+`(progn
+   (exwm-debug--message (concat "%s:\t" ,format-string "\n")
+(exwm-debug--compile-time-function-name)
+,@objects)
+   nil)))
 
 (defmacro exwm--debug (&rest forms)
   (when exwm-debug-on `(progn ,@forms)))
@@ -88,6 +94,7 @@
 
 (defun exwm--lock (&rest _args)
   "Lock (disable all events)."
+  (exwm--log)
   (xcb:+request exwm--connection
   (make-instance 'xcb:ChangeWindowAttributes
  :window exwm--root
@@ -97,6 +104,7 @@
 
 (defun exwm--unlock (&rest _args)
   "Unlock (enable all events)."
+  (exwm--log)
   (xcb:+request exwm--connection
   (make-instance 'xcb:ChangeWindowAttributes
  :window exwm--root
@@ -281,6 +289,11 @@ least SECS seconds later."
(/= ,i exwm-workspace-current-index)])
(number-sequence 0 (1- (exwm-workspace--count
 
+(exwm--debug
+  (let ((map exwm-mode-map))
+(define-key map "\C-c\C-l" #'exwm-debug-clear)
+(define-key map "\C-c\C-m" #'exwm-debug-mark)))
+
 (define-derived-mode exwm-mode nil "EXWM"
   "Major mode for managing X windows.
 
diff --git a/exwm-debug.el b/exwm-debug.el
new file mode 100644
index 000..4d1ca7b
--- /dev/null
+++ b/exwm-debug.el
@@ -0,0 +1,113 @@
+;;; exwm-debug.el --- Debugging helpers for EXWM  -*- lexical-binding: t -*-
+
+;; Copyright (C) 2018 Free Software Foundation, Inc.
+
+;; Author: Adrián Medraño Calvo 
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see .
+
+;;; Commentary:
+
+;; This module collects functions that help in debugging EXWM.
+
+;;; Code:
+
+(eval-and-compile
+  (defvar exwm-debug-on nil "Non-nil to turn on debug for EXWM."))
+
+(defvar exwm-debug-buffer "*EXWM-DEBUG*" "Buffer to write debug messages to.")
+
+(defvar exwm-debug-backtrace-start-frame 5
+  "From which frame to start collecting backtraces.")
+
+(defun exwm-debug--call-stack ()
+  "Return the current call stack frames."
+  (let (frames frame
+;; No need to acount for our setq, while, let, ...
+(index exwm-debug-backtrace-start-frame))
+(while (setq frame (backtrace-frame index))
+  (push frame frames)
+  (cl-incf index))
+(cl-remove-if-not 'car frames)))
+
+(defmacro exwm-debug--compile-time-function-name ()
+  "Get the name of outermost definition at expansion time."
+  (let* ((frame (cl-find-if
+(lambda (frame)
+  (ignore-errors
+(let ((clause (car (cl-third frame
+  (or (equal clause 'defalias)
+  (equal clause 'cl-defmethod)
+(reverse (exwm-debug--call-stack
+(defn (cl-third frame))
+(deftype (car defn)))
+(cl-case deftype
+  ((defalias) (symbol-name (cl-cadadr defn)))
+  ((cl-defmethod) (symbol-name (cadr defn)))
+

[elpa] externals/exwm b6a3b7b 08/12: ; Unimportant tweaks

2018-08-19 Thread Chris Feng
branch: externals/exwm
commit b6a3b7b3ad67fe69d82d335e5520ba7368bab768
Author: Chris Feng 
Commit: Chris Feng 

; Unimportant tweaks
---
 exwm-core.el  |  7 ++-
 exwm-debug.el | 23 ++-
 exwm-input.el |  4 ++--
 3 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/exwm-core.el b/exwm-core.el
index 3159519..8d5e6dd 100644
--- a/exwm-core.el
+++ b/exwm-core.el
@@ -33,9 +33,6 @@
 (require 'xcb-ewmh)
 (require 'exwm-debug)
 
-(eval-and-compile
-  (defvar exwm-debug-on nil "Non-nil to turn on debug for EXWM."))
-
 (defvar exwm--connection nil "X connection.")
 
 (defvar exwm--wmsn-window nil
@@ -294,8 +291,8 @@ least SECS seconds later."
 
 (exwm--debug
   (let ((map exwm-mode-map))
-(define-key map "\C-c\C-l" #'exwm-debug--clear)
-(define-key map "\C-c\C-m" #'exwm-debug--mark)))
+(define-key map "\C-c\C-l" #'exwm-debug-clear)
+(define-key map "\C-c\C-m" #'exwm-debug-mark)))
 
 (define-derived-mode exwm-mode nil "EXWM"
   "Major mode for managing X windows.
diff --git a/exwm-debug.el b/exwm-debug.el
index cd2ec39..4d1ca7b 100644
--- a/exwm-debug.el
+++ b/exwm-debug.el
@@ -1,9 +1,8 @@
 ;;; exwm-debug.el --- Debugging helpers for EXWM  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2015-2016 Free Software Foundation, Inc.
+;; Copyright (C) 2018 Free Software Foundation, Inc.
 
-;; Author: Chris Feng 
-;; Adrián Medraño Calvo 
+;; Author: Adrián Medraño Calvo 
 
 ;; This file is part of GNU Emacs.
 
@@ -29,18 +28,16 @@
 (eval-and-compile
   (defvar exwm-debug-on nil "Non-nil to turn on debug for EXWM."))
 
-(defvar exwm-debug-buffer
-  (when exwm-debug-on
-(let ((buffer (get-buffer-create "*EXWM-DEBUG*")))
-  (buffer-disable-undo buffer)
-  buffer))
-  "Buffer to write debug messages to.")
+(defvar exwm-debug-buffer "*EXWM-DEBUG*" "Buffer to write debug messages to.")
+
+(defvar exwm-debug-backtrace-start-frame 5
+  "From which frame to start collecting backtraces.")
 
 (defun exwm-debug--call-stack ()
   "Return the current call stack frames."
   (let (frames frame
 ;; No need to acount for our setq, while, let, ...
-(index 5))
+(index exwm-debug-backtrace-start-frame))
 (while (setq frame (backtrace-frame index))
   (push frame frames)
   (cl-incf index))
@@ -64,7 +61,7 @@
 
 (defmacro exwm-debug--with-debug-buffer (&rest forms)
   "Evaluate FORMS making sure `exwm-debug-buffer' is correctly updated."
-  `(with-current-buffer exwm-debug-buffer
+  `(with-current-buffer (get-buffer-create exwm-debug-buffer)
  (let (windows-eob)
;; Note windows whose point is at EOB.
(dolist (w (get-buffer-window-list exwm-debug-buffer t t))
@@ -97,13 +94,13 @@ the passed OBJECTS.  See `format' for details."
  (debugger (lambda (&rest _) (exwm-debug--backtrace
  ,@forms))
 
-(defun exwm-debug--clear ()
+(defun exwm-debug-clear ()
   "Clear the debug buffer."
   (interactive)
   (exwm-debug--with-debug-buffer
(erase-buffer)))
 
-(defun exwm-debug--mark ()
+(defun exwm-debug-mark ()
   "Insert a mark in the debug buffer."
   (interactive)
   (exwm-debug--with-debug-buffer
diff --git a/exwm-input.el b/exwm-input.el
index 7885d18..57fed2d 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -377,7 +377,7 @@ ARGS are additional arguments to CALLBACK."
 button-event window buffer frame)
 (xcb:unmarshal obj data)
 (exwm--log "major-mode=%s buffer=%s"
-major-mode (buffer-name (current-buffer)))
+   major-mode (buffer-name (current-buffer)))
 (with-slots (detail time event state) obj
   (setq button-event (xcb:keysyms:keysym->event exwm--connection
 detail state)
@@ -428,7 +428,7 @@ ARGS are additional arguments to CALLBACK."
   (let ((obj (make-instance 'xcb:KeyPress)))
 (xcb:unmarshal obj data)
 (exwm--log "major-mode=%s buffer=%s"
-major-mode (buffer-name (current-buffer)))
+  major-mode (buffer-name (current-buffer)))
 (if (derived-mode-p 'exwm-mode)
 (funcall exwm--on-KeyPress obj data)
   (exwm-input--on-KeyPress-char-mode obj



[elpa] externals/exwm 5c1aa4d 04/12: Consider windows of the frame being refreshed, not the selected one at the time exwm-layout--refresh runs

2018-08-19 Thread Chris Feng
branch: externals/exwm
commit 5c1aa4dc310444c1a73c273b581f9e5868cb9a6d
Author: Adrián Medraño Calvo 
Commit: Adrián Medraño Calvo 

Consider windows of the frame being refreshed, not the selected one at the 
time exwm-layout--refresh runs

* exwm-layout.el (exwm-layout--refresh): Consider windows of the
frame being refreshed instead of the selected frame.
---
 exwm-layout.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/exwm-layout.el b/exwm-layout.el
index 9427607..a03b6fb 100644
--- a/exwm-layout.el
+++ b/exwm-layout.el
@@ -293,7 +293,7 @@ selected by `other-buffer'."
  (or exwm-layout-show-all-buffers
  ;; Exclude X windows on other workspaces
  (eq frame exwm--frame)))
-(setq windows (get-buffer-window-list (current-buffer) 0))
+(setq windows (get-buffer-window-list (current-buffer) 0 frame))
 (if (not windows)
 (when (eq frame exwm--frame)
   (exwm-layout--hide exwm--id))