Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
While running thunar-1.18.4 on slackware-current fully updated, if I right-click in an empty spot in the file manager main window, and get the context menu containing "Create Folder" and "Create Document", and either hover or or left-click the "Create Document" menu item, a tiny menu box (like 5 pixels high by 20 wide?) appears. Running from a Thunar daemon, the following error appears in .xsession-errors:
*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug
If I kill the Thunar daemon and run it in the foreground from a terminal window, the same message appears on stdout. The error does not occur on the Thunar side pane, on the desktop or in other programs. However, if I
click the "File" option in the Thunar main menu, then hover over or left-click the "Create Document" option in it, a similar mis-sized menu appears. In this case the menu is too tall, but is about 20 pixels wide, and I can see the beginnings of the correct menu items - "letterhead" and "Empty File". If I then right-click on a file icon in the Thunar main window, the context menu is wide enough, but too short, and displays with scroll bars, but ONLY the FIRST TIME. If I right-click the file icon again, the context menu is correct. I can get the problem with the file icon to re-occur by going back through the (still broken) "Create Document" process. Sounds like memory corruption or uninitialized variables. For grins, I rebuilt Thunar 1.18.1 from source, and experienced the same problem. The problem only appeared in the last few weeks, and Thunar 1.18.1 is much older than that, so the issue is likely to be in some more-recently updated library, but I have no idea which one...
This bug occurs in older versions of thunar from well
before the appearance of the current version. Reversion
to gtk+3-3.24.5 "cured" the bug.
*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug
Compiled thunar, gtk+3-3.24.7, and pixman-0.38 from source with "-g".
ran thunar and used Ctrl-Alt-F1 to get to the console,
attached the running thunar with gdb, set the suggested
breakpoint, and created the bug. With the standard "-O2"
optimization a lot of the "interesting" function arguments
were "<optimized out>". So I recompiled gtk+3 with "-O"
and got the following backtrace:
Thread 1 "thunar" hit Breakpoint 1, _pixman_log_error (function=function@entry=0x7f8ff7dcfc70 <__PRETTY_FUNCTION__.4750> "pixman_region32_init_rect", message=message@entry=0x7f8ff7dcf957 "Invalid rectangle passed") at pixman-utils.c:320
320 if (n_messages < 10)
(gdb) where
#0 0x00007f8ff7da02e0 in _pixman_log_error (function=function@entry=0x7f8ff7dcfc70 <__PRETTY_FUNCTION__.4750> "pixman_region32_init_rect", message=message@entry=0x7f8ff7dcf957 "Invalid rectangle passed") at pixman-utils.c:320
#1 0x00007f8ff7d9d66a in pixman_region32_init_rect (region=0x147f4e8, x=<optimized out>, y=<optimized out>, width=<optimized out>, height=<optimized out>) at pixman-region.c:389
#2 0x00007f8ff96c7068 in cairo_region_create_rectangle () at /usr/lib64/libcairo.so.2
#3 0x00007f8ff9846957 in recompute_visible_regions_internal (private=private@entry=0x15297f0, recalculate_clip=recalculate_clip@entry=1, recalculate_children=recalculate_children@entry=0) at gdkwindow.c:1018
#4 0x00007f8ff9846b62 in recompute_visible_regions (private=private@entry=0x15297f0, recalculate_children=recalculate_children@entry=0) at gdkwindow.c:1119
#5 0x00007f8ff984d217 in gdk_window_move_resize_internal (window=0x15297f0, with_move=with_move@entry=1, x=x@entry=0, y=y@entry=25, width=width@entry=50, height=height@entry=-42) at gdkwindow.c:6099
#6 0x00007f8ff984d30a in gdk_window_move_resize (window=<optimized out>, x=x@entry=0, y=y@entry=25, width=width@entry=50, height=height@entry=-42) at gdkwindow.c:6206
#7 0x00007f8ff9acfc46 in gtk_menu_scroll_to (menu=menu@entry=0x12bd3e0, offset=offset@entry=15, flags=flags@entry=GTK_MENU_SCROLL_FLAG_NONE) at gtkmenu.c:5487
#8 0x00007f8ff9ad00ee in gtk_menu_scroll_by (menu=0x12bd3e0, step=<optimized out>) at gtkmenu.c:4185
#9 0x00007f8ff9ad0103 in gtk_menu_scroll_timeout (data=<optimized out>) at gtkmenu.c:4194
#10 0x00007f8ff982a104 in gdk_threads_dispatch (data=0x10dc340) at gdk.c:770
#11 0x00007f8ff8f32ef3 in () at /usr/lib64/libglib-2.0.so.0
#12 0x00007f8ff8f324a8 in g_main_context_dispatch () at /usr/lib64/libglib-2.0.so.0
#13 0x00007f8ff8f32868 in () at /usr/lib64/libglib-2.0.so.0
#14 0x00007f8ff8f328ec in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0
#15 0x00007f8ff91292ad in g_application_run () at /usr/lib64/libgio-2.0.so.0
#16 0x000000000041f736 in main (argc=1, argv=0x7ffdb4d697a8) at main.c:161
Notice at level #6 gdk_move_resize_window is called with
width = 50 (about 1/2" in pixels on my 100dpi screen) and height=-42
(which is clearly garbage). Both x and y are suspect, as well. Legitimate
width x height would be 150 x 75 based on the display of this same menu
from the Xfce4 Desktop, where it displays correctly.
With gdb, backing up to level 7, gtk_widget_get_allocated_width() returns 50
and gtk_widget_get_allocated_height() returns 8 for the menu widget,
both of which are bogus.
Did not chase down where these values are set - they are in a private structure.
However, I rebuilt gtk+3-3.24.5 from source, and reverted to that, and the Thunar problem went away.
One of the suspects in the possible memory corruption at the root of this bug is pixman, but today's upgrade to 0.38.4 does not change the problem. Other candidates are thunar itself, gtk+3 or cairo. Still sticking with gtk+3-3.24.5, which does not display the symptom.
I have in the past run into problems where xfce and its components use deprecated features of gtk+ which are subsequently de-implemented without changing the ABI. So no compile/link error is generated, but a seemingly unrelated symptom appears. This is noticeable in code written for gtk+2 that appears to run with gtk+3 but behaves differently.
I followed up on David McCann's post, and after much poking around, discovered a commentary in the XFCE forums about a particular GTK commit that was thought to be the problem. I found the commit on GitHub and created a patch to GTK to reverse that commit in gtk+-3.24.8 (the version in slackware 64-current). It worked, so here is a minimalist version of the patch, which could go in the gtk+-3.24.8 source SlackBuild:
********************************
--- /tmp/gtk+-3.24.8/gtk/gtkmenu.c 2019-04-10 12:30:43.000000000 -0700
+++ /usr/local/slackbuilds/gtk+-3.24.8/gtk/gtkmenu.c 2019-04-21 07:36:56.930937979 -0700
@@ -1398,11 +1398,6 @@
gboolean flipped_y,
GtkMenu *menu)
{
- GtkMenuPrivate *priv = menu->priv;
-
- gtk_window_fixate_size (GTK_WINDOW (priv->toplevel));
-
- if (!priv->emulated_move_to_rect)
g_signal_emit (menu,
menu_signals[POPPED_UP],
0,
@@ -5291,10 +5286,9 @@
gdk_window_set_transient_for (toplevel, rect_window);
***************************
Since the XFCE folks do not plan to update their use of deprecated "gtkaction" until gtk+4 comes out, this is the easiest way to keep Thunar working. Enjoy. I'll mark this thread "SOLVED.
The patch from Rod worked perfectly with Xubuntu 19.04.
With Xubuntu 19.10 and Thunar 1.8.9 the problem appears again It doesn't matter if I use my patched libgtk-3-0_3.24.8 from 19.04 or the same-patched gtk+3.0-3.24.12 which comes with 19.10.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.