From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Vivek Dasmohapatra Newsgroups: gmane.emacs.bugs Subject: bug#22000: Patch addressing the menu-bar frame-resize interaction Date: Fri, 12 Oct 2018 19:25:21 +0100 (BST) Message-ID: References: <87k2p8h1vn.fsf@isaac.fritz.box> <5B4EE5AF.5000304@gmx.at> <5B504994.3090202@gmx.at> <5B5199F7.7000303@gmx.at> <5B51D6C4.9030006@gmx.at> <5B52E425.8010608@gmx.at> <5B543148.1010004@gmx.at> <5B557ACA.4020106@gmx.at> <5BBF93CF.4060301@gmx.at> <5BC05EEB.9010609@gmx.at> <5BC0E405.90805@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Trace: blaine.gmane.org 1539368650 12781 195.159.176.226 (12 Oct 2018 18:24:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 12 Oct 2018 18:24:10 +0000 (UTC) User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) Cc: 22000@debbugs.gnu.org, David Engster To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 12 20:24:05 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gB26W-0003CV-S0 for geb-bug-gnu-emacs@m.gmane.org; Fri, 12 Oct 2018 20:24:05 +0200 Original-Received: from localhost ([::1]:42165 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gB28d-0006cr-D2 for geb-bug-gnu-emacs@m.gmane.org; Fri, 12 Oct 2018 14:26:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gB28V-0006c5-Cg for bug-gnu-emacs@gnu.org; Fri, 12 Oct 2018 14:26:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gB28S-0007Mq-3v for bug-gnu-emacs@gnu.org; Fri, 12 Oct 2018 14:26:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43205) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gB28P-0007Lw-TF for bug-gnu-emacs@gnu.org; Fri, 12 Oct 2018 14:26:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gB28P-0003jf-MF for bug-gnu-emacs@gnu.org; Fri, 12 Oct 2018 14:26:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Vivek Dasmohapatra Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 12 Oct 2018 18:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22000 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22000-submit@debbugs.gnu.org id=B22000.153936872514315 (code B ref 22000); Fri, 12 Oct 2018 18:26:01 +0000 Original-Received: (at 22000) by debbugs.gnu.org; 12 Oct 2018 18:25:25 +0000 Original-Received: from localhost ([127.0.0.1]:47463 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gB27p-0003ip-2e for submit@debbugs.gnu.org; Fri, 12 Oct 2018 14:25:25 -0400 Original-Received: from ceres.etla.org ([85.119.82.193]:43607) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gB27n-0003ih-Gy for 22000@debbugs.gnu.org; Fri, 12 Oct 2018 14:25:23 -0400 Original-Received: from yaffle.pepperfish.net ([88.99.213.221] helo=[10.112.101.20]) by ceres.etla.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gB27m-0003tA-Bt; Fri, 12 Oct 2018 19:25:22 +0100 X-X-Sender: vivek@platypus.pepperfish.net In-Reply-To: <5BC0E405.90805@gmx.at> X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-Spam_report: Spam detection software, running on the system "ceres.etla.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: >> I might be able to fix it with a style change, if I can defeat the gtk3 > docs >> and figure out if/how to set a style property on a widget. > > Let's postpone that for the moment. It's done, see latest patchset. [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 AWL AWL: Adjuste X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:151184 Archived-At: >> I might be able to fix it with a style change, if I can defeat the gtk3 > docs >> and figure out if/how to set a style property on a widget. > > Let's postpone that for the moment. It's done, see latest patchset. > Anyway, the primary warning I see is the following: > > (emacs:4182): Gtk-WARNING **: gtk_scrolled_window_add(): cannot add non > scrollable widget use gtk_scrolled_window_add_with_viewport() instead Aha! I think I know what's happening. You used to have to add the viewport manually for widgets that weren't inherently scrollable. I'll add some #if guarded code for the earlier GTK versions. > #if GTK_CHECK_VERSION (3, 16, 0) > GtkPolicyType menuscroll_policy = GTK_POLICY_EXTERNAL; > #else > GtkPolicyType menuscroll_policy = GTK_POLICY_NEVER; > #endif > ... > menuscroll = get_frame_param (f, Qmenu_bar_scrollbar); > if (EQ (menuscroll, Qautomatic)) > menuscroll_policy = GTK_POLICY_AUTOMATIC; > else if (EQ (menuscroll, Qalways)) > menuscroll_policy = GTK_POLICY_ALWAYS; > > Doesn't this mean that when a frame has the 'menu-bar-scrollbar' > parameter set we effectively override the version check above? Nope - EXTERNAL is the new policy which actually does what we want: truncated menu bar. That is the default behaviour, except on earlier GTK versions where we get the current frame-jitter behaviour by default. We only override if the frame paramter is set to 'always or 'automatic, neither of which is the default. > so we always put this into a _scrolled_ window regardless of whether > GTK can handle that. That's the crucial problem here. The problem is that earlier GTK versions need a viewport added explicitly between the scrollbar and the menubar - that's easy enough to do now that I know that's what's needed. > In short: (1) would allow users to specify whether they want a > scrollable menu bar window. (2) would allow them to specify whether > that window should be really scrollable. And we should make the menu > bar scrollable and thus provide (1) iff GTK supports it (so GTK 3.8 is > probably the minimum version where we can do that). And for GTK < 3.8 > nothing would change at all to what we have now. I think we can achieve all of the above with a couple of lines to add the intermediate viewport for GTK versions that require it. Otherwise we already have the default behaviour you described (I think).