[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#7048: 24.0.50; frame position calculation with vertical tool bar (Gt
bug#7048: 24.0.50; frame position calculation with vertical tool bar (Gtk+)
Thu, 16 Sep 2010 22:00:08 +0200
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)
1. emacs -Q
2. Click menu Options->Show/Hide->Tool-bar->On the left (or: ->On the
right, it doesn't matter which).
3. Move the frame to the left edge of the monitor display.
4. M-x speedbar
=> The speedbar frame opens overlapping the right side of the main frame
by the width of the vertical tool bar.
The reason for the overlap is that only frame-pixel-width is used (in
dframe-reposition-frame-emacs) to calculate the width, but this does not
take the tool bar into account. That's innocuous with the default
horizontal tool bar, but not when it's placed vertically. AFAICT there
is no easy way in Lisp to get this number (you can calculate it using
the (fullscreen . fullwidth) frame parameter with and without a vertical
tool bar, but it would be absurd to do that in the middle of a program).
But it seems straightforward to expose the value of FRAME_TOOLBAR_WIDTH
to Lisp, following the example of frame-pixel-width. The attached patch
does this (I did not bother to implement a wrapper like x_pixel_width in
Fframe_pixel_width, since I don't see an additional use for it in the
case of the tool bar width). This can then be used to make the correct
frame repositioning in dframe-reposition-frame-emacs, as in the attached
patch (I also increased the space on the right from 5 to 10 pixels, to
make it the same as the space on the left; alternatively, both could be
5 pixels, which on my system appears to leave no space between the two
frames). (This fixes the frame repositioning for the default value
'left-right of speedbar-default-position. I think there may be problems
with the value 'left or 'right when the parent frame is too close to the
display edge, but perhaps that can be regarded as a poor choice by the
user, so I didn't bother with it.)
In GNU Emacs 18.104.22.168 (i686-pc-linux-gnu, GTK+ Version 2.18.6)
of 2010-09-16 on escher
Windowing system distributor `The X.Org Foundation', version 11.0.10605000
configured using `configure '--with-imagemagick'
Description: tool bar width patch
- bug#7048: 24.0.50; frame position calculation with vertical tool bar (Gtk+),
Stephen Berman <=