LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 04-02-2019, 05:31 PM   #1
Rod3775
Member
 
Registered: May 2008
Location: Washington State
Distribution: Slackware-current
Posts: 94
Blog Entries: 10

Rep: Reputation: 18
Thunar BUG in right mouse menus


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...
 
Old 04-04-2019, 12:30 PM   #2
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,142

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
This has been reported and they're hard at work!
https://bugzilla.xfce.org/show_bug.cgi?id=15200
 
1 members found this post helpful.
Old 04-04-2019, 04:15 PM   #3
Rod3775
Member
 
Registered: May 2008
Location: Washington State
Distribution: Slackware-current
Posts: 94

Original Poster
Blog Entries: 10

Rep: Reputation: 18
maybe not a thunar issue!

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.
 
Old 04-11-2019, 09:54 AM   #4
Rod3775
Member
 
Registered: May 2008
Location: Washington State
Distribution: Slackware-current
Posts: 94

Original Poster
Blog Entries: 10

Rep: Reputation: 18
pixman upgrade doesn't help

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.
 
Old 04-21-2019, 11:18 AM   #5
Rod3775
Member
 
Registered: May 2008
Location: Washington State
Distribution: Slackware-current
Posts: 94

Original Poster
Blog Entries: 10

Rep: Reputation: 18
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);

g_signal_handlers_disconnect_by_func (toplevel, moved_to_rect_cb, menu);
-
- g_signal_connect (toplevel, "moved-to-rect", G_CALLBACK (moved_to_rect_cb),
- menu);
- priv->emulated_move_to_rect = emulated_move_to_rect;
+ if (!emulated_move_to_rect)
+ g_signal_connect (toplevel, "moved-to-rect", G_CALLBACK (moved_to_rect_cb),
+ menu);

gdk_window_move_to_rect (toplevel,
&rect,

***************************
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.
 
Old 12-01-2019, 05:53 AM   #6
DocStrange
LQ Newbie
 
Registered: Dec 2019
Location: Hamburg/Germany
Distribution: Xubuntu
Posts: 1

Rep: Reputation: Disabled
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.
 
  


Reply

Tags
slackware-current, thunar, xfce



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Thunar 1.8.3 bug if using Cinnamon 4.0.9 Bindestreck Slackware 2 01-30-2019 04:44 AM
[SOLVED] Found a bug in Thunar 1.6.10 PROBLEMCHYLD Slackware 27 09-18-2017 12:14 AM
[SOLVED] xfce Thunar closes when right mouse button is clicked mlpa Slackware 17 11-27-2011 06:06 PM
right-click in Thunar (xubuntu) not working unless I hold coldwind Linux - Software 3 01-15-2009 07:55 PM
thunar volman: cannot eject, (remounted right away) kaz2100 Debian 3 01-16-2008 10:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 11:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration