RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1496157 - Menus do not display over remote X11
Summary: Menus do not display over remote X11
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: gtk3
Version: 7.4
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Benjamin Otte
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On:
Blocks: 1727111
TreeView+ depends on / blocked
 
Reported: 2017-09-26 14:53 UTC by Deepu K S
Modified: 2021-09-09 12:38 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-09-17 06:47:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNOME Bugzilla 780101 0 None None None 2019-07-25 13:45:15 UTC

Description Deepu K S 2017-09-26 14:53:42 UTC
Description of problem:
When using the virt-manager remotely, all the menus, drop-down, left click, right click no longer work, and the ones that seem to do something put a line in the upper left corner of the screen, or the bottom of a menu that is off the display.

Tried connecting using Xming and Cygwin/X on Windows.

The virt-manager debug log shows;
=================================
(virt-manager:29764): Gtk-WARNING **: Allocating size to GtkWindow 0x287e7e0 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?
[Mon, 25 Sep 2017 09:51:37 virt-manager 29764] DEBUG (connection:571) conn=qemu:///system changed to state=Active

(virt-manager:29764): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed

(virt-manager:29764): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed

(virt-manager:29764): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed

(virt-manager:29764): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0' failed

(virt-manager:29764): 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:29764): Gtk-WARNING **: Negative content width -7 (allocation 1, extents 4x4) while allocating gadget (node arrow, owner GtkMenu)

(virt-manager:29764): 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:29764): Gtk-WARNING **: Negative content width -11 (allocation 1, extents 6x6) while allocating gadget (node menuitem, owner GtkImageMenuItem)
====================================

Issue appears to happen post update to RHEL 7.4

Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux 7.4
gtk3-3.22.10-4.el7.x86_64
virt-manager-1.4.1-7.el7.noarch
Xming or Cygwin X on Windows

How reproducible:
Always

Steps to Reproduce:
1. Open virt-manager in X11 Forwarded session from Windows.
2. Click on any drop down menus on virt-manager.
3. 

Actual results:
Application fails to display the menus.

Expected results:
The applicaton should display the menus.

Additional info:

Comment 2 Damien Gombault 2017-09-28 14:52:06 UTC
Hi.

I confirm this problem with CentOS 7.4.
I connect to a remote SSH host with Putty/VcXsrv on Windows.
I launch virt-manager, the main window is OK but the menus doesn't work anymore.

Comment 3 Damien Gombault 2017-09-29 07:26:42 UTC
I have installed the latest update for gtk3 from CentOS 7.3 as a workaround :
rpm -Uvh --oldpackage gtk3-3.14.13-20.el7_3.1.x86_64.rpm

The menus works with this old version.

Comment 4 Harry Coin 2017-10-05 02:01:39 UTC
To make it easier for folks to see this:  

gtk3-demo

choose 'menus' then 'run' then click any menu item.

That removes the whole python gir machinery from the problem space.

This code via x11 fails:

#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>

#include <stdio.h>

static GtkWidget *
create_menu (gint depth)
{
  GtkWidget *menu;
  GtkRadioMenuItem *last_item;
  char buf[32];
  int i, j;

  if (depth < 1)
    return NULL;

  menu = gtk_menu_new ();
  last_item = NULL;

  for (i = 0, j = 1; i < 5; i++, j++)
    {
      GtkWidget *menu_item;

      sprintf (buf, "item %2d - %d", depth, j);

      menu_item = gtk_radio_menu_item_new_with_label_from_widget (NULL, buf);
      gtk_radio_menu_item_join_group (GTK_RADIO_MENU_ITEM (menu_item), last_item);
      last_item = GTK_RADIO_MENU_ITEM (menu_item);

      gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
      gtk_widget_show (menu_item);
      if (i == 3)
        gtk_widget_set_sensitive (menu_item, FALSE);

      gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_item), create_menu (depth - 1));
    }

  return menu;
}

static void
change_orientation (GtkWidget *button,
                    GtkWidget *menubar)
{
  GtkWidget *parent;
  GtkOrientation orientation;

  parent = gtk_widget_get_parent (menubar);
  orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (parent));
  gtk_orientable_set_orientation (GTK_ORIENTABLE (parent), 1 - orientation);

  if (orientation == GTK_ORIENTATION_VERTICAL)
    g_object_set (menubar, "pack-direction", GTK_PACK_DIRECTION_TTB, NULL);
  else
    g_object_set (menubar, "pack-direction", GTK_PACK_DIRECTION_LTR, NULL);

}

static GtkWidget *window = NULL;

GtkWidget *
do_menus (GtkWidget *do_widget)
{
  GtkWidget *box;
  GtkWidget *box1;
  GtkWidget *box2;
  GtkWidget *button;

  if (!window)
    {
      GtkWidget *menubar;
      GtkWidget *menu;
      GtkWidget *menuitem;
      GtkAccelGroup *accel_group;

      window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
      gtk_window_set_screen (GTK_WINDOW (window),
                             gtk_widget_get_screen (do_widget));
      gtk_window_set_title (GTK_WINDOW (window), "Menus");
      g_signal_connect (window, "destroy",
                        G_CALLBACK(gtk_widget_destroyed), &window);

      accel_group = gtk_accel_group_new ();
      gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);

      gtk_container_set_border_width (GTK_CONTAINER (window), 0);

      box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
      gtk_container_add (GTK_CONTAINER (window), box);
      gtk_widget_show (box);

      box1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
      gtk_container_add (GTK_CONTAINER (box), box1);
      gtk_widget_show (box1);

      menubar = gtk_menu_bar_new ();
      gtk_widget_set_hexpand (menubar, TRUE);
      gtk_box_pack_start (GTK_BOX (box1), menubar, FALSE, TRUE, 0);
      gtk_widget_show (menubar);

      menu = create_menu (2);

      menuitem = gtk_menu_item_new_with_label ("test\nline2");
      gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), menu);
      gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
      gtk_widget_show (menuitem);

      menuitem = gtk_menu_item_new_with_label ("foo");
      gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), create_menu (3));
      gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
      gtk_widget_show (menuitem);

      menuitem = gtk_menu_item_new_with_label ("bar");
      gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), create_menu (4));
      gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
      gtk_widget_show (menuitem);

      box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
      gtk_container_set_border_width (GTK_CONTAINER (box2), 10);
      gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE, 0);
      gtk_widget_show (box2);

      button = gtk_button_new_with_label ("Flip");
      g_signal_connect (button, "clicked",
                        G_CALLBACK (change_orientation), menubar);
      gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
      gtk_widget_show (button);

      button = gtk_button_new_with_label ("Close");
      g_signal_connect_swapped (button, "clicked",
                                G_CALLBACK(gtk_widget_destroy), window);
      gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
      gtk_widget_set_can_default (button, TRUE);
      gtk_widget_grab_default (button);
      gtk_widget_show (button);
    }

  if (!gtk_widget_get_visible (window))
    gtk_widget_show (window);
  else
    gtk_widget_destroy (window);

  return window;
}

Comment 5 Harry Coin 2017-10-05 02:37:36 UTC
And, here's the backtrace.

#0  0x00007faf7a756be0 in _pixman_log_error (function=function@entry=0x7faf7a787b50 <__PRETTY_FUNCTION__.4993> "pixman_region32_init_rect", message=message@entry=0x7faf7a78783f "Invalid rectangle passed") at pixman-utils.c:320
#1  0x00007faf7a753bc6 in pixman_region32_init_rect (region=region@entry=0x1651718, x=<optimized out>, y=<optimized out>, width=<optimized out>, height=<optimized out>)
    at pixman-region.c:389
#2  0x00007faf7db4a96e in INT_cairo_region_create_rectangle (rectangle=rectangle@entry=0x7fff8dbdb740) at cairo-region.c:338
#3  0x00007faf7feb75cc in recompute_visible_regions_internal (private=private@entry=0x1652330 [GdkX11Window], recalculate_clip=recalculate_clip@entry=1, recalculate_children=recalculate_children@entry=0) at gdkwindow.c:1018
#4  0x00007faf7feb775c in recompute_visible_regions (private=private@entry=0x1652330 [GdkX11Window], recalculate_children=recalculate_children@entry=0) at gdkwindow.c:1119
#5  0x00007faf7febe743 in gdk_window_move_resize_internal (window=0x1652330 [GdkX11Window], with_move=1, x=0, y=21, width=<optimized out>, height=<optimized out>) at gdkwindow.c:6093
#6  0x00007faf8036f8f2 in gtk_menu_scroll_to (menu=menu@entry=0x1026b50 [GtkMenu], offset=0) at gtkmenu.c:5429
#7  0x00007faf80374736 in gtk_menu_size_allocate (widget=0x1026b50 [GtkMenu], allocation=0x7fff8dbdba40) at gtkmenu.c:3473
#8  0x00007faf804bd6e4 in gtk_widget_size_allocate_with_baseline (widget=widget@entry=0x1026b50 [GtkMenu], allocation=allocation@entry=0x7fff8dbdbac0, baseline=baseline@entry=-1)
    at gtkwidget.c:6115
#9  0x00007faf804bd8ea in gtk_widget_size_allocate (widget=widget@entry=0x1026b50 [GtkMenu], allocation=allocation@entry=0x7fff8dbdbac0) at gtkwidget.c:6196
#10 0x00007faf804d3b0b in gtk_window_size_allocate (widget=0x10d0a80 [GtkWindow], allocation=<optimized out>) at gtkwindow.c:7700
#14 0x00007faf7c476ddf in <emit signal ??? on instance 0x10d0a80 [GtkWindow]> (instance=instance@entry=0x10d0a80, signal_id=<optimized out>, detail=detail@entry=0) at gsignal.c:3447
    #11 0x00007faf7c45c968 in g_closure_invoke (closure=closure@entry=0xe35790, return_value=return_value@entry=0x0, n_param_values=2, param_values=param_values@entry=0x7fff8dbdbc90, invocation_hint=invocation_hint@entry=0x7fff8dbdbc30) at gclosure.c:804
    #12 0x00007faf7c46e2a7 in signal_emit_unlocked_R (node=node@entry=0xdfac60, detail=detail@entry=0, instance=instance@entry=0x10d0a80, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fff8dbdbc90) at gsignal.c:3565
    #13 0x00007faf7c476af1 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fff8dbdbe20)
    at gsignal.c:3391
#15 0x00007faf804bd53a in gtk_widget_size_allocate_with_baseline (widget=widget@entry=0x10d0a80 [GtkWindow], allocation=allocation@entry=0x7fff8dbdc0b0, baseline=baseline@entry=-1)
    at gtkwidget.c:6113
#16 0x00007faf804bd8ea in gtk_widget_size_allocate (widget=widget@entry=0x10d0a80 [GtkWindow], allocation=allocation@entry=0x7fff8dbdc0b0) at gtkwidget.c:6196
#17 0x00007faf804ce101 in gtk_window_check_resize (window=0x10d0a80 [GtkWindow]) at gtkwindow.c:9746
#18 0x00007faf804ce101 in gtk_window_check_resize (container=0x10d0a80 [GtkWindow]) at gtkwindow.c:8328
#19 0x00007faf7c45cb97 in _g_closure_invoke_va (closure=closure@entry=0xe3f1b0, return_value=return_value@entry=0x0, instance=instance@entry=0x10d0a80, args=args@entry=0x7fff8dbdc310, n_params=0, param_types=0x0) at gclosure.c:867
#20 0x00007faf7c476157 in g_signal_emit_valist (instance=0x10d0a80, signal_id=<optimized out>, detail=0, var_args=var_args@entry=0x7fff8dbdc310) at gsignal.c:3300
#21 0x00007faf7c476ddf in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3447
#22 0x00007faf80299128 in gtk_container_idle_sizer (clock=0xde95e0 [GdkFrameClockIdle], container=0x10d0a80 [GtkWindow]) at gtkcontainer.c:2064
#26 0x00007faf7c476ddf in <emit signal ??? on instance 0xde95e0 [GdkFrameClockIdle]> (instance=instance@entry=0xde95e0, signal_id=<optimized out>, detail=detail@entry=0)
    at gsignal.c:3447
    #23 0x00007faf7c45c968 in g_closure_invoke (closure=0x1642270, return_value=return_value@entry=0x0, n_param_values=1, param_values=param_values@entry=0x7fff8dbdc5a0, invocation_hint=invocation_hint@entry=0x7fff8dbdc540) at gclosure.c:804
    #24 0x00007faf7c46ea7d in signal_emit_unlocked_R (node=node@entry=0xe31580, detail=detail@entry=0, instance=instance@entry=0xde95e0, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fff8dbdc5a0) at gsignal.c:3635
    #25 0x00007faf7c476af1 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fff8dbdc720)
    at gsignal.c:3391
#27 0x00007faf7feabf8f in _gdk_frame_clock_emit_layout (frame_clock=frame_clock@entry=0xde95e0 [GdkFrameClockIdle]) at gdkframeclock.c:634
#28 0x00007faf7feac670 in gdk_frame_clock_paint_idle (data=0xde95e0) at gdkframeclockidle.c:408
#29 0x00007faf7fe97338 in gdk_threads_dispatch (data=data@entry=0xf7c1a0) at gdk.c:743
#30 0x00007faf7c185eed in g_timeout_dispatch (source=0x16455a0, callback=0x7faf7fe97310 <gdk_threads_dispatch>, user_data=0xf7c1a0) at gmain.c:4672
#31 0x00007faf7c1854c9 in g_main_context_dispatch (context=0xdee400) at gmain.c:3201
#32 0x00007faf7c1854c9 in g_main_context_dispatch (context=context@entry=0xdee400) at gmain.c:3854
---Type <return> to continue, or q <return> to quit---
#33 0x00007faf7c185818 in g_main_context_iterate (context=context@entry=0xdee400, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3927
#34 0x00007faf7c1858cc in g_main_context_iteration (context=context@entry=0xdee400, may_block=may_block@entry=1) at gmain.c:3988
#35 0x00007faf7ece27c5 in g_application_run (application=application@entry=0xde91a0 [GtkApplication], argc=argc@entry=1, argv=argv@entry=0x7fff8dbdcb38) at gapplication.c:2381
#36 0x0000000000416a2b in main (argc=1, argv=0x7fff8dbdcb38) at main.c:1209

Comment 10 Benjamin Otte 2019-09-16 15:56:38 UTC
The upstream fix was part of GTK 3.22.26, which as part of bug 1481414 entered RHEL 7.5, so this bug should have been fixed since then, as comment 7 points out.


Note You need to log in before you can comment on or make changes to this bug.