GNU bug report logs - #22000
25.0.50; Running dired changes frame width, gtk_distribute_natural_allocation throws assertion

Previous Next

Package: emacs;

Reported by: David Engster <deng <at> randomsample.de>

Date: Mon, 23 Nov 2015 20:56:02 UTC

Severity: normal

Merged with 15700, 18270, 22898, 25313, 31626

Found in versions 24.3, 24.5, 25.0.50

Full log


Message #129 received at 22000 <at> debbugs.gnu.org (full text, mbox):

From: Vivek Dasmohapatra <vivek <at> etla.org>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 22000 <at> debbugs.gnu.org, David Engster <deng <at> randomsample.de>
Subject: Re: bug#22000: Patch addressing the menu-bar frame-resize interaction
Date: Fri, 12 Oct 2018 19:25:21 +0100 (BST)
>> 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).





This bug report was last modified 5 years and 266 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.