Critical when middle-clicking on a directory while a file is selected
Version information
dd9046f4 on Arch Linux
Steps to reproduce
mkdir -p mixed-dir/my-dir && touch mixed-dir/my-file
thunar mixed-dir
- Select my-file
- While my-file is selected, middle click on my-dir
Current behavior
thunar-CRITICAL: thunar_action_manager_open_selected_folders: assertion 'thunar_file_is_directory (((((ThunarFile*) (void *) g_type_check_instance_cast ((GTypeInstance*) ((lp->data)), ((thunar_file_get_type ())))))))' failed
Expected outcome
No critical and my-dir opens in a new window
Backtrace
thunar_action_manager_open_selected_folders
expects a directory, but receives a file:
(gdb) p file->display_name
$3 = (gchar *) 0x502000023b10 "my-file"
(gdb) bt
#0 thunar_file_is_directory (file=0x5110000c0980 [ThunarFile]) at thunar-file.c:2784
#1 0x0000555555a849eb in thunar_action_manager_open_selected_folders (action_mgr=0x50d00001ccf0 [ThunarActionManager], open_in_tabs=0) at thunar-action-manager.c:1386
#2 0x0000555555d36775 in _thunar_standard_view_open_on_middle_click (standard_view=0x51b0000521a0 [ThunarDetailsView], tree_path=0x5020003044d0, event_state=16)
at thunar-standard-view.c:4467
#3 0x0000555555b31a43 in thunar_details_view_button_press_event (tree_view=0x519000114360 [ExoTreeView], event=0x50e000092e80, details_view=0x51b0000521a0 [ThunarDetailsView])
at thunar-details-view.c:946
#4 0x00007ffff6bc426d in _gtk_marshal_BOOLEAN__BOXED
(closure=<optimized out>, return_value=0x7fffffffdb50, n_param_values=<optimized out>, param_values=<optimized out>, invocation_hint=<optimized out>, marshal_data=<optimized out>)
at gtk/gtkmarshalers.c:84
#5 0x00007ffff75b169a in g_closure_invoke (closure=0x5070001659e0, return_value=0x7fffffffdb50, n_param_values=2, param_values=0x7fffffffdbe0, invocation_hint=0x7fffffffdb30)
at ../glib/gobject/gclosure.c:834
#6 0x00007ffff75e22a5 in signal_emit_unlocked_R.isra.0
(node=node@entry=0x7fffffffdcd0, detail=detail@entry=0, instance=instance@entry=0x519000114360, emission_return=emission_return@entry=0x7fffffffdd50, instance_and_params=instance_and_params@entry=0x7fffffffdbe0) at ../glib/gobject/gsignal.c:3888
#7 0x00007ffff75d2260 in signal_emit_valist_unlocked (instance=instance@entry=0x519000114360, signal_id=signal_id@entry=124, detail=detail@entry=0, var_args=var_args@entry=0x7fffffffde40)
at ../glib/gobject/gsignal.c:3533
#8 0x00007ffff75d2c72 in g_signal_emit_valist (instance=0x519000114360, signal_id=124, detail=0, var_args=var_args@entry=0x7fffffffde40) at ../glib/gobject/gsignal.c:3263
#9 0x00007ffff75d2d34 in g_signal_emit (instance=instance@entry=0x519000114360, signal_id=<optimized out>, detail=detail@entry=0) at ../glib/gobject/gsignal.c:3583
#10 0x00007ffff71ecec0 in gtk_widget_event_internal (widget=<optimized out>, event=0x50e000092e80) at ../gtk/gtkwidget.c:7812
#11 0x00007ffff6ee746f in propagate_event_up (widget=0x519000114360 [ExoTreeView], event=<optimized out>, topmost=<optimized out>) at ../gtk/gtkmain.c:2588
#12 propagate_event (widget=<optimized out>, event=0x50e000092e80, captured=0, topmost=0x0) at ../gtk/gtkmain.c:2691
#13 gtk_propagate_event (widget=widget@entry=0x519000114360 [ExoTreeView], event=event@entry=0x50e000092e80) at ../gtk/gtkmain.c:2725
#14 0x00007ffff6ee63d5 in gtk_main_do_event (event=0x50e000092e80) at ../gtk/gtkmain.c:1921
#15 0x00007ffff7910b71 in _gdk_event_emit (event=0x50e000092e80) at ../gdk/gdkevents.c:73
#16 0x00007ffff79d012a in gdk_event_source_dispatch (source=<optimized out>, callback=<optimized out>, user_data=<optimized out>) at ../gdk/x11/gdkeventsource.c:367
#17 0x00007ffff6140299 in g_main_dispatch (context=0x510000000440) at ../glib/glib/gmain.c:3344
#18 0x00007ffff61a2ec7 in g_main_context_dispatch_unlocked (context=0x510000000440) at ../glib/glib/gmain.c:4152
#19 g_main_context_iterate_unlocked.isra.0 (context=context@entry=0x510000000440, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4217
#20 0x00007ffff613f795 in g_main_context_iteration (context=context@entry=0x510000000440, may_block=may_block@entry=1) at ../glib/glib/gmain.c:4282
#21 0x00007ffff6310196 in g_application_run (application=0x514000000940 [ThunarApplication], argc=<optimized out>, argv=0x7fffffffe4c8) at ../glib/gio/gapplication.c:2712
#22 0x0000555555a73724 in main (argc=2, argv=0x7fffffffe4c8) at main.c:86
Additional information
I was able to trigger the same critical with a commit before all my leak fixes (b76bcb41), so I don't think I introduced a regression.