From 3d648ef1c4a754ad89083868190b8e982568b6f5 Mon Sep 17 00:00:00 2001 From: Feng Shu Date: Fri, 23 Apr 2021 19:15:53 +0800 Subject: [PATCH 01/11] Add variable indicating XIM buffers * exwm-xim.el (exwm-xim-buffer-p): New variable. (exwm-xim--handle-forward-event-request): Add exwm-xim-buffer-p --- exwm-xim.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/exwm-xim.el b/exwm-xim.el index acf718e27..86b82ed54 100644 --- a/exwm-xim.el +++ b/exwm-xim.el @@ -161,6 +161,10 @@ C,no" (defvar exwm-xim--_XIM_PROTOCOL nil) (defvar exwm-xim--_XIM_XCONNECT nil) +(defvar exwm-xim-buffer-p nil + "Whether current buffer is used by exwm-xim.") +(make-variable-buffer-local 'exwm-xim-buffer-p) + (defun exwm-xim--on-SelectionRequest (data _synthetic) "Handle SelectionRequest events on IMS window. @@ -585,6 +589,9 @@ The actual XIM request is in client message data or a property." (exwm-input--grab-keyboard)) (unwind-protect (with-temp-buffer + ;; This variable is used to test whether exwm-xim is enabled. + ;; Used by e.g. pyim-probe. + (setq-local exwm-xim-buffer-p t) ;; Always show key strokes. (let ((input-method-use-echo-area t) (exwm-input-line-mode-passthrough t)) From 182ffbed6c7334ee51cb5cd2645ba0ee42c4da13 Mon Sep 17 00:00:00 2001 From: Matt Beshara Date: Mon, 6 Sep 2021 14:46:16 +1000 Subject: [PATCH 02/11] =?UTF-8?q?Use=20a=20hash=20table=20to=20cache=20res?= =?UTF-8?q?ult=20of=20=E2=80=98exwm-workspace--client-p=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * exwm-workspace.el (exwm--client-p-hash-table): New variable. (exwm-workspace--client-p): Use `exwm--client-p-hash-table' to store which workspace frames are client frames instead of frequently invoking `frame-parameter'. --- exwm-workspace.el | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/exwm-workspace.el b/exwm-workspace.el index cff17f3a1..c1de5da9a 100644 --- a/exwm-workspace.el +++ b/exwm-workspace.el @@ -165,10 +165,19 @@ NIL if FRAME is not a workspace" "Return t if FRAME is a workspace." (memq frame exwm-workspace--list)) +(defvar exwm--client-p-hash-table + (make-hash-table :test 'eq :weakness 'key)) + (defsubst exwm-workspace--client-p (&optional frame) "Return non-nil if FRAME is an emacsclient frame." - (or (frame-parameter frame 'client) - (not (display-graphic-p frame)))) + (let* ((frame (or frame (selected-frame))) + (cached-value (gethash frame exwm--client-p-hash-table 'absent))) + (if (eq cached-value 'absent) + (puthash frame + (or (frame-parameter frame 'client) + (not (display-graphic-p frame))) + exwm--client-p-hash-table) + cached-value))) (defvar exwm-workspace--switch-map nil "Keymap used for interactively selecting workspace.") From 8905e85d34082e6a0a175edc9954eb2d8d0e1473 Mon Sep 17 00:00:00 2001 From: Matt Beshara Date: Wed, 15 Sep 2021 12:49:49 +1000 Subject: [PATCH 03/11] =?UTF-8?q?Rename=20variable=20using=20=E2=80=98exwm?= =?UTF-8?q?-workspace=E2=80=99=20package=20prefix;=20add=20docstring?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * exwm-workspace.el (exwm-workspace--client-p-hash-table): Rename `exwm--client-p-hash-table'. --- exwm-workspace.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/exwm-workspace.el b/exwm-workspace.el index c1de5da9a..ddf20ea40 100644 --- a/exwm-workspace.el +++ b/exwm-workspace.el @@ -165,18 +165,20 @@ NIL if FRAME is not a workspace" "Return t if FRAME is a workspace." (memq frame exwm-workspace--list)) -(defvar exwm--client-p-hash-table - (make-hash-table :test 'eq :weakness 'key)) +(defvar exwm-workspace--client-p-hash-table + (make-hash-table :test 'eq :weakness 'key) + "Used to cache the results of calling ‘exwm-workspace--client-p’.") (defsubst exwm-workspace--client-p (&optional frame) "Return non-nil if FRAME is an emacsclient frame." (let* ((frame (or frame (selected-frame))) - (cached-value (gethash frame exwm--client-p-hash-table 'absent))) + (cached-value + (gethash frame exwm-workspace--client-p-hash-table 'absent))) (if (eq cached-value 'absent) (puthash frame (or (frame-parameter frame 'client) (not (display-graphic-p frame))) - exwm--client-p-hash-table) + exwm-workspace--client-p-hash-table) cached-value))) (defvar exwm-workspace--switch-map nil From d0b0b38c8709c9d429b3697aea30814717d802d7 Mon Sep 17 00:00:00 2001 From: Matt Beshara Date: Sat, 2 Oct 2021 14:28:18 +1000 Subject: [PATCH 04/11] Explicitly remove workspace frames from client-p cache when deleted * exwm-workspace.el (exwm-workspace--on-delete-frame): Clean up hash table entries upon removing a workspace. --- exwm-workspace.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exwm-workspace.el b/exwm-workspace.el index ddf20ea40..996d33f49 100644 --- a/exwm-workspace.el +++ b/exwm-workspace.el @@ -1469,7 +1469,8 @@ the next workspace." ;; care of converting a workspace into a regular unmanaged frame. (let ((exwm-workspace--create-silently t)) (make-frame))) - (exwm-workspace--remove-frame-as-workspace frame)))) + (exwm-workspace--remove-frame-as-workspace frame) + (remhash frame exwm--client-p-hash-table)))) (defun exwm-workspace--on-after-make-frame (frame) "Hook run upon `make-frame' that configures FRAME as a workspace." From 835a7add7caa4f59c065e34b8a68cbaed5c6f37b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Medra=C3=B1o=20Calvo?= Date: Fri, 29 Oct 2021 00:00:00 +0000 Subject: [PATCH 05/11] New maintainer --- exwm.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exwm.el b/exwm.el index fc96ac750..1e6122ecc 100644 --- a/exwm.el +++ b/exwm.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2015-2020 Free Software Foundation, Inc. ;; Author: Chris Feng -;; Maintainer: Chris Feng +;; Maintainer: Adrián Medraño Calvo ;; Version: 0.24 ;; Package-Requires: ((xelb "0.18")) ;; Keywords: unix From c1206ac6653f09158b7b390aaeeec8fe3fb3c0b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Medra=C3=B1o=20Calvo?= Date: Fri, 29 Oct 2021 00:00:00 +0000 Subject: [PATCH 06/11] Update copyright year to 2021 --- exwm-cm.el | 2 +- exwm-config.el | 2 +- exwm-core.el | 2 +- exwm-floating.el | 2 +- exwm-input.el | 2 +- exwm-layout.el | 2 +- exwm-manage.el | 2 +- exwm-randr.el | 2 +- exwm-systemtray.el | 2 +- exwm-workspace.el | 2 +- exwm-xim.el | 2 +- exwm.el | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/exwm-cm.el b/exwm-cm.el index 922847785..8a4501003 100644 --- a/exwm-cm.el +++ b/exwm-cm.el @@ -1,6 +1,6 @@ ;;; exwm-cm.el --- Compositing Manager for EXWM -*- lexical-binding: t -*- -;; Copyright (C) 2016-2020 Free Software Foundation, Inc. +;; Copyright (C) 2016-2021 Free Software Foundation, Inc. ;; Author: Chris Feng diff --git a/exwm-config.el b/exwm-config.el index bb8258a71..9609f4cf3 100644 --- a/exwm-config.el +++ b/exwm-config.el @@ -1,6 +1,6 @@ ;;; exwm-config.el --- Predefined configurations -*- lexical-binding: t -*- -;; Copyright (C) 2015-2020 Free Software Foundation, Inc. +;; Copyright (C) 2015-2021 Free Software Foundation, Inc. ;; Author: Chris Feng diff --git a/exwm-core.el b/exwm-core.el index 76454894a..5356ef9b9 100644 --- a/exwm-core.el +++ b/exwm-core.el @@ -1,6 +1,6 @@ ;;; exwm-core.el --- Core definitions -*- lexical-binding: t -*- -;; Copyright (C) 2015-2020 Free Software Foundation, Inc. +;; Copyright (C) 2015-2021 Free Software Foundation, Inc. ;; Author: Chris Feng diff --git a/exwm-floating.el b/exwm-floating.el index d1882cf74..a9f9315b7 100644 --- a/exwm-floating.el +++ b/exwm-floating.el @@ -1,6 +1,6 @@ ;;; exwm-floating.el --- Floating Module for EXWM -*- lexical-binding: t -*- -;; Copyright (C) 2015-2020 Free Software Foundation, Inc. +;; Copyright (C) 2015-2021 Free Software Foundation, Inc. ;; Author: Chris Feng diff --git a/exwm-input.el b/exwm-input.el index decfc8128..c27ee1b04 100644 --- a/exwm-input.el +++ b/exwm-input.el @@ -1,6 +1,6 @@ ;;; exwm-input.el --- Input Module for EXWM -*- lexical-binding: t -*- -;; Copyright (C) 2015-2020 Free Software Foundation, Inc. +;; Copyright (C) 2015-2021 Free Software Foundation, Inc. ;; Author: Chris Feng diff --git a/exwm-layout.el b/exwm-layout.el index 79d0c95bc..6a63be33d 100644 --- a/exwm-layout.el +++ b/exwm-layout.el @@ -1,6 +1,6 @@ ;;; exwm-layout.el --- Layout Module for EXWM -*- lexical-binding: t -*- -;; Copyright (C) 2015-2020 Free Software Foundation, Inc. +;; Copyright (C) 2015-2021 Free Software Foundation, Inc. ;; Author: Chris Feng diff --git a/exwm-manage.el b/exwm-manage.el index a7866f1ef..c3d47f722 100644 --- a/exwm-manage.el +++ b/exwm-manage.el @@ -1,7 +1,7 @@ ;;; exwm-manage.el --- Window Management Module for -*- lexical-binding: t -*- ;;; EXWM -;; Copyright (C) 2015-2020 Free Software Foundation, Inc. +;; Copyright (C) 2015-2021 Free Software Foundation, Inc. ;; Author: Chris Feng diff --git a/exwm-randr.el b/exwm-randr.el index 7acceb132..68bfdd70e 100644 --- a/exwm-randr.el +++ b/exwm-randr.el @@ -1,6 +1,6 @@ ;;; exwm-randr.el --- RandR Module for EXWM -*- lexical-binding: t -*- -;; Copyright (C) 2015-2020 Free Software Foundation, Inc. +;; Copyright (C) 2015-2021 Free Software Foundation, Inc. ;; Author: Chris Feng diff --git a/exwm-systemtray.el b/exwm-systemtray.el index 20dc5226c..43b3e1eae 100644 --- a/exwm-systemtray.el +++ b/exwm-systemtray.el @@ -1,7 +1,7 @@ ;;; exwm-systemtray.el --- System Tray Module for -*- lexical-binding: t -*- ;;; EXWM -;; Copyright (C) 2016-2020 Free Software Foundation, Inc. +;; Copyright (C) 2016-2021 Free Software Foundation, Inc. ;; Author: Chris Feng diff --git a/exwm-workspace.el b/exwm-workspace.el index cff17f3a1..6fa7e9dca 100644 --- a/exwm-workspace.el +++ b/exwm-workspace.el @@ -1,6 +1,6 @@ ;;; exwm-workspace.el --- Workspace Module for EXWM -*- lexical-binding: t -*- -;; Copyright (C) 2015-2020 Free Software Foundation, Inc. +;; Copyright (C) 1015-2021 Free Software Foundation, Inc. ;; Author: Chris Feng diff --git a/exwm-xim.el b/exwm-xim.el index acf718e27..4bc084a73 100644 --- a/exwm-xim.el +++ b/exwm-xim.el @@ -1,6 +1,6 @@ ;;; exwm-xim.el --- XIM Module for EXWM -*- lexical-binding: t -*- -;; Copyright (C) 2019-2020 Free Software Foundation, Inc. +;; Copyright (C) 2019-2021 Free Software Foundation, Inc. ;; Author: Chris Feng diff --git a/exwm.el b/exwm.el index 1e6122ecc..9091d3011 100644 --- a/exwm.el +++ b/exwm.el @@ -1,6 +1,6 @@ ;;; exwm.el --- Emacs X Window Manager -*- lexical-binding: t -*- -;; Copyright (C) 2015-2020 Free Software Foundation, Inc. +;; Copyright (C) 2015-2021 Free Software Foundation, Inc. ;; Author: Chris Feng ;; Maintainer: Adrián Medraño Calvo From deabe9c2df0333a45b7dafbad1ad11b99e178d04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Medra=C3=B1o=20Calvo?= Date: Fri, 29 Oct 2021 00:00:00 +0000 Subject: [PATCH 07/11] Bump version to 0.25 --- exwm.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exwm.el b/exwm.el index 9091d3011..367fadecf 100644 --- a/exwm.el +++ b/exwm.el @@ -4,7 +4,7 @@ ;; Author: Chris Feng ;; Maintainer: Adrián Medraño Calvo -;; Version: 0.24 +;; Version: 0.25 ;; Package-Requires: ((xelb "0.18")) ;; Keywords: unix ;; URL: https://github.com/ch11ng/exwm From 571ca227e7857b5fd95f4f3211d471083d69ec32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Medra=C3=B1o=20Calvo?= Date: Sat, 30 Oct 2021 00:00:00 +0000 Subject: [PATCH 08/11] Remove duplicate code * exwm-layout.el (exwm-layout-unset-fullscreen): Remove double removal of `xcb:Atom:_NET_WM_STATE_FULLSCREEN' from `exwm--ewmh-state'. --- exwm-layout.el | 2 -- 1 file changed, 2 deletions(-) diff --git a/exwm-layout.el b/exwm-layout.el index 6a63be33d..4b6e2a8f6 100644 --- a/exwm-layout.el +++ b/exwm-layout.el @@ -219,8 +219,6 @@ (exwm-layout--fullscreen-p)) (cl-return-from exwm-layout-unset-fullscreen)) (with-current-buffer (if id (exwm--id->buffer id) (window-buffer)) - (setq exwm--ewmh-state - (delq xcb:Atom:_NET_WM_STATE_FULLSCREEN exwm--ewmh-state)) (if exwm--floating-frame (exwm-layout--show exwm--id (frame-root-window exwm--floating-frame)) (xcb:+request exwm--connection From 5098708c924718b427c258e1757ae1dc39d8278a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Medra=C3=B1o=20Calvo?= Date: Tue, 2 Nov 2021 00:00:00 +0000 Subject: [PATCH 09/11] Correct wrong variable name * exwm-workspace.el (exwm-workspace--on-delete-frame): Correct misstyped name of variable `exwm-workspace--client-p-hash-table'. --- exwm-workspace.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exwm-workspace.el b/exwm-workspace.el index 273ead7f0..c51334711 100644 --- a/exwm-workspace.el +++ b/exwm-workspace.el @@ -1470,7 +1470,7 @@ the next workspace." (let ((exwm-workspace--create-silently t)) (make-frame))) (exwm-workspace--remove-frame-as-workspace frame) - (remhash frame exwm--client-p-hash-table)))) + (remhash frame exwm-workspace--client-p-hash-table)))) (defun exwm-workspace--on-after-make-frame (frame) "Hook run upon `make-frame' that configures FRAME as a workspace." From 08f20ea0b9ea961c579720bf0d305c7a9cea650a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Medra=C3=B1o=20Calvo?= Date: Wed, 10 Nov 2021 00:00:00 +0000 Subject: [PATCH 10/11] Fix previous commit "Remove duplicate code" * exwm-layout.el (exwm-layout-unset-fullscreen): `xcb:Atom:_NET_WM_STATE_FULLSCREEN' must be excised before invoking `exwm-layout--show'. --- exwm-layout.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/exwm-layout.el b/exwm-layout.el index 4b6e2a8f6..9173a1c04 100644 --- a/exwm-layout.el +++ b/exwm-layout.el @@ -219,6 +219,11 @@ (exwm-layout--fullscreen-p)) (cl-return-from exwm-layout-unset-fullscreen)) (with-current-buffer (if id (exwm--id->buffer id) (window-buffer)) + ;; `exwm-layout--show' relies on `exwm--ewmh-state' to decide whether to + ;; fullscreen the window. + (setq exwm--ewmh-state + (delq xcb:Atom:_NET_WM_STATE_FULLSCREEN exwm--ewmh-state)) + (exwm-layout--set-ewmh-state exwm--id) (if exwm--floating-frame (exwm-layout--show exwm--id (frame-root-window exwm--floating-frame)) (xcb:+request exwm--connection @@ -231,9 +236,6 @@ (let ((window (get-buffer-window nil t))) (when window (exwm-layout--show exwm--id window)))) - (setq exwm--ewmh-state - (delq xcb:Atom:_NET_WM_STATE_FULLSCREEN exwm--ewmh-state)) - (exwm-layout--set-ewmh-state exwm--id) (xcb:flush exwm--connection) (set-window-dedicated-p (get-buffer-window) nil) (when (eq 'line-mode exwm--selected-input-mode) From 10bd12234e896d35a2c4eafabc62a31126d23bf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Medra=C3=B1o=20Calvo?= Date: Wed, 10 Nov 2021 00:00:00 +0000 Subject: [PATCH 11/11] Bump version to 0.26 --- exwm.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exwm.el b/exwm.el index 367fadecf..b025f6b49 100644 --- a/exwm.el +++ b/exwm.el @@ -4,7 +4,7 @@ ;; Author: Chris Feng ;; Maintainer: Adrián Medraño Calvo -;; Version: 0.25 +;; Version: 0.26 ;; Package-Requires: ((xelb "0.18")) ;; Keywords: unix ;; URL: https://github.com/ch11ng/exwm