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 771033 - GtkStatusIcon cannot show activate menu in VirtualBox since 3.21.2
GtkStatusIcon cannot show activate menu in VirtualBox since 3.21.2
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkStatusIcon
3.18.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2016-09-08 06:34 UTC by Takao Fujiwara
Modified: 2018-05-02 17:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test program (1.35 KB, text/plain)
2016-09-08 06:34 UTC, Takao Fujiwara
  Details
Screenshot of GtkStatusIcon activate menu (344.46 KB, image/png)
2016-09-08 08:06 UTC, Takao Fujiwara
  Details
Patch to enable RandR on VirtualBox (3.98 KB, patch)
2016-09-09 17:05 UTC, Takao Fujiwara
committed Details | Review

Description Takao Fujiwara 2016-09-08 06:34:40 UTC
Created attachment 335062 [details]
Test program

After Gdk dropped Xinerama and use GdkMonitor, GtkStatusIcon cannot show its activate menu.

I confirmed this problem happens in Gdk 3.21.2 in XFCE and LXDE but not in Gdk 3.21.1
Comment 1 Mike FABIAN 2016-09-08 07:40:49 UTC
It seems to work when trying this in qemu.
Comment 2 Takao Fujiwara 2016-09-08 08:06:56 UTC
Created attachment 335070 [details]
Screenshot of GtkStatusIcon activate menu

It seems the problem happens in VirtualBox guest only.

The top left in the screenshot shows the broken menu and the following message is output:

** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug
  • #0 _pixman_log_error
  • #1 pixman_region32_init_rect
  • #2 cairo_region_create_rectangle
  • #3 recompute_visible_regions_internal
    at gdkwindow.c line 1006
  • #4 recompute_visible_regions
    at gdkwindow.c line 1107
  • #5 gdk_window_move_resize_internal
    at gdkwindow.c line 6071
  • #6 gdk_window_move_resize
    at gdkwindow.c line 6178
  • #7 gtk_menu_scroll_to
    at gtkmenu.c line 5366
  • #8 gtk_menu_size_allocate
    at gtkmenu.c line 3452
  • #9 gtk_widget_size_allocate_with_baseline
    at gtkwidget.c line 6109
  • #10 gtk_widget_size_allocate
    at gtkwidget.c line 6190
  • #11 gtk_window_size_allocate
    at gtkwindow.c line 7676
  • #12 g_closure_invoke
  • #13 signal_emit_unlocked_R
  • #14 g_signal_emit_valist
  • #15 g_signal_emit
  • #16 gtk_widget_size_allocate_with_baseline
    at gtkwidget.c line 6107
  • #17 gtk_widget_size_allocate
    at gtkwidget.c line 6190
  • #18 gtk_window_move_resize
    at gtkwindow.c line 9856
  • #19 gtk_window_check_resize
    at gtkwindow.c line 8304
  • #20 _g_closure_invoke_va
  • #21 g_signal_emit_valist
  • #22 g_signal_emit
  • #23 gtk_container_check_resize
    at gtkcontainer.c line 2171
  • #24 gtk_container_idle_sizer
    at gtkcontainer.c line 2064
  • #25 _g_closure_invoke_va
  • #26 g_signal_emit_valist
  • #27 g_signal_emit
  • #28 _gdk_frame_clock_emit_layout
    at gdkframeclock.c line 634
  • #29 gdk_frame_clock_paint_idle
    at gdkframeclockidle.c line 408
  • #30 gdk_threads_dispatch
    at gdk.c line 743
  • #31 g_timeout_dispatch
  • #32 g_main_context_dispatch
  • #33 g_main_context_iterate.isra
  • #34 g_main_loop_run
  • #35 gtk_main
    at gtkmain.c line 1295
  • #36 main
    at a.c line 93

Comment 3 Matthias Clasen 2016-09-08 10:39:43 UTC
What does the gtk inspector say about monitors in this situation (in the general tab) ?
Comment 4 Takao Fujiwara 2016-09-08 11:26:01 UTC
(In reply to Matthias Clasen from comment #3)
> What does the gtk inspector say about monitors in this situation (in the
> general tab) ?

I can see the following information:

GTK+ Version                       3.21.5
GDK Backend                        X11

Display                            :1.0
RGBA visual                        v
Composited                         v
Monitor 0
  Geometry                         0 x 0 at 0, 0
  Size                             203 x 203 mm^2
  Primary                          v
  Refresh rate                     unknown
  Subpixel layout                  unknown

GL Version                         GLX 1.4
GL Vendor                          Mesa Project and SGI
GLX_ARB_create_context_profile     v
GLX_EXT_texture_from_pixmap        v
GLX_ARB_multisample                v
GLX_EXT_visual_rating              v

Seat 0                             Pointer, Keyboard
  Virtual core XTEST keyboard      Keyboard
  Power Button                     Keyboard
  Sleep Button                     Keyboard
  Video Bus                        Keyboard
  AT Translated Set 2 keyboard     Keyboard
  Virtual core XTEST pointer       Mouse
  Virutal USB Tablet               Mouse
  Axes                             X, Y
  ImExPS/2 BYD TouchPad            Mouse
Comment 5 Takao Fujiwara 2016-09-08 11:40:12 UTC
It seems the problem is not GtkStatusIcon only but also any windows cannot set the coordinates.

Even if I set GTK_WIN_POS_CENTER, The window position is (0, 0) but not the center.

int
main (int argc, char *argv[])
{
    GtkWidget *popup;
    gtk_init (&argc, &argv);
    popup = g_object_new (GTK_TYPE_WINDOW,
                          "type", GTK_WINDOW_POPUP,
                          "window-position", GTK_WIN_POS_CENTER,
                          NULL);
    GtkWidget *label = gtk_label_new ("test");

    gtk_container_add (GTK_CONTAINER (popup), label);

    gtk_widget_show_all (popup);
    gtk_main ();
    return 0;
}
Comment 6 Takao Fujiwara 2016-09-09 17:05:36 UTC
Created attachment 335210 [details] [review]
Patch to enable RandR on VirtualBox

OK, I found the root cause.

On standalone, XRROutputInfo->name is not "default".
On VirtualBox guest, XRROutputInfo->name is "default" but RANDR 1.5 is enabled.

This patch fixes both the GtkStatusIcon activate menu and the position of the centered popup menu.

I'm interested in what is the usable data compatible in RandR 1.2+.
Comment 7 Matthias Clasen 2017-10-28 14:31:38 UTC
I've reverted this change, since it was causing problems with several X servers.
Comment 8 Takao Fujiwara 2017-10-30 09:59:29 UTC
Seems the current GTK does not have the original bug even if the change is reverted.
I will comment later if I find any problems.
Comment 9 GNOME Infrastructure Team 2018-05-02 17:30:10 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/667.