Skip to content

Commit

Permalink
Merge pull request #2059 from unxed/minor-fix
Browse files Browse the repository at this point in the history
Better detect wayland on WSL
  • Loading branch information
elfmz committed Mar 11, 2024
2 parents 627f877 + a568761 commit 010f994
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions WinPort/src/Backend/TTY/TTYBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,9 @@ void TTYBackend::ReaderThread()
// disable xi on Wayland as it not work there anyway and also causes delays
const char *xdg_st = getenv("XDG_SESSION_TYPE");
bool on_wayland = (xdg_st && strcasecmp(xdg_st, "wayland") == 0);
char *wayland_display = getenv("WAYLAND_DISPLAY");

_ttyx = StartTTYX(_full_exe_path, !strstr(_nodetect, "xi") && !on_wayland);
_ttyx = StartTTYX(_full_exe_path, !strstr(_nodetect, "xi") && !on_wayland && !wayland_display);
}
if (_ttyx) {
if (!_ext_clipboard) {
Expand Down Expand Up @@ -302,7 +303,8 @@ void TTYBackend::ReaderLoop()

// Enable esc expiration on Wayland as Xi not work there
const char *xdg_st = getenv("XDG_SESSION_TYPE");
if ((xdg_st && strcasecmp(xdg_st, "wayland") == 0) && !_esc_expiration) {
char *wayland_display = getenv("WAYLAND_DISPLAY");
if (!_esc_expiration && ((xdg_st && strcasecmp(xdg_st, "wayland") == 0) || wayland_display)) {
_esc_expiration = 100;
}

Expand Down

0 comments on commit 010f994

Please sign in to comment.