1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-06 05:52:32 -08:00

Have `x-frame-geometry' return nil for terminal and initial frames (Bug#21132)

* src/nsfns.m (Fx_frame_geometry):
* src/xfns.c (Fx_frame_geometry): Return nil for initial and
terminal frames.
* src/w32fns.c (Fw32_frame_menu_bar_size, Fw32_frame_rect)
(Fx_frame_geometry): Return nil for terminal frames
This commit is contained in:
Martin Rudalics 2015-07-26 12:41:16 +02:00
parent f2576da45c
commit fac8492664
3 changed files with 20 additions and 12 deletions

View file

@ -2877,18 +2877,24 @@ elements (all size values are in pixels).
int inner_width = FRAME_PIXEL_WIDTH (f);
int inner_height = FRAME_PIXEL_HEIGHT (f);
Lisp_Object fullscreen = Fframe_parameter (frame, Qfullscreen);
int border = f->border_width;
int title = FRAME_NS_TITLEBAR_HEIGHT (f);
int outer_width = FRAME_PIXEL_WIDTH (f) + 2 * border;
int outer_height = FRAME_PIXEL_HEIGHT (f) + 2 * border;
int tool_bar_height = FRAME_TOOLBAR_HEIGHT (f);
int tool_bar_width = tool_bar_height > 0
? outer_width - 2 * FRAME_INTERNAL_BORDER_WIDTH (f)
: 0;
int border, title, outer_width, outer_height;
int tool_bar_height, tool_bar_width;
// Always 0 on NS.
int menu_bar_height = 0;
int menu_bar_width = 0;
if (FRAME_INITIAL_P (f) || !FRAME_NS_P (f))
return Qnil;
border = f->border_width;
title = FRAME_NS_TITLEBAR_HEIGHT (f);
outer_width = FRAME_PIXEL_WIDTH (f) + 2 * border;
outer_height = FRAME_PIXEL_HEIGHT (f) + 2 * border;
tool_bar_height = FRAME_TOOLBAR_HEIGHT (f);
tool_bar_width = tool_bar_height > 0
? outer_width - 2 * FRAME_INTERNAL_BORDER_WIDTH (f)
: 0;
return
listn (CONSTYPE_HEAP, 10,
Fcons (Qframe_position,
@ -2917,7 +2923,6 @@ elements (all size values are in pixels).
make_number (inner_height))));
}
/* ==========================================================================
Class implementations

View file

@ -7523,7 +7523,7 @@ 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))
if (FRAME_INITIAL_P (f) || !FRAME_W32_P (f))
return Qnil;
block_input ();
@ -7557,7 +7557,7 @@ title bar and decorations. */)
struct frame *f = decode_live_frame (frame);
RECT rect;
if (FRAME_INITIAL_P (f))
if (FRAME_INITIAL_P (f) || !FRAME_W32_P (f))
return Qnil;
block_input ();
@ -7617,7 +7617,7 @@ 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))
if (FRAME_INITIAL_P (f) || !FRAME_W32_P (f))
return Qnil;
block_input ();

View file

@ -4359,6 +4359,9 @@ elements (all size values are in pixels).
int left_off, right_off, top_off, bottom_off, outer_border;
XWindowAttributes atts;
if (FRAME_INITIAL_P (f) || !FRAME_X_P (f))
return Qnil;
block_input ();
XGetWindowAttributes (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &atts);