emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 7c3506e: Avoid crashes when w32 GUI functions are c


From: Eli Zaretskii
Subject: [Emacs-diffs] master 7c3506e: Avoid crashes when w32 GUI functions are called in -batch
Date: Sat, 25 Jul 2015 16:34:52 +0000

branch: master
commit 7c3506eda86d7e6539cf15836c01d3d5321a9f0e
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Avoid crashes when w32 GUI functions are called in -batch
    
    * src/w32fns.c (Fx_frame_geometry, Fw32_frame_rect)
    (Fw32_frame_menu_bar_size, Fw32_send_sys_command): Don't call
    FRAME_W32_WINDOW for initial frame.  (Bug#21132)
---
 src/w32fns.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/src/w32fns.c b/src/w32fns.c
index 8f9c56c..bf81078 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -6935,7 +6935,8 @@ If optional parameter FRAME is not specified, use 
selected frame.  */)
 
   CHECK_NUMBER (command);
 
-  PostMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, XINT (command), 0);
+  if (FRAME_W32_P (f))
+    PostMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, XINT (command), 0);
 
   return Qnil;
 }
@@ -7522,6 +7523,9 @@ If FRAME is omitted or nil, the selected frame is used.  
*/)
   MENUBARINFO menu_bar;
   int width, height, single_height, wrapped_height;
 
+  if (FRAME_INITIAL_P (f))
+    return Qnil;
+
   block_input ();
 
   single_height = GetSystemMetrics (SM_CYMENU);
@@ -7553,6 +7557,9 @@ title bar and decorations.  */)
   struct frame *f = decode_live_frame (frame);
   RECT rect;
 
+  if (FRAME_INITIAL_P (f))
+    return Qnil;
+
   block_input ();
 
   if (!NILP (client))
@@ -7610,6 +7617,9 @@ elements (all size values are in pixels).
   int single_bar_height, wrapped_bar_height, menu_bar_height;
   Lisp_Object fullscreen = Fframe_parameter (frame, Qfullscreen);
 
+  if (FRAME_INITIAL_P (f))
+    return Qnil;
+
   block_input ();
 
   /* Outer frame rectangle, including outer borders and title bar. */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]