Skip to content
Snippets Groups Projects
Commit a8e1ff3e 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 c9355e62
No related branches found
No related tags found
No related merge requests found
......@@ -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.
Finish editing this message first!
Please register or to comment