From: Martin Rudalics Date: Sun, 26 Jul 2015 10:41:16 +0000 (+0200) Subject: Have `x-frame-geometry' return nil for terminal and initial frames (Bug#21132) X-Git-Tag: emacs-25.0.90~1432 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fac8492664246c49ee145802cc124aa9e1636e7b;p=emacs.git 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 --- diff --git a/src/nsfns.m b/src/nsfns.m index a165304741c..0fc867c1ebb 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -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 diff --git a/src/w32fns.c b/src/w32fns.c index bf81078d010..abfa315e2a9 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -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 (); diff --git a/src/xfns.c b/src/xfns.c index fe3237f8500..8137ceacb88 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -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);