Skip to content

thunar-settings: Fix DISPLAY env var on Wayland

Gaël Bonithon requested to merge Tamaranch/thunar:fix-thunar-settings into master

It's not perfect, but at least a normal thunar-settings launch on Wayland should work instead of crashing right now. And it shouldn't impact usage on X11, unless WAYLAND_DISPLAY is set, which shouldn't be the case.

Backtrace of a crash for info:

Core was generated by `/opt/bin/thunar --daemon'.
Program terminated with signal SIGABRT, Aborted.
#0  0x00007f76cc42683c in ?? () from /usr/lib/libc.so.6
[Current thread is 1 (Thread 0x7f76cb0f1a00 (LWP 44973))]
(gdb) bt
#0  0x00007f76cc42683c in  () at /usr/lib/libc.so.6
#1  0x00007f76cc3d6668 in raise () at /usr/lib/libc.so.6
#2  0x00007f76cc3be4b8 in abort () at /usr/lib/libc.so.6
#3  0x00007f76cc5980ee in g_assertion_message
    (domain=domain@entry=0x7f76ccbad014 "Gdk", file=file@entry=0x7f76ccbc69a4 "../gtk/gdk/gdkwindow.c", line=line@entry=6530, func=func@entry=0x7f76ccbc7740 <__func__.48> "gdk_window_set_cursor_internal", message=message@entry=0x55ac9bc16730 "assertion failed: (!cursor || gdk_window_get_display (window) == gdk_cursor_get_display (cursor))") at ../glib/glib/gtestutils.c:3497
#4  0x00007f76cc5f9180 in g_assertion_message_expr
    (domain=domain@entry=0x7f76ccbad014 "Gdk", file=file@entry=0x7f76ccbc69a4 "../gtk/gdk/gdkwindow.c", line=line@entry=6530, func=func@entry=0x7f76ccbc7740 <__func__.48> "gdk_window_set_cursor_internal", expr=expr@entry=0x7f76ccbc70a0 "!cursor || gdk_window_get_display (window) == gdk_cursor_get_display (cursor)") at ../glib/glib/gtestutils.c:3523
#5  0x00007f76ccb53d4c in gdk_window_set_cursor_internal (cursor=0x55ac9bfe6320, device=0x55ac9b912bd0, window=0x55ac9c1e6110) at ../gtk/gdk/gdkwindow.c:6530
#6  gdk_window_set_cursor_internal (window=0x55ac9c1e6110, device=0x55ac9b912bd0, cursor=0x55ac9bfe6320) at ../gtk/gdk/gdkwindow.c:6522
#7  0x00007f76ccb53e44 in gdk_window_set_cursor (cursor=<optimized out>, window=0x55ac9c1e6110) at ../gtk/gdk/gdkwindow.c:6618
#8  gdk_window_set_cursor (window=window@entry=0x55ac9c1e6110, cursor=<optimized out>) at ../gtk/gdk/gdkwindow.c:6588
#9  0x00007f76ccb54252 in gdk_window_new (parent=<optimized out>, parent@entry=0x55ac9c1dfc40, attributes=attributes@entry=0x7ffca6a92340, attributes_mask=attributes_mask@entry=16)
    at ../gtk/gdk/gdkwindow.c:1530
#10 0x00007f76ccf62490 in gtk_window_realize (widget=0x55ac9bcd58c0) at ../gtk/gtk/gtkwindow.c:7566
#11 0x00007f76cc6da6c0 in g_closure_invoke (closure=0x55ac9b78f580, return_value=0x0, n_param_values=1, param_values=0x7ffca6a925f0, invocation_hint=0x7ffca6a92540) at ../glib/gobject/gclosure.c:832
#12 0x00007f76cc708b7a in signal_emit_unlocked_R.isra.0
    (node=node@entry=0x7ffca6a926c0, detail=detail@entry=0, instance=instance@entry=0x55ac9bcd58c0, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7ffca6a925f0)
    at ../glib/gobject/gsignal.c:3813
#13 0x00007f76cc6f9a42 in signal_emit_valist_unlocked (instance=instance@entry=0x55ac9bcd58c0, signal_id=signal_id@entry=115, detail=detail@entry=0, var_args=var_args@entry=0x7ffca6a92820)
    at ../glib/gobject/gsignal.c:3612
#14 0x00007f76cc6f9c77 in g_signal_emit_valist (instance=0x55ac9bcd58c0, signal_id=115, detail=0, var_args=var_args@entry=0x7ffca6a92820) at ../glib/gobject/gsignal.c:3355
#15 0x00007f76cc6f9d34 in g_signal_emit (instance=instance@entry=0x55ac9bcd58c0, signal_id=<optimized out>, detail=detail@entry=0) at ../glib/gobject/gsignal.c:3675
#16 0x00007f76ccf437a2 in gtk_widget_realize (widget=0x55ac9bcd58c0) at ../gtk/gtk/gtkwidget.c:5523
#17 0x00007f76ccf63e1c in gtk_window_show (widget=0x55ac9bcd58c0) at ../gtk/gtk/gtkwindow.c:6206
#18 0x00007f76cc6da6c0 in g_closure_invoke (closure=0x55ac9b78f9c0, return_value=0x0, n_param_values=1, param_values=0x7ffca6a92ba0, invocation_hint=0x7ffca6a92af0) at ../glib/gobject/gclosure.c:832
#19 0x00007f76cc708b7a in signal_emit_unlocked_R.isra.0
    (node=node@entry=0x7ffca6a92c70, detail=detail@entry=0, instance=instance@entry=0x55ac9bcd58c0, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7ffca6a92ba0)
    at ../glib/gobject/gsignal.c:3813
#20 0x00007f76cc6f9a42 in signal_emit_valist_unlocked (instance=instance@entry=0x55ac9bcd58c0, signal_id=signal_id@entry=111, detail=detail@entry=0, var_args=var_args@entry=0x7ffca6a92dd0)
    at ../glib/gobject/gsignal.c:3612
#21 0x00007f76cc6f9c77 in g_signal_emit_valist (instance=0x55ac9bcd58c0, signal_id=111, detail=0, var_args=var_args@entry=0x7ffca6a92dd0) at ../glib/gobject/gsignal.c:3355
#22 0x00007f76cc6f9d34 in g_signal_emit (instance=instance@entry=0x55ac9bcd58c0, signal_id=<optimized out>, detail=detail@entry=0) at ../glib/gobject/gsignal.c:3675
#23 0x00007f76ccf4432b in gtk_widget_show (widget=0x55ac9bcd58c0) at ../gtk/gtk/gtkwidget.c:4852
#24 gtk_widget_show (widget=0x55ac9bcd58c0) at ../gtk/gtk/gtkwidget.c:4825
#25 0x000055ac99d8cfc8 in thunar_dbus_service_display_preferences_dialog (object=0x55ac9b7154f0, invocation=0x7f76bc0023f0, display=<optimized out>, startup_id=0x55ac9bf2dd90 "", dbus_service=<optimized out>)
    at thunar-dbus-service.c:725
#26 0x000055ac99d74523 in _g_dbus_codegen_marshal_BOOLEAN__OBJECT_STRING_STRING
    (closure=0x55ac9b717f60, return_value=0x7ffca6a93080, param_values=0x55ac9b880900, marshal_data=0x0, invocation_hint=<optimized out>, n_param_values=<optimized out>) at thunar-dbus-service-infos.c:443
#27 0x00007f76cc6da6c0 in g_closure_invoke (closure=0x55ac9b717f60, return_value=0x7ffca6a93080, n_param_values=4, param_values=0x55ac9b880900, invocation_hint=0x7ffca6a93060) at ../glib/gobject/gclosure.c:832
#28 0x00007f76cc708a36 in signal_emit_unlocked_R.isra.0
    (node=<optimized out>, detail=detail@entry=0, instance=instance@entry=0x55ac9b7154f0, emission_return=emission_return@entry=0x7ffca6a93230, instance_and_params=instance_and_params@entry=0x55ac9b880900)
    at ../glib/gobject/gsignal.c:3980
#29 0x00007f76cc6f6a45 in signal_emitv_unlocked (return_value=0x55ac9b880900, detail=0, signal_id=32, instance_and_params=0x55ac9b7154f0) at ../glib/gobject/gsignal.c:3304
#30 g_signal_emitv (instance_and_params=instance_and_params@entry=0x55ac9b880900, signal_id=signal_id@entry=32, detail=detail@entry=0, return_value=return_value@entry=0x7ffca6a93230)
    at ../glib/gobject/gsignal.c:3204
#31 0x000055ac99d7577b in _thunar_dbus_file_manager_skeleton_handle_method_call
    (connection=<optimized out>, sender=<optimized out>, object_path=<optimized out>, interface_name=0x7f76bc0049d0 "org.xfce.FileManager", method_name=0x7f76bc001c20 "DisplayPreferencesDialog", parameters=<optimized out>, invocation=0x7f76bc0023f0, user_data=0x55ac9b7154f0) at thunar-dbus-service-infos.c:5120
#32 0x00007f76cc849063 in g_dbus_interface_method_dispatch_helper (interface=<optimized out>, method_call_func=0x55ac99d755d0 <_thunar_dbus_file_manager_skeleton_handle_method_call>, invocation=0x7f76bc0023f0)
    at ../glib/gio/gdbusinterfaceskeleton.c:618
#33 0x00007f76cc82b198 in call_in_idle_cb (user_data=0x7f76bc0023f0) at ../glib/gio/gdbusconnection.c:5012
#34 0x00007f76cc5d3f19 in g_main_dispatch (context=0x55ac9b6f7270) at ../glib/glib/gmain.c:3476
#35 0x00007f76cc6322b7 in g_main_context_dispatch_unlocked (context=0x55ac9b6f7270) at ../glib/glib/gmain.c:4284
#36 g_main_context_iterate_unlocked.isra.0 (context=context@entry=0x55ac9b6f7270, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4349
#37 0x00007f76cc5d2112 in g_main_context_iteration (context=context@entry=0x55ac9b6f7270, may_block=may_block@entry=1) at ../glib/glib/gmain.c:4414
#38 0x00007f76cc807af6 in g_application_run (application=application@entry=0x55ac9b707f60, argc=argc@entry=2, argv=argv@entry=0x7ffca6a93728) at ../glib/gio/gapplication.c:2577
#39 0x000055ac99d70daf in main (argc=2, argv=0x7ffca6a93728) at main.c:86

Merge request reports

Loading