Mailing List Archive

GTK Negative Widget Height
Hello,

I've been experiencing a problem with various programs for some time.
These programs use the GTK+ toolkit and when a particular menu is selected
from the main menu bar at the top a sub-menu of either very small height or
of no height (i.e. a thin line) will appear. Needless to say, the program
cannot be operated with such menus.

Usually, a program restart will fix the issue and restore normal menus
but sometimes several restarts are necessary. The error message that
is associated with these botched sub-menus is the following:

Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with
width 226 and height -118.

Somehow, the menu is being invoked with a _negative_ value for height, which
of course makes no sense. The resulting menu widget appears as a thin (one pixel)
horizontal line.

Through searches I've found nothing similar reported

Because this can happen with more than one program, I doubt if it is
the fault with any single package. GTK+ must be causing this.

Has anyone experienced similar behavior?

As I mentioned, a program restart usually fixes the problem. However, when
and if this problem will occur is not predictable. It happens only occasionally
and never consistently.

Frank Peters
Re: GTK Negative Widget Height [ In reply to ]
On Tue, 18 Aug 2015 23:40:32 -0400
Frank Peters <frank.peters@comcast.net> wrote:

>
> As I mentioned, a program restart usually fixes the problem. However, when
> and if this problem will occur is not predictable. It happens only occasionally
> and never consistently.
>

I've discovered something else that seems very significant.

The behavior depends on the relation of the position of the
window in which the problem occurs in relation to other windows.
If I shift the widow around I can get different appearances
of the sub-menus from complete to very thin to a one pixel
line. Thus, the fault would seem to be with how GTK+ calculates
the window dimensions in relation to other windows. In some
cases a miscalculation will result in a negative height.

The fault could also be with the window manager which, AFAIK,
reports window positions. But then I only understand little
about the mechanisms of the X Window GUI and how window managers
and took kits interact with it.

Anyway, if the problem occurs, I just need to shift the window
to another position and that should take care of the sub-menus.

Frank Peters