From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?B?SmFuIERqw6Rydg==?= Newsgroups: gmane.emacs.devel Subject: Re: GTK+/KDE frame shrinking has to do with tool bar (was Re: describe-{function, variable} shrinks frame (GTK+/KDE)) Date: Tue, 20 Nov 2007 08:33:21 +0100 Message-ID: <47428DC1.80402@swipnet.se> References: <876401dbee.fsf@escher.local.home> <473EB161.2020003@gmx.at> <87abpc782k.fsf@escher.local.home> <474006EC.1040308@gmx.at> <87mytb4afn.fsf@escher.local.home> <4740BAE7.7040107@gmx.at> <87ejemz6i0.fsf@escher.local.home> <877ikdzvxz.fsf_-_@escher.local.home> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1195544087 27565 80.91.229.12 (20 Nov 2007 07:34:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 20 Nov 2007 07:34:47 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stephen Berman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 20 08:34:49 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IuNd9-0002j3-Cl for ged-emacs-devel@m.gmane.org; Tue, 20 Nov 2007 08:34:47 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IuNcv-0007m0-By for ged-emacs-devel@m.gmane.org; Tue, 20 Nov 2007 02:34:33 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IuNcq-0007lm-QJ for emacs-devel@gnu.org; Tue, 20 Nov 2007 02:34:28 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IuNcm-0007lM-Qe for emacs-devel@gnu.org; Tue, 20 Nov 2007 02:34:28 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IuNcm-0007lJ-Ft for emacs-devel@gnu.org; Tue, 20 Nov 2007 02:34:24 -0500 Original-Received: from mx20.gnu.org ([199.232.41.8]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IuNcl-0000rt-SV for emacs-devel@gnu.org; Tue, 20 Nov 2007 02:34:24 -0500 Original-Received: from av11-1-sn2.hy.skanova.net ([81.228.8.183]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IuNck-0002sV-Ag for emacs-devel@gnu.org; Tue, 20 Nov 2007 02:34:22 -0500 Original-Received: by av11-1-sn2.hy.skanova.net (Postfix, from userid 502) id 70B7838402; Tue, 20 Nov 2007 08:34:11 +0100 (CET) Original-Received: from smtp4-2-sn2.hy.skanova.net (smtp4-2-sn2.hy.skanova.net [81.228.8.93]) by av11-1-sn2.hy.skanova.net (Postfix) with ESMTP id 5742937F09; Tue, 20 Nov 2007 08:34:11 +0100 (CET) Original-Received: from husetbladh.homeip.net (90-231-102-24-no59.tbcn.telia.com [90.231.102.24]) by smtp4-2-sn2.hy.skanova.net (Postfix) with ESMTP id 403EA37E43; Tue, 20 Nov 2007 08:34:11 +0100 (CET) User-Agent: Thunderbird 2.0.0.9 (X11/20071031) In-Reply-To: <877ikdzvxz.fsf_-_@escher.local.home> X-detected-kernel: by mx20.gnu.org: Linux 2.4-2.6 X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:83702 Archived-At: Thanks for the explanation and the test case. It may very well be that those 2 missing pixels causes some rounding erro= r and=20 that the frame shrinks. As the code is now, we just accept the size the = tool=20 bar sets itself internally. We could try something else, i.e. a fixed si= ze or=20 perhaps never shrink, just grow. With themed icons, you never know how l= arge=20 or small they are going to be. But I suspect there is a bug in the resize logic here, only the tool bar=20 should expand/shrink, not the number of lines. I'm going to debug it, bu= t it=20 may take a few days, I am not at home right now. BTW, what KDE and gtk-qt engine version do you have? Is there any specia= l=20 theme to use to get this effect? Jan D. Stephen Berman skrev: > On Mon, 19 Nov 2007 14:53:27 +0100 Stephen Berman > wrote:=20 >=20 >> So far, the more I've tested, the muddier the water has become, and I >> think I've failed to achieve real insight into what's going on. >=20 > I think I've hit upon a bit of insight. I think the reduction in > frame-height is conditioned by (or at least related to) the presence of > a tool bar containing at least one icon that does not belong to the > theme currently used by the gtk-qt engine. Both the Info and w3m tool > bar are cases in point. In addition, when I start Emacs with -Q -D, > i.e. without a tool bar, then I do not get the frame-height reduction > with the functions I defined (which do induce the frame-height reductio= n > with -Q, where there is a tool bar). I've also come up with a test cas= e > that involves neither Info, w3m, nor describe-*. I start emacs -Q and > evaluate the following: >=20 > (defvar srb-tool-bar-map > (let ((tool-bar-map (make-sparse-keymap))) > (tool-bar-add-item "prev-node" 'ignore 'ignore :help "Do nothing") > tool-bar-map)) >=20 > (defun srb-mode () > (interactive) > (kill-all-local-variables) > (setq major-mode 'srb-mode) > (setq mode-name "srb") > (set (make-local-variable 'tool-bar-map) srb-tool-bar-map)) >=20 > (defun srb-shrink-test () > (interactive) > (message "frame height: %d" (frame-height)) > (with-current-buffer (get-buffer-create "*srb-shrink-test 1*") > (srb-mode)) > (pop-to-buffer "*srb-shrink-test 2*") > (sit-for 0.5) > (delete-window) > (switch-to-buffer "*srb-shrink-test 1*") > (sit-for 0.5) > (message "frame height: %d" (frame-height))) >=20 > When I invoke srb-shrink-test after emacs -Q, the first message is > "frame height: 40", the second is "frame height: 39". Stepping through > with edebug, I see the reduction occur after the second sit-for. If I > delete any line in srb-shrink-test or change the order, there is no > frame-height reduction. >=20 > If I am correct in implicating non-theme icons, then I would expect the > turning point for getting the frame-height reduction to be this change: >=20 > 2007-09-02 Jan Dj=C3=A4rv >=20 > * term/x-win.el (x-gtk-stock-map): Map diropen to system-file-manager. > (icon-map-list): New variable. > (x-gtk-map-stock): Use icon-map-list. >=20 > Prior to this, diropen was mapped to a non-theme icon. And indeed, > srb-shrink-test does not reduce frame-height on a GTK+ build from > 2007-08-29 (immediately post-multi-tty-merge), nor does my test > involving Info, posted previously in this thread. Strangely, however, > my test involving w3m does show frame-height reduction. I don't know i= f > this means I'm wrong to suspect non-theme icons or if the w3m tool bar > has other properties that cause the frame-height reduction (it contains > no icons from the current gtk-qt theme). In any case, as I mentioned > earlier in this thread, on a pre-multi-tty build from 2007-08-24, I do > not get any frame-height reduction, whether with srb-shrink-test, with > the test involving Info, or even with the test involving w3m. (Jan > D. added support for themed icons on 2007-08-28, one day before the > multi-tty merge, but as noted, that did not include a themed icon for > diropen.) >=20 > Regardless of whether, or how much, the frame-height reduction is due t= o > non-theme icons, there is another related frame-height problem that I'v= e > seen only under the gtk-qt engine on KDE. Namely, tool bars that > contain non-theme icons, including the Info, w3m, and Gnus tool bars, > are slightly taller (by one or two pixels) than tool bars containing > only themed icons (e.g. those in Text and Fundamental mode). As a > consequence, whenever I switch between buffers with differently high > tool bars, the entire frame changes in height by that much. This is > particularly disconcerting when I use the minibuffer (Fundamental mode) > or have split windows. >=20 > I presume that none of the core Emacs developers uses the gtk-qt engine > (do any of you regularly use KDE?) and can therefore understand that > Emacs problems involving it are not a high priority, but if anyone has > any suggestions I would be grateful. (Unfortunately, I know nothing > about either the gtk-qt or the Gtk+ source code. But the problems I > mentioned here, as well as in earlier posts about frame maximization, I > have seen only with Emacs but with no other Gtk+ apps in KDE, which > presumably also use the gtk-qt engine.) >=20 > Steve Berman=20 >=20 >=20 >=20 > _______________________________________________ > Emacs-devel mailing list > Emacs-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-devel