Skip to content

Commit

Permalink
Clipboard: Don't use "text/plain"
Browse files Browse the repository at this point in the history
On X11, not all programs offer this target, e.g. some terminals like
XTerm. The target "UTF8_STRING" has worked fine for many years and it is
what dmenu uses.

On Wayland, wl-paste supports the special type "text", which attempts to
autodetect a suitable type (in case there is no exact match for
"text/plain").
  • Loading branch information
vain authored and Cloudef committed Jun 16, 2024
1 parent 5b462ad commit 75122a0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1155,11 +1155,11 @@ bm_menu_run_with_key(struct bm_menu *menu, enum bm_key key, uint32_t unicode)
{
char *paster[2] = {NULL, NULL};
if (key == BM_KEY_PASTE_PRIMARY) {
paster[0] = "wl-paste -t text/plain -p";
paster[1] = "xclip -t text/plain -out";
paster[0] = "wl-paste -t text -p";
paster[1] = "xclip -t UTF8_STRING -out";
} else {
paster[0] = "wl-paste -t text/plain";
paster[1] = "xclip -t text/plain -out -selection clipboard";
paster[0] = "wl-paste -t text";
paster[1] = "xclip -t UTF8_STRING -out -selection clipboard";
}

for (size_t paster_i = 0; paster_i < sizeof paster / sizeof paster[0]; paster_i++) {
Expand Down

0 comments on commit 75122a0

Please sign in to comment.