! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
xfce4-appfinder sets DISPLAY incorrectly for child applications in a Wayland ...
Status:
RESOLVED: MOVED
Product:
Libxfce4ui
Component:
General

Comments

Description PMo_ 2019-08-22 05:07:01 CEST
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.
Comment 1 Andre Miranda editbugs 2019-08-24 03:09:56 CEST
Created attachment 8951 
diff

Sorry, I'm unable to test the attached diff, perhaps can you apply it and build session from source?
Comment 2 PMo_ 2019-08-24 23:32:19 CEST
I applied the patch, uninstalled my system `xfce4-session`, and ran `make install`.
No change. It looks like that setenv line was a false positive, since `xfce4-session` is never
launched from `xfconfd`. There still may be something here, but it's not related to this.

I have some more info I could share, but it will probably muddy the waters. My issue was
with appfinder to begin with. Should I reopen/transfer this to xfce4-appfinder and ask for
debug instructions there?


Something else I found: `exo-open --launch TerminalEmulator` will also set `DISPLAY=wayland-0`
overwriting `DISPLAY=:1`. However, this looks like a separate issue: there is a `g_setenv("DISPLAY"...`
in exo.
Comment 3 PMo_ 2019-08-25 07:32:10 CEST
Created attachment 8955 
libxfce4ui xfce-spawn patch, removing DISPLAY setting

DO NOT MERGE

Removes existing functionality which happens to do the wrong thing on wayland,
For demonstration/explanation only.
Comment 4 PMo_ 2019-08-25 07:34:48 CEST
I have confirmed that this patch to libxfce4ui fixes my problem.
Comment 5 Andre Miranda editbugs 2019-08-26 00:58:54 CEST
Created attachment 8959 
wayland-support.diff

An attempt to skip that code path under wayland.
Comment 6 PMo_ 2019-08-26 13:44:03 CEST
Built and confirmed working on my end, thank you.
Comment 7 Git Bot editbugs 2020-05-25 23:02:44 CEST
-- GitLab Migration Automatic Message --

This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/xfce/libxfce4ui/-/issues/13.

Please create an account or use an existing account on one of our supported OAuth providers. 

If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests

Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev

Bug #15865

Reported by:
PMo_
Reported on: 2019-08-22
Last modified on: 2020-05-25

People

Assignee:
Xfce Bug Triage
CC List:
1 user

Version

Version:
4.12.1

Attachments

diff (822 bytes, patch)
2019-08-24 03:09 CEST , Andre Miranda
no flags
libxfce4ui xfce-spawn patch, removing DISPLAY setting (812 bytes, patch)
2019-08-25 07:32 CEST , PMo_
no flags
wayland-support.diff (2.11 KB, patch)
2019-08-26 00:58 CEST , Andre Miranda
no flags

Additional information