]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix calculation of tool bar width reported by `frame-geometry' (Bug#24107)
authorMartin Rudalics <rudalics@gmx.at>
Sat, 30 Jul 2016 12:11:12 +0000 (14:11 +0200)
committerMartin Rudalics <rudalics@gmx.at>
Sat, 30 Jul 2016 12:11:12 +0000 (14:11 +0200)
* src/w32fns.c (Fw32_frame_geometry): Fix calculation of tool
bar width (Bug#24107).  Reindent.
* src/xfns.c (frame_geometry): Fix calculation of tool bar
width on non-GTK builds.

src/w32fns.c
src/xfns.c

index 584e311230e640b5d639ffe35ac00ce4ee2d3e93..2b07bb20e422af039e12811b12c8b744eb84ee8c 100644 (file)
@@ -8465,24 +8465,25 @@ and width values are in pixels.
                Fcons (Qouter_size,
                       Fcons (make_number (right - left),
                              make_number (bottom - top))),
-          Fcons (Qexternal_border_size,
+               Fcons (Qexternal_border_size,
                       Fcons (make_number (external_border_width),
                              make_number (external_border_height))),
                Fcons (Qtitle_bar_size,
                       Fcons (make_number (title_bar_width),
                              make_number (title_bar_height))),
-          Fcons (Qmenu_bar_external, Qt),
-          Fcons (Qmenu_bar_size,
-                 Fcons (make_number
-                        (menu_bar.rcBar.right - menu_bar.rcBar.left),
-                        make_number (menu_bar_height))),
-          Fcons (Qtool_bar_external, Qnil),
+               Fcons (Qmenu_bar_external, Qt),
+               Fcons (Qmenu_bar_size,
+                      Fcons (make_number
+                             (menu_bar.rcBar.right - menu_bar.rcBar.left),
+                             make_number (menu_bar_height))),
+               Fcons (Qtool_bar_external, Qnil),
                Fcons (Qtool_bar_position, tool_bar_height ? Qtop : Qnil),
-          Fcons (Qtool_bar_size,
+               Fcons (Qtool_bar_size,
                       Fcons (make_number
                              (tool_bar_height
-                              ? right - left - 2 * internal_border_width
-                                     : 0),
+                              ? (right - left - 2 * external_border_width
+                                 - 2 * internal_border_width)
+                              : 0),
                              make_number (tool_bar_height))),
                Fcons (Qinternal_border_width,
                       make_number (internal_border_width)));
index c44997b3d6fea414014917917001c9a6428465c4..ccea20eef967ee588ad51c8b3caf19759ff2ef82 100644 (file)
@@ -4626,7 +4626,9 @@ frame_geometry (Lisp_Object frame, Lisp_Object attribute)
     }
 #else
   tool_bar_height = FRAME_TOOL_BAR_HEIGHT (f);
-  tool_bar_width = tool_bar_height ? native_width : 0;
+  tool_bar_width = (tool_bar_height
+                   ? native_width - 2 * internal_border_width
+                   : 0);
   inner_top += tool_bar_height;
 #endif