Skip to content

xfce4-appfinder sets DISPLAY incorrectly for child applications in a Wayland session.

Submitted by PMo..@..di.net

Assigned to Xfce Bug Triage

Link to original bug (#15865)

Description

Refer #12867. xfce4-terminal should have DISPLAY set to Xwayland's screen number.

Steps to reproduce:

  • Log onto a Sway session (or other Wayland session?)
  • (optional) Launch xfconfd
  • Launch xfce4-appfinder (if xfconfd was not launched: forks xfconfd, which relaunches xfce4-appfinder)
  • Launch a program using xfce4-appfinder

Expected result:

  • The program will have "DISPLAY=<Xwayland's X11 Screen number>" in its environment (For example: ":0" or ":1")

Actual result:

  • The program will have 'DISPLAY=<value of WAYLAND_DISPLAY>' in its environment (For example: "wayland-0")

After digging for anywhere DISPLAY was changed, I found this:

/* pass correct DISPLAY to children, in case of --display in argv */ g_setenv ("DISPLAY", gdk_display_get_name (gdk_display_get_default ()), TRUE);

=== SPECULATION: ===

gdk_display_get_default seems to use WAYLAND_DISPLAY if it exists. Related issue in ibus: https://github.com/ibus/ibus/commit/ffdcc6cd1368143b77e6f535e90974651575b02e I am not well versed in gdk/gtk, so this remains just speculation.

Version: 4.12.1