From 917ad15f0318e760e3f0b41ad0d3633c6ed1c703 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 9 May 1995 04:47:52 +0000 Subject: [PATCH] (Funfocus_frame): Check for live X frame. --- src/xfns.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/xfns.c b/src/xfns.c index 722c6791dc1..712dac5696b 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -3024,12 +3024,16 @@ DEFUN ("unfocus-frame", Funfocus_frame, Sunfocus_frame, 0, 0, 0, "If a frame has been focused, release it.") () { - struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (selected_frame); - if (dpyinfo->x_focus_frame) + if (FRAME_X_P (selected_frame)) { - BLOCK_INPUT; - x_unfocus_frame (dpyinfo->x_focus_frame); - UNBLOCK_INPUT; + struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (selected_frame); + + if (dpyinfo->x_focus_frame) + { + BLOCK_INPUT; + x_unfocus_frame (dpyinfo->x_focus_frame); + UNBLOCK_INPUT; + } } return Qnil; -- 2.39.2