Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clipboard fixes/improvements #405

Merged
merged 3 commits into from
Jun 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Clipboard: Don't use "text/plain"
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 committed Jun 16, 2024
commit d9b07fcc5061e9c5bf93bf135c626c0fb640a580
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
Loading