From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 16 15:58:01 2010 Received: (at submit) by debbugs.gnu.org; 16 Sep 2010 19:58:01 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OwKam-0001kO-Qt for submit@debbugs.gnu.org; Thu, 16 Sep 2010 15:58:01 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OwKai-0001kJ-LT for submit@debbugs.gnu.org; Thu, 16 Sep 2010 15:57:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OwKcx-0006mf-PW for submit@debbugs.gnu.org; Thu, 16 Sep 2010 16:00:16 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:55692) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OwKcx-0006mZ-Ki for submit@debbugs.gnu.org; Thu, 16 Sep 2010 16:00:15 -0400 Received: from [140.186.70.92] (port=54328 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OwKcv-00009Z-T2 for bug-gnu-emacs@gnu.org; Thu, 16 Sep 2010 16:00:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OwKcu-0006lH-3N for bug-gnu-emacs@gnu.org; Thu, 16 Sep 2010 16:00:13 -0400 Received: from mailout-de.gmx.net ([213.165.64.23]:56195 helo=mail.gmx.net) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1OwKct-0006kk-HW for bug-gnu-emacs@gnu.org; Thu, 16 Sep 2010 16:00:12 -0400 Received: (qmail invoked by alias); 16 Sep 2010 20:00:09 -0000 Received: from i59F570D6.versanet.de (EHLO escher.home) [89.245.112.214] by mail.gmx.net (mp051) with SMTP; 16 Sep 2010 22:00:09 +0200 X-Authenticated: #20778731 X-Provags-ID: V01U2FsdGVkX1/RiLdifBrRGMoYAQGPyxIcK4g+cPVCcLbeRMYrMU ORQFm7ifM/hfWh Received: by escher.home (Postfix, from userid 1000) id 9597510350; Thu, 16 Sep 2010 22:00:08 +0200 (CEST) From: Stephen Berman To: bug-gnu-emacs@gnu.org Subject: 24.0.50; frame position calculation with vertical tool bar (Gtk+) Date: Thu, 16 Sep 2010 22:00:08 +0200 Message-ID: <87hbhpqx13.fsf@escher.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -4.6 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.6 (----) --=-=-= Content-Type: text/plain 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 24.0.50.7 (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' '--without-toolkit-scroll-bars'' --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=bzr-diff Content-Description: tool bar width patch === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-09-15 15:30:43 +0000 +++ lisp/ChangeLog 2010-09-16 18:08:37 +0000 @@ -1,3 +1,9 @@ +2010-09-16 Stephen Berman + + * dframe.el (dframe-reposition-frame-emacs): Use tool-bar-pixel-width + in calculating new frame position. Add more space between new and + parent on the left. + 2010-09-15 Stefan Monnier * emacs-lisp/bytecomp.el (byte-compile-warning-types): New type === modified file 'lisp/dframe.el' --- lisp/dframe.el 2010-01-13 08:35:10 +0000 +++ lisp/dframe.el 2010-09-16 17:01:33 +0000 @@ -430,7 +430,8 @@ (unless (or (not window-system) (eq window-system 'pc)) (let* ((pfx (dframe-frame-parameter parent-frame 'left)) (pfy (dframe-frame-parameter parent-frame 'top)) - (pfw (frame-pixel-width parent-frame)) + (pfw (+ (tool-bar-pixel-width parent-frame) + (frame-pixel-width parent-frame))) (pfh (frame-pixel-height parent-frame)) (nfw (frame-pixel-width new-frame)) (nfh (frame-pixel-height new-frame)) @@ -459,7 +460,7 @@ (- (x-display-pixel-height) (car (cdr pfy)) pfh) (car (cdr pfy))))) (cond ((eq location 'right) - (setq newleft (+ pfx pfw 5) + (setq newleft (+ pfx pfw 10) newtop pfy)) ((eq location 'left) (setq newleft (- pfx 10 nfw) @@ -471,7 +472,7 @@ ;; extra 10 is just dressings for window ;; decorations. (let* ((left-guess (- pfx 10 nfw)) - (right-guess (+ pfx pfw 5)) + (right-guess (+ pfx pfw 10)) (left-margin left-guess) (right-margin (- (x-display-pixel-width) right-guess 5 nfw))) === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-14 20:32:35 +0000 +++ src/ChangeLog 2010-09-16 18:02:53 +0000 @@ -1,3 +1,8 @@ +2010-09-16 Stephen Berman + + * frame.c (Ftool_bar_pixel_width): New function to expose tool + bar's pixel width to Lisp. + 2010-09-14 Juanma Barranquero * cmds.c (syms_of_cmds) : Fix typos in docstring. === modified file 'src/frame.c' --- src/frame.c 2010-08-08 21:03:45 +0000 +++ src/frame.c 2010-09-16 12:22:21 +0000 @@ -2649,6 +2649,29 @@ #endif return make_number (FRAME_COLS (f)); } + +DEFUN ("tool-bar-pixel-width", Ftool_bar_pixel_width, + Stool_bar_pixel_width, 0, 1, 0, + doc: /* Return width in pixels of FRAME's tool bar. +The result is greater than zero only when the tool bar is on the left +or right side of FRAME. If FRAME is omitted, the selected frame is +used. */) + (Lisp_Object frame) +{ + struct frame *f; + + if (NILP (frame)) + frame = selected_frame; + CHECK_FRAME (frame); + f = XFRAME (frame); + +#ifdef HAVE_WINDOW_SYSTEM + if (FRAME_WINDOW_P (f)) + return make_number (FRAME_TOOLBAR_WIDTH (f)); + else +#endif + return 0; +} DEFUN ("set-frame-height", Fset_frame_height, Sset_frame_height, 2, 3, 0, doc: /* Specify that the frame FRAME has LINES lines. @@ -4596,6 +4619,7 @@ defsubr (&Sframe_char_width); defsubr (&Sframe_pixel_height); defsubr (&Sframe_pixel_width); + defsubr (&Stool_bar_pixel_width); defsubr (&Sset_frame_height); defsubr (&Sset_frame_width); defsubr (&Sset_frame_size); --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 17 05:05:21 2010 Received: (at 7048-done) by debbugs.gnu.org; 17 Sep 2010 09:05:21 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OwWsi-0007RC-Ec for submit@debbugs.gnu.org; Fri, 17 Sep 2010 05:05:20 -0400 Received: from smtprelay-b11.telenor.se ([62.127.194.20]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OwWsg-0007R7-8i for 7048-done@debbugs.gnu.org; Fri, 17 Sep 2010 05:05:19 -0400 Received: from ipb2.telenor.se (ipb2.telenor.se [195.54.127.165]) by smtprelay-b11.telenor.se (Postfix) with ESMTP id 17D37E9401 for <7048-done@debbugs.gnu.org>; Fri, 17 Sep 2010 11:07:38 +0200 (CEST) X-SENDER-IP: [85.225.45.35] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkA0AArNkkxV4S0jPGdsb2JhbACHbZolDAEBAQE1LcFUgwMIgjYEjS0 X-IronPort-AV: E=Sophos;i="4.56,381,1280700000"; d="scan'208";a="130675451" Received: from c-232de155.25-1-64736c10.cust.bredbandsbolaget.se (HELO coolsville.localdomain) ([85.225.45.35]) by ipb2.telenor.se with ESMTP; 17 Sep 2010 11:07:38 +0200 Received: from [172.20.199.13] (zeplin [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id 04C277FA05A; Fri, 17 Sep 2010 11:07:38 +0200 (CEST) Message-ID: <4C932FD9.8020009@swipnet.se> Date: Fri, 17 Sep 2010 11:07:37 +0200 From: =?ISO-8859-1?Q?Jan_Dj=E4rv?= User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; sv-SE; rv:1.9.2.9) Gecko/20100825 Thunderbird/3.1.3 MIME-Version: 1.0 To: Stephen Berman Subject: Re: bug#7048: 24.0.50; frame position calculation with vertical tool bar (Gtk+) References: <87hbhpqx13.fsf@escher.home> In-Reply-To: <87hbhpqx13.fsf@escher.home> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.4 (--) X-Debbugs-Envelope-To: 7048-done Cc: 7048-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.4 (--) Checked in with one change: #ifdef HAVE_WINDOW_SYSTEM replaced with #ifdef FRAME_TOOLBAR_WIDTH as not all window systems define FRAME_TOOLBAR_WIDTH. Jan D. Stephen Berman skrev 2010-09-16 22.00: > 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 24.0.50.7 (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' '--without-toolkit-scroll-bars'' > From unknown Fri Jun 20 07:26:14 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 15 Oct 2010 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator