diff options
author | Chris Feng <chris.w.feng@gmail.com> | 2018-05-20T08·14+0800 |
---|---|---|
committer | Chris Feng <chris.w.feng@gmail.com> | 2018-05-20T08·14+0800 |
commit | df8de921132520cccf4236906bcd37aec83fa0ce (patch) | |
tree | 969c4d4af806e00317df7783de0b43e42e0eff7b /exwm-manage.el | |
parent | 0037cba87b1ceefc3a65fa3c458aa685689e7e27 (diff) |
Provide a fallback value for X window geometry
* exwm-manage.el (exwm-manage--update-geometry): Ditto.
Diffstat (limited to 'exwm-manage.el')
-rw-r--r-- | exwm-manage.el | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/exwm-manage.el b/exwm-manage.el index f44071020d2d..ba5bc83b00fa 100644 --- a/exwm-manage.el +++ b/exwm-manage.el @@ -123,8 +123,14 @@ You can still make the X windows floating afterwards." (unless (and exwm--geometry (not force)) (let ((reply (xcb:+request-unchecked+reply exwm--connection (make-instance 'xcb:GetGeometry :drawable id)))) - (when reply ;nil when destroyed - (setq exwm--geometry reply)))))) + (setq exwm--geometry + (or reply + ;; Provide a reasonable fallback value. + (make-instance 'xcb:RECTANGLE + :x 0 + :y 0 + :width (/ (x-display-pixel-width) 2) + :height (/ (x-display-pixel-height) 2)))))))) (defun exwm-manage--update-ewmh-state (id) "Update _NET_WM_STATE." |