After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 780101 - Menus do not display over remote X11
Menus do not display over remote X11
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
3.22.x
Other Linux
: Normal critical
: ---
Assigned To: gtk-bugs
gtk-bugs
: 770838 788647 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2017-03-15 17:19 UTC by Larkin Lowrey
Modified: 2018-03-09 23:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Output from xdpyinfo (44.45 KB, text/plain)
2017-03-15 17:19 UTC, Larkin Lowrey
  Details
virt-manager gdb stack trace (3.58 KB, text/plain)
2017-03-15 17:36 UTC, Larkin Lowrey
  Details
This is the patch linked to by Brad Laue (2.89 KB, patch)
2017-06-24 16:45 UTC, Bruce Link
none Details | Review
xdpyinfo from Ubuntu 17.04 client talking to Cygwin/X server on Windows 10 (43.53 KB, text/plain)
2017-06-25 03:08 UTC, Matthew Swabey
  Details
Outputs of gtk3-widget-factory.exe (v3.22.16) when opening menus (5.15 KB, text/plain)
2017-09-16 09:30 UTC, Tim Düllmann
  Details

Description Larkin Lowrey 2017-03-15 17:19:02 UTC
Created attachment 348018 [details]
Output from xdpyinfo

When connecting remotely (either SSH X11 forwarding or direct to X11 server), drop down menus do not display properly. They render as a single pixel at 0,0.

Client: Fedora 25 - gtk3-3.22.9-2.fc25.x86_64
Server: Windows 10 Cygwin/X 1.19.2-1 (2017-03-09)

Programs exhibiting this problem:
gtk3-demo 3.22.9
virt-manager 1.4.0

Menus displayed properly prior to upgrade from Fedora 24 to 25.

Error messages printed to console:

*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug

*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug


(virt-manager:1377): Gtk-WARNING **: Negative content width -7 (allocation 1, extents 4x4) while allocating gadget (node arrow, owner GtkMenu)

(virt-manager:1377): Gtk-WARNING **: Negative content width -7 (allocation 1, extents 4x4) while allocating gadget (node arrow, owner GtkMenu)
Comment 1 Larkin Lowrey 2017-03-15 17:36:44 UTC
Created attachment 348020 [details]
virt-manager gdb stack trace
Comment 2 Nicolas Goy 2017-03-28 03:15:32 UTC
I can confirm I have the same bug using gtk3-3.22.10.

I downgraded to gtk3-3.20.9 which fixed the issue for now.

Basically all gtk3 programs behave in a weird way. Drop down menu are off screen, new windows are super small and other geometry related bogus behaviour.

I am also using Cygwin X11 as X server. (version 1.19.2-1 built 2017-03-09)
Comment 3 Brad Laue 2017-05-14 17:57:56 UTC
Cygwin's own package for GTK3 contains a RANDR patch which reverses commit f2ba6ca47322a17b37fb92662fc9552b4f106f10 in the gtk3 sources. 

The referenced commit appears to make a lot of assumptions about what a non RandR 1.2 driver can't do. I think only the last part of f2ba6ca47322a17b37fb92662fc9552b4f106f10 is really necessary...

Tested the patch against gtk3 3.22.12-2.fc25 SRPM - once GTK3 is rebuilt with this patch, menus once again work as expected with X11 forwarding.
Comment 4 Brad Laue 2017-05-14 17:58:36 UTC
Forgot to include a link to the patch in question:

https://github.com/cygwinports/gtk3/blob/master/3.22.10-xrandr12-compat.patch
Comment 5 Bruce Link 2017-06-24 16:45:43 UTC
Created attachment 354396 [details] [review]
This is the patch linked to by Brad Laue

I'm attaching the patch that was pointed out by Brad in the hopes that this will raise a "patch submitted" flag somewhere to get this patch applied. I suspect that the hyperlink supplied by Brad may not have done this.

Again, this patch is not my work, I'm merely attaching it to the ticket. Tip of the hat to all of the others who've hunted down this and found a fix for this bug. Apologies in advance if I've acted contrary to convention by attaching this patch.
Comment 6 Matthew Swabey 2017-06-25 03:08:26 UTC
Created attachment 354410 [details]
xdpyinfo from Ubuntu 17.04 client talking to Cygwin/X server on Windows 10

Seems identical to original poster.

When connecting remotely (either SSH X11 forwarding or direct to X11 server), drop down menus do not display properly. 

Client: Ubuntu 17.04 - gtk3-3.22.11-0ubuntu3
Server: Windows 10 Cygwin/X 1.19.2-1

Programs exhibiting this problem:
evince 3.24.0

Console errors:

(evince:7390): GLib-GIO-CRITICAL **: g_dbus_proxy_get_name_owner: assertion 'G_IS_DBUS_PROXY (proxy)' failed

(evince:7390): GLib-WARNING **: GError set over the top of a previous GError or uninitialized memory.
This indicates a bug in someone's code. You must ensure an error is NULL before it's set.
The overwriting error message was: The name org.freedesktop.portal.Desktop is not owned

(evince:7390): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed

(evince:7390): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed

(evince:7390): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed

(evince:7390): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed

(evince:7390): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed

(evince:7390): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed

(evince:7390): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed

(evince:7390): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed

(evince:7390): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed

(evince:7390): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed

(evince:7390): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed

(evince:7390): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed

(evince:7390): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed

(evince:7390): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed

(evince:7390): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed
*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug

*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug


(evince:7390): Gtk-WARNING **: Negative content width -7 (allocation 1, extents 4x4) while allocating gadget (node arrow, owner GtkMenu)

(evince:7390): Gtk-WARNING **: Negative content width -7 (allocation 1, extents 4x4) while allocating gadget (node arrow, owner GtkMenu)
*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug


(evince:7390): Gtk-WARNING **: Negative content width -11 (allocation 1, extents 6x6) while allocating gadget (node menuitem, owner GtkModelMenuItem)

(evince:7390): Gtk-WARNING **: Negative content width -11 (allocation 1, extents 6x6) while allocating gadget (node menuitem, owner GtkModelMenuItem)

(evince:7390): Gtk-WARNING **: Negative content width -11 (allocation 1, extents 6x6) while allocating gadget (node menuitem, owner GtkModelMenuItem)
Comment 7 Tim Düllmann 2017-09-16 09:27:47 UTC
There seems to be the same problem using GTK+ for Windows with Remote Desktop:

I experienced the same error (no menus show up) using HomeBank and GTK-Widget-Factory on Windows 10 via Remote Desktop. Using native desktop, everything is fine.

Original source: https://bugs.launchpad.net/homebank/+bug/1717444?comments=all

Tested negatively with GTK v3.22.16 for Windows (HomeBank 5.1.6). The last known working version I know is GTK v3.16.6 (Homebank 5.1.4, all fine).

The output I got from GTK-Widget-Factory is attached and seems to be related to the outputs Mathew posted.
Comment 8 Tim Düllmann 2017-09-16 09:30:02 UTC
Created attachment 359885 [details]
Outputs of gtk3-widget-factory.exe (v3.22.16) when opening menus

Windows 10
Remote Desktop
v3.22.16
Using menus with gtk3-widget-factory.exe from HomeBank 5.1.6
Comment 9 Harry Coin 2017-09-29 18:08:23 UTC
Menu dropdown list appears as only a thin line 'bug appears in 'virt-manager' and 'virt-viewer' libvirt control applications only when forwarded over ssh.  Latest / Centos el7_4. Server "XMing" 64 bit latest ver ...22

Installed Packages
Name        : gtk3
Arch        : x86_64
Version     : 3.22.10
Release     : 4.el7

[Fri, 29 Sep 2017 11:38:23 virt-manager 19722] DEBUG (engine:140) Initial gtkapp                                                                                                                               lication activated

(virt-manager:19722): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed
*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug

*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug


(virt-manager:19722): Gtk-WARNING **: Negative content width -7 (allocation 1, extents 4x4) while allocating gadget (node arrow, owner GtkMenu)

(virt-manager:19722): Gtk-WARNING **: Negative content width -7 (allocation 1, extents 4x4) while allocating gadget (node arrow, owner GtkMenu)
*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug


(virt-manager:19722): Gtk-WARNING **: Negative content width -11 (allocation 1, extents 6x6) while allocating gadget (node menuitem, owner GtkImageMenuItem)

(virt-manager:19722): Gtk-WARNING **: Negative content height -7 (allocation 1, extents 4x4) while allocating gadget (node menuitem, owner GtkImageMenuItem)
 gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed^C
Comment 10 Harry Coin 2017-10-05 05:20:25 UTC
Duplicate the bug simply using gtk3-demo.  Choose 'menus' 'run' then click any menu item.  Here's a debug-enabled stdout result:

<no output until demo menu item checked>

[administrator@ceo1homenx x86_64]$ gtk3-demo

gdb output:
Breakpoint 1, gtk_widget_size_allocate_with_baseline (widget=widget@entry=0x10eca80 [GtkWindow], allocation=allocation@entry=0x7ffcc2728c30, baseline=baseline@entry=-1)
    at gtkwidget.c:6050
6050	    g_warning ("gtk_widget_size_allocate(): attempt to underallocate %s%s %s %p. "
(gdb) bt
  • #0 gtk_widget_size_allocate_with_baseline
    at gtkwidget.c line 6050
  • #1 gtk_widget_size_allocate
    at gtkwidget.c line 6196
  • #2 gtk_window_move_resize
    at gtkwindow.c line 9746
  • #3 gtk_window_check_resize
    at gtkwindow.c line 8328
  • #4 _g_closure_invoke_va
    at gclosure.c line 867
  • #5 g_signal_emit_valist
    at gsignal.c line 3300
  • #6 g_signal_emit
    at gsignal.c line 3447
  • #7 gtk_container_check_resize
    at gtkcontainer.c line 2171
  • #8 gtk_container_idle_sizer
    at gtkcontainer.c line 2064
  • #12 <emit signal ??? on instance 0xe065e0 [GdkFrameClockIdle]>
    at gsignal.c line 3447
  • #13 _gdk_frame_clock_emit_layout
    at gdkframeclock.c line 634
  • #14 gdk_frame_clock_paint_idle
    at gdkframeclockidle.c line 408
  • #15 gdk_threads_dispatch
    at gdk.c line 743
  • #16 g_timeout_dispatch
    at gmain.c line 4672
  • #17 g_main_context_dispatch
    at gmain.c line 3201
  • #18 g_main_context_dispatch
    at gmain.c line 3854
  • #19 g_main_context_iterate
    at gmain.c line 3927

(gdb) print *allocation
$1 = {x = 0, y = 0, width = 1, height = 1}


(gdb) info locals
priv = 0x10ec990
real_allocation = {x = 0, y = 0, width = 1, height = 1}
old_clip = {x = 0, y = 0, width = 150, height = 66}
adjusted_allocation = {x = 0, y = 0, width = 1, height = 1}
alloc_needed = 1
size_changed = <optimized out>
baseline_changed = <optimized out>
position_changed = <optimized out>
natural_width = 150
natural_height = 124
dummy = 0
min_width = 150
min_height = 66
old_baseline = -1
__FUNCTION__ = "gtk_widget_size_allocate_with_baseline"

stdout resumes:

(gtk3-demo:7869): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to underallocate toplevel GtkWindow 0x2692a80. Allocation is 1x1, but minimum required size is 150x66.

(gtk3-demo:7869): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to underallocate GtkWindow's child GtkMenu 0x25e8b40. Allocation is 1x1, but minimum required size is 150x66.

(gtk3-demo:7869): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed

(gtk3-demo:7869): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed

(gtk3-demo:7869): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed

(gtk3-demo:7869): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed

(gtk3-demo:7869): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed
*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug

*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug


(gtk3-demo:7869): Gtk-WARNING **: Negative content width -7 (allocation 1, extents 4x4) while allocating gadget (node arrow, owner GtkMenu)

(gtk3-demo:7869): Gtk-WARNING **: Negative content width -7 (allocation 1, extents 4x4) while allocating gadget (node arrow, owner GtkMenu)
*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug


(gtk3-demo:7869): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to underallocate GtkMenu's child GtkRadioMenuItem 0x25f2380. Allocation is 1x23, but minimum required size is 104x24.

(gtk3-demo:7869): Gtk-WARNING **: Negative content width -11 (allocation 1, extents 6x6) while allocating gadget (node menuitem, owner GtkRadioMenuItem)

(gtk3-demo:7869): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to underallocate GtkRadioMenuItem's child GtkAccelLabel 0x26ad590. Allocation is 1x15, but minimum required size is 66x15.

(gtk3-demo:7869): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to underallocate GtkMenu's child GtkRadioMenuItem 0x25f2ec0. Allocation is 1x23, but minimum required size is 104x24.

(gtk3-demo:7869): Gtk-WARNING **: Negative content width -11 (allocation 1, extents 6x6) while allocating gadget (node menuitem, owner GtkRadioMenuItem)

(gtk3-demo:7869): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to underallocate GtkRadioMenuItem's child GtkAccelLabel 0x28041e0. Allocation is 1x15, but minimum required size is 66x15.

(gtk3-demo:7869): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to underallocate GtkMenu's child GtkRadioMenuItem 0x2805af0. Allocation is 1x23, but minimum required size is 104x24.

(gtk3-demo:7869): Gtk-WARNING **: Negative content width -11 (allocation 1, extents 6x6) while allocating gadget (node menuitem, owner GtkRadioMenuItem)

(gtk3-demo:7869): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to underallocate GtkRadioMenuItem's child GtkAccelLabel 0x2804d80. Allocation is 1x15, but minimum required size is 66x15.

(gtk3-demo:7869): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to underallocate GtkMenu's child GtkRadioMenuItem 0x28107a0. Allocation is 1x23, but minimum required size is 104x24.

(gtk3-demo:7869): Gtk-WARNING **: Negative content width -11 (allocation 1, extents 6x6) while allocating gadget (node menuitem, owner GtkRadioMenuItem)

(gtk3-demo:7869): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to underallocate GtkRadioMenuItem's child GtkAccelLabel 0x280f970. Allocation is 1x15, but minimum required size is 66x15.

(gtk3-demo:7869): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to underallocate GtkMenu's child GtkRadioMenuItem 0x28143a0. Allocation is 1x23, but minimum required size is 104x24.

(gtk3-demo:7869): Gtk-WARNING **: Negative content width -11 (allocation 1, extents 6x6) while allocating gadget (node menuitem, owner GtkRadioMenuItem)

(gtk3-demo:7869): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to underallocate GtkRadioMenuItem's child GtkAccelLabel 0x28125c0. Allocation is 1x15, but minimum required size is 66x15.

<that's it.  The above is the result of a single click on the menu "test line2"
Appearing on the screen is a blue underline beneath "line2" and "test line2" turns blue. No menu entries are displayed.  HTH>
Comment 11 Harry Coin 2017-10-05 05:22:40 UTC
The above is 3.22.21
Comment 12 Harry Coin 2017-10-05 14:49:16 UTC
Notice this bug affects many times the number of folks mentioned here so far. 

Downstream identical bug reports:
Arch Linux:
https://github.com/vim/vim/issues/1187
gvim menu items do not work on remote x11... " Reverting gtk3 to 3.20.9 fixed for now"


Cgywin/X
https://cygwin.com/ml/cygwin/2016-11/msg00354.html
remote GTK apps nor workin correctly in Cygwin/X


Redhat:
https://bugzilla.redhat.com/show_bug.cgi?id=1496157
Bug 1496157 - Menus do not display over remote X11 

Ubuntu:
https://bugs.launchpad.net/ubuntu/+source/gtk+3.0/+bug/1700319
GTK3 menus don't work over SSH forwarding

Centos:  Recent 7_4 release using 3.22.10 broke all x11 menus via forwarding, prior release used 3.16 which worked.  Bug still exists in 3.22.21

Freebsd likely related re: pixbuf icon
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219143

Debian Quidlibet:
https://github.com/quodlibet/quodlibet/issues/2024
Menus broken with X11 forwarding

Potential culprit:
https://bugzilla.gnome.org/show_bug.cgi?id=756618
Bug 756618 - GtkWindow CSD: gtk_window_resize() also includes client side decorations size 
arising from rhel https://bugzilla.redhat.com/show_bug.cgi?id=1269437

Really interesting debian report:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=838793
libgtk-3-0: Menus are too small in GNOME on Wayland
"Since upgrading to 3.22 (I think I was using 3.21 before) many, but not
all, GTK3 applications have broken menus in Wayland. They open very
small with only enough vertical room for scroll arrows and one item, or
less, and far narrower than necessary. Positioning is also incorrect,
and there seems to be some corruption of the content too."
Comment 13 Daniel Boles 2017-10-09 11:18:49 UTC
*** Bug 788647 has been marked as a duplicate of this bug. ***
Comment 14 Daniel Boles 2017-10-09 11:19:06 UTC
*** Bug 770838 has been marked as a duplicate of this bug. ***
Comment 15 Matthias Clasen 2017-10-09 11:23:44 UTC
According to information in the duplicate, the underlying issue here is that we end up with a monitor configuration that has size 0x0, which leads to the symptoms described above.
Comment 16 Harry Coin 2017-10-25 03:44:28 UTC
Massive regression from 3.16. Still broken in Ubuntu Artful / gtk3 3.22.24-0ubuntu1.  
gtk3-demo / Menu and Eclipse IDE Oxygen unusable (it opens in a window about 4 pixels across by 30 down.  Eclipse works with gtk2.)

The last comment above seems to have halted any progress fixing this whatever.  Note this bug renders gtk3 and all apps that depend upon it unusable over x11 forwarding.  Why there is so little interest surprises me.

reproduce, every time: over x11 forwarding do:

GTK_DEBUG=interactive gtk3-demo
[ these two lines only appear if GL is enabled in the X server. There is no other diffence in the bug w or w/o GL] 
libGL error: No matching fbConfigs or visuals found 
libGL error: failed to load driver: swrast

< Inspector shows Monitor 0 size 0 x 0, Geometry 0x0 at 0,0 Choosing "Menus" "Run" generates no output.  Menu demo appears, choosing any menu item produces:  >

(gtk3-demo:14249): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed

(gtk3-demo:14249): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed

(gtk3-demo:14249): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed

(gtk3-demo:14249): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed

(gtk3-demo:14249): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed
*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug

*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug


(gtk3-demo:14249): Gtk-WARNING **: Negative content width -7 (allocation 1, extents 4x4) while allocating gadget (node arrow, owner GtkMenu)

(gtk3-demo:14249): Gtk-WARNING **: Negative content width -7 (allocation 1, extents 4x4) while allocating gadget (node arrow, owner GtkMenu)
*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug


(gtk3-demo:14249): Gtk-WARNING **: Negative content width -11 (allocation 1, extents 6x6) while allocating gadget (node menuitem, owner GtkRadioMenuItem)
*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug


(gtk3-demo:14249): Gtk-WARNING **: Negative content width -11 (allocation 1, extents 6x6) while allocating gadget (node menuitem, owner GtkRadioMenuItem)

(gtk3-demo:14249): Gtk-WARNING **: GtkAccelLabel 0x55c2d83cb1b0 attempted to adjust its size allocation from 29,1220346006 1x1220345994 to 29,1830518994 1x17. adjust_size_allocation must keep allocation inside original bounds

(gtk3-demo:14249): Gtk-WARNING **: Negative content width -11 (allocation 1, extents 6x6) while allocating gadget (node menuitem, owner GtkRadioMenuItem)

(gtk3-demo:14249): Gtk-WARNING **: Negative content width -11 (allocation 1, extents 6x6) while allocating gadget (node menuitem, owner GtkRadioMenuItem)

(gtk3-demo:14249): Gtk-WARNING **: Negative content width -11 (allocation 1, extents 6x6) while allocating gadget (node menuitem, owner GtkRadioMenuItem)
Comment 17 Harry Coin 2017-10-25 04:13:40 UTC
Interesting hint with geometry enabled.  Looks normal until complaints of widget resize during size_allocation

GTK_DEBUG=geometry gtk3-demo
Gtk-Message: gtk_widget_size_allocate:   GtkApplicationWindow 0 0 810 656, baseline -1
Gtk-Message: gtk_widget_size_allocate:     GtkHeaderBar 5 5 800 46, baseline -1
Gtk-Message: gtk_widget_size_allocate:       GtkButton 10 4 58 46, baseline -1
Gtk-Message: gtk_widget_size_allocate:         GtkLabel 27 15 24 24, baseline -1
Gtk-Message: gtk_widget_set_clip:              GtkLabel 27 15 24 24
Gtk-Message: gtk_widget_set_clip:            GtkButton 10 10 58 34
Gtk-Message: gtk_widget_size_allocate:       GtkBox 330 4 149 46, baseline -1
Gtk-Message: gtk_widget_size_allocate:         GtkLabel 330 18 149 17, baseline -1
...
Gtk-Message: gtk_widget_size_allocate:     GtkBox 5 51 800 600, baseline -1
Gtk-Message: gtk_widget_size_allocate:       GtkFrame 5 51 222 600, baseline -1
Gtk-Message: gtk_widget_size_allocate:         GtkScrolledWindow 6 52 220 598, baseline -1
Gtk-Message: gtk_widget_size_allocate:           GtkTreeView 0 0 220 598, baseline -1
Gtk-Message: gtk_widget_size_allocate:           GtkTreeView 0 0 220 598, baseline -1
Gtk-Message: gtk_widget_size_allocate:           GtkScrollbar 0 0 13 573, baseline -1
Gtk-Message: gtk_widget_set_clip:                GtkScrollbar 0 -1 14 574
Gtk-Message: gtk_widget_set_clip:              GtkScrolledWindow 6 52 220 598

(gtk3-demo:14547): Gtk-WARNING **: GtkScrolledWindow 0x557c98100560 or a child called gtk_widget_queue_resize() during size_allocate().
Gtk-Message: gtk_widget_set_clip:            GtkFrame 5 51 222 600

(gtk3-demo:14547): Gtk-WARNING **: GtkFrame 0x557c97ea11a0 or a child called gtk_widget_queue_resize() during size_allocate().
Gtk-Message: gtk_widget_size_allocate:       GtkNotebook 227 51 578 600, baseline -1
Gtk-Message: gtk_widget_size_allocate:         GtkLabel 247 54 44 30, baseline -1
Gtk-Message: gtk_widget_set_clip:              GtkLabel 247 54 44 30
...

<Choose "Menus", "Run" "test line2">
Gtk-Message: gtk_widget_size_allocate:   GtkWindow 0 0 151 29, baseline -1
Gtk-Message: gtk_widget_size_allocate:     GtkMenu 0 0 151 29, baseline -1
Gtk-Message: gtk_widget_size_allocate:       GtkRadioMenuItem 0 0 151 25, baseline -1
Gtk-Message: gtk_widget_size_allocate:         GtkAccelLabel 29 4 90 17, baseline -1
Gtk-Message: gtk_widget_set_clip:              GtkAccelLabel 29 4 90 17
Gtk-Message: gtk_widget_set_clip:            GtkRadioMenuItem 0 0 151 25
Gtk-Message: gtk_widget_set_clip:            GtkRadioMenuItem 0 0 151 25
Gtk-Message: gtk_widget_size_allocate:       GtkRadioMenuItem 0 25 151 25, baseline -1
Gtk-Message: gtk_widget_size_allocate:         GtkAccelLabel 29 29 90 17, baseline -1
Gtk-Message: gtk_widget_set_clip:              GtkAccelLabel 29 29 90 17
Gtk-Message: gtk_widget_set_clip:            GtkRadioMenuItem 0 0 151 50
Gtk-Message: gtk_widget_set_clip:            GtkRadioMenuItem 0 0 151 50
Gtk-Message: gtk_widget_size_allocate:       GtkRadioMenuItem 0 50 151 25, baseline -1
Gtk-Message: gtk_widget_size_allocate:         GtkAccelLabel 29 54 90 17, baseline -1
Gtk-Message: gtk_widget_set_clip:              GtkAccelLabel 29 54 90 17
Gtk-Message: gtk_widget_set_clip:            GtkRadioMenuItem 0 0 151 75
Gtk-Message: gtk_widget_set_clip:            GtkRadioMenuItem 0 0 151 75
Gtk-Message: gtk_widget_size_allocate:       GtkRadioMenuItem 0 75 151 25, baseline -1
Gtk-Message: gtk_widget_size_allocate:         GtkAccelLabel 29 79 90 17, baseline -1
Gtk-Message: gtk_widget_set_clip:              GtkAccelLabel 29 79 90 17
Gtk-Message: gtk_widget_set_clip:            GtkRadioMenuItem 0 0 151 100
Gtk-Message: gtk_widget_set_clip:            GtkRadioMenuItem 0 0 151 100
Gtk-Message: gtk_widget_size_allocate:       GtkRadioMenuItem 0 100 151 25, baseline -1
Gtk-Message: gtk_widget_size_allocate:         GtkAccelLabel 29 104 90 17, baseline -1
Gtk-Message: gtk_widget_set_clip:              GtkAccelLabel 29 104 90 17
Gtk-Message: gtk_widget_set_clip:            GtkRadioMenuItem 0 0 151 125
Gtk-Message: gtk_widget_set_clip:            GtkRadioMenuItem 0 0 151 125

(gtk3-demo:14558): Gtk-WARNING **: GtkMenu 0x563c8bf52b60 or a child called gtk_widget_queue_resize() during size_allocate().

(gtk3-demo:14558): Gtk-WARNING **: GtkWindow 0x563c8c000a60 or a child called gtk_widget_queue_resize() during size_allocate().
Gtk-Message: gtk_widget_size_allocate:   GtkWindow 0 0 151 67, baseline -1
Gtk-Message: gtk_widget_size_allocate:     GtkMenu 0 0 151 67, baseline -1
Gtk-Message: gtk_widget_size_allocate:       GtkRadioMenuItem 0 0 151 25, baseline -1
Gtk-Message: gtk_widget_size_allocate:         GtkAccelLabel 29 4 90 17, baseline -1
Gtk-Message: gtk_widget_set_clip:              GtkAccelLabel 29 4 90 17
Gtk-Message: gtk_widget_set_clip:            GtkRadioMenuItem 0 0 151 25
Gtk-Message: gtk_widget_set_clip:            GtkRadioMenuItem 0 0 151 25
Gtk-Message: gtk_widget_size_allocate:       GtkRadioMenuItem 0 25 151 25, baseline -1
Gtk-Message: gtk_widget_size_allocate:         GtkAccelLabel 29 29 90 17, baseline -1
Gtk-Message: gtk_widget_set_clip:              GtkAccelLabel 29 29 90 17
Gtk-Message: gtk_widget_set_clip:            GtkRadioMenuItem 0 25 151 25
Gtk-Message: gtk_widget_set_clip:            GtkRadioMenuItem 0 25 151 25
Gtk-Message: gtk_widget_size_allocate:       GtkRadioMenuItem 0 50 151 25, baseline -1
Gtk-Message: gtk_widget_size_allocate:         GtkAccelLabel 29 54 90 17, baseline -1
Gtk-Message: gtk_widget_set_clip:              GtkAccelLabel 29 54 90 17
Gtk-Message: gtk_widget_set_clip:            GtkRadioMenuItem 0 50 151 25
Gtk-Message: gtk_widget_set_clip:            GtkRadioMenuItem 0 50 151 25
Gtk-Message: gtk_widget_size_allocate:       GtkRadioMenuItem 0 75 151 25, baseline -1
Gtk-Message: gtk_widget_size_allocate:         GtkAccelLabel 29 79 90 17, baseline -1
Gtk-Message: gtk_widget_set_clip:              GtkAccelLabel 29 79 90 17
Gtk-Message: gtk_widget_set_clip:            GtkRadioMenuItem 0 75 151 25
Gtk-Message: gtk_widget_set_clip:            GtkRadioMenuItem 0 75 151 25
Gtk-Message: gtk_widget_size_allocate:       GtkRadioMenuItem 0 100 151 25, baseline -1
Gtk-Message: gtk_widget_size_allocate:         GtkAccelLabel 29 104 90 17, baseline -1
Gtk-Message: gtk_widget_set_clip:              GtkAccelLabel 29 104 90 17
Gtk-Message: gtk_widget_set_clip:            GtkRadioMenuItem 0 100 151 25
Gtk-Message: gtk_widget_set_clip:            GtkRadioMenuItem 0 100 151 25
Gtk-Message: gtk_widget_size_allocate:   GtkWindow 0 0 122 140, baseline -1
Gtk-Message: gtk_widget_size_allocate:     GtkBox 0 0 122 140, baseline -1
Gtk-Message: gtk_widget_size_allocate:       GtkBox 0 0 122 140, baseline -1
Gtk-Message: gtk_widget_size_allocate:         GtkMenuBar 0 0 122 42, baseline -1
Gtk-Message: gtk_widget_size_allocate:           GtkMenuItem 0 0 48 42, baseline -1
Gtk-Message: gtk_widget_size_allocate:             GtkAccelLabel 8 4 32 34, baseline -1
Gtk-Message: gtk_widget_set_clip:                  GtkAccelLabel 8 4 32 34
Gtk-Message: gtk_widget_set_clip:                GtkMenuItem 0 0 48 42
Gtk-Message: gtk_widget_size_allocate:           GtkMenuItem 48 0 37 42, baseline -1
Gtk-Message: gtk_widget_size_allocate:             GtkAccelLabel 56 4 21 34, baseline -1
Gtk-Message: gtk_widget_set_clip:                  GtkAccelLabel 56 12 21 17
Gtk-Message: gtk_widget_set_clip:                GtkMenuItem 0 0 85 42
Gtk-Message: gtk_widget_size_allocate:           GtkMenuItem 85 0 37 42, baseline -1
Gtk-Message: gtk_widget_size_allocate:             GtkAccelLabel 93 4 21 34, baseline -1
Gtk-Message: gtk_widget_set_clip:                  GtkAccelLabel 93 12 22 17
Gtk-Message: gtk_widget_set_clip:                GtkMenuItem 0 0 122 42
Gtk-Message: gtk_widget_set_clip:              GtkMenuBar 0 0 122 42
Gtk-Message: gtk_widget_size_allocate:         GtkBox 0 42 122 98, baseline -1
Gtk-Message: gtk_widget_set_clip:            GtkBox 0 0 122 140
Gtk-Message: gtk_widget_set_clip:            GtkBox 0 0 122 140
Gtk-Message: gtk_widget_set_clip:          GtkBox 0 0 122 140
Gtk-Message: gtk_widget_set_clip:          GtkBox 0 0 122 140
Gtk-Message: gtk_widget_size_allocate:   GtkWindow 0 0 1 1, baseline -1
Gtk-Message: gtk_widget_size_allocate:     GtkMenu 0 0 1 1, baseline -1

(gtk3-demo:14558): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed

(gtk3-demo:14558): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed

(gtk3-demo:14558): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed

(gtk3-demo:14558): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed

(gtk3-demo:14558): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed
*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug

*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug


(gtk3-demo:14558): Gtk-WARNING **: Negative content width -7 (allocation 1, extents 4x4) while allocating gadget (node arrow, owner GtkMenu)

(gtk3-demo:14558): Gtk-WARNING **: Negative content width -7 (allocation 1, extents 4x4) while allocating gadget (node arrow, owner GtkMenu)
*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug
...
Comment 18 Matthias Clasen 2017-10-26 04:23:30 UTC
(In reply to Harry Coin from comment #16)

> The last comment above seems to have halted any progress fixing this
> whatever.  Note this bug renders gtk3 and all apps that depend upon it
> unusable over x11 forwarding.  Why there is so little interest surprises me.
> 

I don't think that is true in general. It certainly depends on the characteristics of the X server whether this problem happens or not, and it is not tied to remote X in any direct way.
Comment 19 Harry Coin 2017-10-26 14:36:59 UTC
I had thought it a general problem as the problem exists in cgywin's server and xming server, both old and current versions.  I tried it just now between two identical linux systems via ssh -X ... 

gtk3-demo / menu operated verrrrryyy slowly.....  Several seconds between clicks and responses, but it didn't complain.

Interesting that so much gets the screen and window dimensions correct, only the menu dropdowns appear to lose track of screen size in the gtk3 somewhere after versions after 3.16.  Those "queue resizes during allocate" warnings?
Comment 20 Harry Coin 2017-10-26 15:00:02 UTC
add VcXsrv to the list "gtk3 no longer works with"

Log while loading and running gkt3-demo / menu:
Welcome to the VcXsrv X Server
Vendor: The VcXsrv Project
Release: 1.19.3.3

OS: Windows NT 6.2 build 9200 (64-bit)
Contact: marha@users.sourceforge.net

LoadPreferences: C:\Users\Harry\AppData\Roaming\.XWinrc not found
LoadPreferences: Loading C:\Program Files\VcXsrv\system.XWinrc
Warning: Locale not supported by X, falling back to 'C' locale.
(II) AIGLX: enabled GLX_MESA_copy_sub_buffer
(II) AIGLX: enabled GLX_SGI_swap_control
(II) 513 pixel formats reported by wglGetPixelFormatAttribivARB
(II) GLX: Initialized Win32 native WGL GL provider for screen 0
winClipboardThreadProc - DISPLAY=127.0.0.1:0.0
OS maintains clipboard viewer chain: yes
winMultiWindowWMProc - Error code: 8 (Match), ID: 0x00200001, Major opcode: 12 (ConfigureWindow), Minor opcode: 0 ((null))
winMultiWindowWMProc - Error code: 8 (Match), ID: 0x00300001, Major opcode: 12 (ConfigureWindow), Minor opcode: 0 ((null))
winLoadCursor - Windows requires 32x32 cursor but X requires 48x48
winLoadCursor - Windows requires 32x32 cursor but X requires 48x48
winLoadCursor - Windows requires 32x32 cursor but X requires 48x48
Comment 21 Larkin Lowrey 2017-10-26 16:05:09 UTC
Interestingly, a build of Xming v6.9.0.31 (2007) renders menus correctly while cygwin's 1.19.4 does not. After a quick scan of Xming's changelog (and a lot of luck) I found that the issue appears to be related to the X11 RandR protocol.

If I start cygwin's X server with '-extension RANDR' to disable the RandR extension, menus are displayed correctly.

Given the number of Xming changes related to RandR I'm guessing that Xming and cygwin have problems with their implementation. But, it's not clear why only GTK menus are effected.
Comment 22 Harry Coin 2017-10-26 20:10:49 UTC
Very interestingly indeed!  I'm suspecting as three different current windows hosed x-servers that worked with gtk3 v3.16-ish across three separately maintained popular windows x-server installations (both open and closed source) have that same code fail when the only thing changed is a later gtk3 release, well, what we have here is a failure of testing gtk revs before releasing into the wild.

I confirm a temporary workaround is to launch Xming, Cgywin or VxSrv Windows hosted x servers with the added rc option / command line directive.

-extension RANDR

That the linux hosted x11 x-server appears to work suggests gtk developers have testing platforms cover that case (to be expected) or those via x11 just have randr disabled by default.

The work that remains is to identify what exactly was it that once was compatible that became incompatible between the gtk codebase and the three windows xserver code bases.  Now there is a place to look:  the randr related function calls/data strux. 

Only then can it be determined whether it's only good luck the linux hosted X servers still work, or whether all three Windows hosted xservers got it wrong and by chance alone the bug wasn't hit all these years until gtk3 made use of something new that was supposed to _just work_ in the servers that did not, or, whether the menu part of gtk3 as it evolved overlooked to stay compatible with the randr extension.


The works/breaks/workaround operating matrix is:

GtkVersion ->      3.16-ish       3.22.x
Xserver version
2007-ish            works          works
current w/defaults  works          regression
current w/o RANDR   works          works / limited functions.


XServers launched with that extension disabled operate properly with gtk3 versions after 3.16. 

Thanks to Larkin for the lead that just might deliver focus enough to fix this platform killer!
Comment 23 Matthias Clasen 2017-10-28 14:30:47 UTC
commit 74720117c9f12b01099ab55043d80c9fa21f44a5 (HEAD -> gtk-3-22, origin/gtk-3-22)
Author: Matthias Clasen <mclasen@redhat.com>
Date:   Sat Oct 28 10:22:30 2017 -0400

    Revert "gdkscreen-x11: Enable RandR on VirtualBox"
    
    This reverts commit f2ba6ca47322a17b37fb92662fc9552b4f106f10.
    
    This change was causing problems with several X servers,
    see https://bugzilla.gnome.org/show_bug.cgi?id=780101
Comment 24 Filipe Silva 2018-02-09 21:31:14 UTC
Hi gentleman. I see that this is marked as RESOLVED_FIXED. In what version of gtk3.22 do we have the fix for this critical issue? I'm using centos 7.4.1708 (current latest stable version) which uses gtk3.22.10 which is known to be affected. 

Does the commit 74720117c9f12b01099ab55043d80c9fa21f44a5 fixes this issue? 

thanks in advance.
Comment 25 Jon Turney 2018-03-09 23:59:46 UTC
(In reply to Matthias Clasen from comment #15)
> According to information in the duplicate, the underlying issue here is that
> we end up with a monitor configuration that has size 0x0, which leads to the
> symptoms described above.

... and this is in fact the case.

It seems that XWin since 1.17.1-1 (sometimes) returns broken RANDR information i.e. RRGetScreenResourcesCurrent() has nmode = 0 and XRRGetCrtcInfo() returns a CRTC size of 0x0.

(Note that simply running 'xrandr' is probably enough to make it return the correct information thereafter, so this was an annoying heisenbug to investigate...)