[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/exwm cff02333e2 01/14: Don't assume that exwm--connecti
From: |
ELPA Syncer |
Subject: |
[elpa] externals/exwm cff02333e2 01/14: Don't assume that exwm--connection is non-nil |
Date: |
Wed, 6 Sep 2023 15:57:51 -0400 (EDT) |
branch: externals/exwm
commit cff02333e282c692aa685d57cc2b7c32419fffe2
Author: Nacho Barrientos <nacho.barrientos@cern.ch>
Commit: Adrián Medraño Calvo <adrian@medranocalvo.com>
Don't assume that exwm--connection is non-nil
`exwm-input--exit` could be called (via `exwm-exit`) from `exwm-init`
in case of error when initialising EXWM. It could happen that the bit
that failed when exwm-init is executed was the call to `xcb:connect`,
hence `exwm--connection` would be nil when errors are handled (and
`exwm-exit` is called).
Without this patch, in the case above, the user will see a crash as
there's no method allowing a nil XCB connection object:
Debugger entered--Lisp error:
(cl-no-applicable-method xcb:-+request nil #<xcb:SetInputFocus ...
even worse, not even giving the chance to the `warn` call in
`exwm-init`'s error handler to actually inform the user about the
actual problem ("[XELB] Connection timeout", for instance).
* exwm-input.el (exwm-input--exit): Check `exwm--connection' is
set before trying to send requests.
---
exwm-input.el | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/exwm-input.el b/exwm-input.el
index 79bc78ef0f..2c65116aa3 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -1215,12 +1215,13 @@ One use is to access the keymap bound to KEYS (as
prefix keys) in char-mode."
(when exwm-input--update-focus-timer
(cancel-timer exwm-input--update-focus-timer))
;; Make input focus working even without a WM.
- (xcb:+request exwm--connection
- (make-instance 'xcb:SetInputFocus
- :revert-to xcb:InputFocus:PointerRoot
- :focus exwm--root
- :time xcb:Time:CurrentTime))
- (xcb:flush exwm--connection))
+ (when exwm--connection
+ (xcb:+request exwm--connection
+ (make-instance 'xcb:SetInputFocus
+ :revert-to xcb:InputFocus:PointerRoot
+ :focus exwm--root
+ :time xcb:Time:CurrentTime))
+ (xcb:flush exwm--connection)))
- [elpa] externals/exwm updated (a417f0d45e -> 381637aa1c), ELPA Syncer, 2023/09/06
- [elpa] externals/exwm b100eb74c5 04/14: Merge branch 'nbarrientos.github.com/ib_exwm_conn_nil' into externals/exwm, ELPA Syncer, 2023/09/06
- [elpa] externals/exwm 23f1ca740d 07/14: Selectively ignore left & right struts in horizontally aligned monitors, ELPA Syncer, 2023/09/06
- [elpa] externals/exwm 612e64bf9b 10/14: Update copyright year to 2023, ELPA Syncer, 2023/09/06
- [elpa] externals/exwm d340a6a563 08/14: Merge branch 'jollm.github.com/ignore-struts-top-bottom' into externals/exwm, ELPA Syncer, 2023/09/06
- [elpa] externals/exwm c7d1fd45bc 12/14: Fix layout being refreshed too often on minibuffer setup, ELPA Syncer, 2023/09/06
- [elpa] externals/exwm 67c5b316be 05/14: Convert `exwm-workspace--workareas' to a list of `xcb:RECTANGLE's, ELPA Syncer, 2023/09/06
- [elpa] externals/exwm cff02333e2 01/14: Don't assume that exwm--connection is non-nil,
ELPA Syncer <=
- [elpa] externals/exwm 7318f857f2 02/14: Observe connection status on deinitialization, ELPA Syncer, 2023/09/06
- [elpa] externals/exwm d8fcf18db7 09/14: Declare defsubst indentation, ELPA Syncer, 2023/09/06
- [elpa] externals/exwm fb73aaaf8f 11/14: Convert `lsh' to `ash', ELPA Syncer, 2023/09/06
- [elpa] externals/exwm d3567a8c7f 13/14: Fix bytecompiler warnings, improve docstrings, ELPA Syncer, 2023/09/06
- [elpa] externals/exwm 381637aa1c 14/14: Declare external function, ELPA Syncer, 2023/09/06
- [elpa] externals/exwm 4970d6ad4e 03/14: More selectively ignore top and bottom struts, ELPA Syncer, 2023/09/06
- [elpa] externals/exwm 937da86458 06/14: Convert `delta' to the size the strut occupies in the workarea, ELPA Syncer, 2023/09/06