From df8de921132520cccf4236906bcd37aec83fa0ce Mon Sep 17 00:00:00 2001 From: Chris Feng Date: Sun, 20 May 2018 16:14:01 +0800 Subject: [PATCH] Provide a fallback value for X window geometry * exwm-manage.el (exwm-manage--update-geometry): Ditto. --- exwm-layout.el | 4 ++-- exwm-manage.el | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/exwm-layout.el b/exwm-layout.el index 5b7fe99..b5685f4 100644 --- a/exwm-layout.el +++ b/exwm-layout.el @@ -45,9 +45,9 @@ (defvar exwm-layout--timer nil "Timer used to track echo area changes.") (defvar exwm-workspace--current) +(declare-function exwm-input--release-keyboard "exwm-input.el") +(declare-function exwm-input--grab-keyboard "exwm-input.el") (declare-function exwm-input-grab-keyboard "exwm-input.el") -(declare-function exwm-input-release-keyboard "exwm-input.el") -(declare-function exwm-reset "exwm.el" ()) (declare-function exwm-workspace--client-p "exwm-workspace.el" (&optional frame)) (declare-function exwm-workspace--minibuffer-own-frame-p "exwm-workspace.el") diff --git a/exwm-manage.el b/exwm-manage.el index f440710..ba5bc83 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."