(Funfocus_frame): Check for live X frame.
authorRichard M. Stallman <rms@gnu.org>
Tue, 9 May 1995 04:47:52 +0000 (04:47 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 9 May 1995 04:47:52 +0000 (04:47 +0000)
src/xfns.c

index 722c679..712dac5 100644 (file)
@@ -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;