Comment 2 for bug 1962372

Revision history for this message
halogen2 (halogen2) wrote :

So I recently had to compile Thunar 4.19.2 for Xubuntu 22.04, and saw this issue still exists there, so dug into it again. And this time was able to come up with a small patch to Thunar 4.19.2 that fix the issue (probably not the best fix, since I don't actually know what I'm doing in C/C++, but it seems to do the job so should at least point in the right direction).

This would ideally be brought to upstream Thunar/Xfce devs' attention at https://gitlab.xfce.org/xfce/thunar/-/issues But I was unsuccessful in looking into registering an account there. So I'm posting the patch below. Could someone please notify Thunar/Xfce devs about this bug & the below tentative patch? Thanks :)

____________

diff --git a/thunar/thunar-dnd.c b/thunar/thunar-dnd.c
index 1a28cfd..c755dce 100644
--- a/thunar/thunar-dnd.c
+++ b/thunar/thunar-dnd.c
@@ -151,17 +151,21 @@ G_GNUC_END_IGNORE_DEPRECATIONS
             }
           g_list_free (providers);

           /* check if we have at least one item */
           if (G_UNLIKELY (items != NULL))
             {
               /* add menu items for all items */
               for (lp = items; lp != NULL; lp = lp->next)
- thunar_gtk_menu_thunarx_menu_item_new (lp->data, GTK_MENU_SHELL (menu));
+ {
+ item = thunar_gtk_menu_thunarx_menu_item_new (lp->data, GTK_MENU_SHELL (menu));
+ gtk_widget_show(item);
+ gtk_widget_show_all(item);
+ }
               g_list_free (items);

               /* append another separator */
               item = gtk_separator_menu_item_new ();
               gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
               gtk_widget_show (item);
             }
         }