aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2015-07-25 19:33:51 +0300
committerEli Zaretskii2015-07-25 19:33:51 +0300
commit7c3506eda86d7e6539cf15836c01d3d5321a9f0e (patch)
tree38717ee586e5bc3cca6a6d4f635323d71aac1ffa /src
parent5e63841f2847b0b07cf15aed98c26fe914e9804a (diff)
downloademacs-7c3506eda86d7e6539cf15836c01d3d5321a9f0e.tar.gz
emacs-7c3506eda86d7e6539cf15836c01d3d5321a9f0e.zip
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)
Diffstat (limited to 'src')
-rw-r--r--src/w32fns.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/w32fns.c b/src/w32fns.c
index 8f9c56c5420..bf81078d010 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -6935,7 +6935,8 @@ If optional parameter FRAME is not specified, use selected frame. */)
6935 6935
6936 CHECK_NUMBER (command); 6936 CHECK_NUMBER (command);
6937 6937
6938 PostMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, XINT (command), 0); 6938 if (FRAME_W32_P (f))
6939 PostMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, XINT (command), 0);
6939 6940
6940 return Qnil; 6941 return Qnil;
6941} 6942}
@@ -7522,6 +7523,9 @@ If FRAME is omitted or nil, the selected frame is used. */)
7522 MENUBARINFO menu_bar; 7523 MENUBARINFO menu_bar;
7523 int width, height, single_height, wrapped_height; 7524 int width, height, single_height, wrapped_height;
7524 7525
7526 if (FRAME_INITIAL_P (f))
7527 return Qnil;
7528
7525 block_input (); 7529 block_input ();
7526 7530
7527 single_height = GetSystemMetrics (SM_CYMENU); 7531 single_height = GetSystemMetrics (SM_CYMENU);
@@ -7553,6 +7557,9 @@ title bar and decorations. */)
7553 struct frame *f = decode_live_frame (frame); 7557 struct frame *f = decode_live_frame (frame);
7554 RECT rect; 7558 RECT rect;
7555 7559
7560 if (FRAME_INITIAL_P (f))
7561 return Qnil;
7562
7556 block_input (); 7563 block_input ();
7557 7564
7558 if (!NILP (client)) 7565 if (!NILP (client))
@@ -7610,6 +7617,9 @@ elements (all size values are in pixels).
7610 int single_bar_height, wrapped_bar_height, menu_bar_height; 7617 int single_bar_height, wrapped_bar_height, menu_bar_height;
7611 Lisp_Object fullscreen = Fframe_parameter (frame, Qfullscreen); 7618 Lisp_Object fullscreen = Fframe_parameter (frame, Qfullscreen);
7612 7619
7620 if (FRAME_INITIAL_P (f))
7621 return Qnil;
7622
7613 block_input (); 7623 block_input ();
7614 7624
7615 /* Outer frame rectangle, including outer borders and title bar. */ 7625 /* Outer frame rectangle, including outer borders and title bar. */