Bug 1496157
| Summary: | Menus do not display over remote X11 | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Deepu K S <dkochuka> |
| Component: | gtk3 | Assignee: | Benjamin Otte <otte> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Desktop QE <desktop-qa-list> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.4 | CC: | cww, desintegr, dkochuka, hcoin, mclasen, otte, sherman.s.wang, tpelka |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2019-09-17 06:47:06 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1727111 | ||
|
Description
Deepu K S
2017-09-26 14:53:42 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. 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. 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;
}
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
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. |