From 3d648ef1c4a754ad89083868190b8e982568b6f5 Mon Sep 17 00:00:00 2001 From: Feng Shu Date: Fri, 23 Apr 2021 19:15:53 +0800 Subject: 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 acf718e27f..86b82ed549 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)) -- cgit 1.4.1 From 182ffbed6c7334ee51cb5cd2645ba0ee42c4da13 Mon Sep 17 00:00:00 2001 From: Matt Beshara Date: Mon, 6 Sep 2021 14:46:16 +1000 Subject: Use a hash table to cache result of ‘exwm-workspace--client-p’ 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 cff17f3a11..c1de5da9a3 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.") -- cgit 1.4.1 From 8905e85d34082e6a0a175edc9954eb2d8d0e1473 Mon Sep 17 00:00:00 2001 From: Matt Beshara Date: Wed, 15 Sep 2021 12:49:49 +1000 Subject: Rename variable using ‘exwm-workspace’ package prefix; add docstring 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 c1de5da9a3..ddf20ea409 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 -- cgit 1.4.1 From d0b0b38c8709c9d429b3697aea30814717d802d7 Mon Sep 17 00:00:00 2001 From: Matt Beshara Date: Sat, 2 Oct 2021 14:28:18 +1000 Subject: 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 ddf20ea409..996d33f495 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." -- cgit 1.4.1 From 835a7add7caa4f59c065e34b8a68cbaed5c6f37b Mon Sep 17 00:00:00 2001 From: Adrián Medraño Calvo Date: Fri, 29 Oct 2021 00:00:00 +0000 Subject: New maintainer --- exwm.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exwm.el b/exwm.el index fc96ac7509..1e6122ecc8 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 -- cgit 1.4.1 From c1206ac6653f09158b7b390aaeeec8fe3fb3c0b0 Mon Sep 17 00:00:00 2001 From: Adrián Medraño Calvo Date: Fri, 29 Oct 2021 00:00:00 +0000 Subject: 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 9228477858..8a45010030 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 bb8258a714..9609f4cf3c 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 76454894ab..5356ef9b97 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 d1882cf746..a9f9315b71 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 decfc8128c..c27ee1b04f 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 79d0c95bcd..6a63be33d4 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 a7866f1ef8..c3d47f7225 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 7acceb1324..68bfdd70e9 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 20dc5226cf..43b3e1eaef 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 cff17f3a11..6fa7e9dca4 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 acf718e27f..4bc084a73b 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 1e6122ecc8..9091d30114 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 -- cgit 1.4.1 From deabe9c2df0333a45b7dafbad1ad11b99e178d04 Mon Sep 17 00:00:00 2001 From: Adrián Medraño Calvo Date: Fri, 29 Oct 2021 00:00:00 +0000 Subject: Bump version to 0.25 --- exwm.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exwm.el b/exwm.el index 9091d30114..367fadecff 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 -- cgit 1.4.1 From 571ca227e7857b5fd95f4f3211d471083d69ec32 Mon Sep 17 00:00:00 2001 From: Adrián Medraño Calvo Date: Sat, 30 Oct 2021 00:00:00 +0000 Subject: 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 6a63be33d4..4b6e2a8f66 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 -- cgit 1.4.1 From 5098708c924718b427c258e1757ae1dc39d8278a Mon Sep 17 00:00:00 2001 From: Adrián Medraño Calvo Date: Tue, 2 Nov 2021 00:00:00 +0000 Subject: 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 273ead7f01..c513347119 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." -- cgit 1.4.1 From 08f20ea0b9ea961c579720bf0d305c7a9cea650a Mon Sep 17 00:00:00 2001 From: Adrián Medraño Calvo Date: Wed, 10 Nov 2021 00:00:00 +0000 Subject: 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 4b6e2a8f66..9173a1c049 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) -- cgit 1.4.1 From 10bd12234e896d35a2c4eafabc62a31126d23bf3 Mon Sep 17 00:00:00 2001 From: Adrián Medraño Calvo Date: Wed, 10 Nov 2021 00:00:00 +0000 Subject: Bump version to 0.26 --- exwm.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exwm.el b/exwm.el index 367fadecff..b025f6b49a 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 -- cgit 1.4.1