Skip to content
Snippets Groups Projects
Commit e61a1aa6 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Use XDG_ENVIRONMENT_TYPE to switch to CLIPBOARD

It appears that XDG_ENVIRONMENT_TYPE will always equal "wayland"
when XWayland is in use, so when we see that, switch to CLIPBOARD
instead of PRIMARY.  This should fix WSL and ChromeOS, and be
irritating on GNOME, so it's a win all around.
parent e383b11c
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #4500 passed
......@@ -327,6 +327,7 @@ initialize_atoms(void)
Atom atom;
struct AtomDef *ad;
long offset;
const char *evar;
supported_standards |= (1 << UTF8_ATOM);
supported_standards |= (1 << ICCCM_ATOM);
......@@ -424,10 +425,15 @@ initialize_atoms(void)
}
/*
* ChromeOS doesn't do anything reasonable with PRIMARY...
* Hack in use of CLIPBOARD instead.
* Wayland sucks, use CLIPBOARD instead of PRIMARY
* This will annoy users in Wayland environments where
* PRIMARY is properly supported (apparently GNOME)
* but GNOME is why I'm not writing a Wayland bakend
* right now anyway (no server-side decorations) so
* they can suck it.
*/
if (wm_wm_name != NULL && strcmp(wm_wm_name, "Sommelier") == 0) {
evar = getenv("XDG_SESSION_TYPE");
if (evar && strcmp(evar, "wayland")) {
if (A(CLIPBOARD) != None)
copy_paste_selection = A(CLIPBOARD);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment