about summary refs log tree commit diff
path: root/exwm.el
diff options
context:
space:
mode:
authorNacho Barrientos <nacho.barrientos@cern.ch>2023-05-07T10·45+0200
committerAdrián Medraño Calvo <adrian@medranocalvo.com>2023-06-09T00·00+0000
commitcff02333e282c692aa685d57cc2b7c32419fffe2 (patch)
treee7600b2a8bbb012e917a333dcba7c78844ac4c0a /exwm.el
parentb62d5e79b0c1799f2cd941b4cec5bf8492cb322c (diff)
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.
Diffstat (limited to 'exwm.el')
0 files changed, 0 insertions, 0 deletions