Skip to content

Commit

Permalink
steamcompmgr: Advertise UTF8_STRING in clipboard TARGETS.
Browse files Browse the repository at this point in the history
Software respecting ICCCM will ask for TARGETS first before asking for
one of the supported formats. Advertising only STRING will break with
any non-ANSI characters, especially since handle_selection_notify()
process UTF8 only and gamescope only returns UTF8 strings.

This fixes non-ANSI text copied from Firefox / Chrome running on a Steam
deck into any Wine app being a garbled mess.
  • Loading branch information
ivyl authored and misyltoad committed Sep 5, 2024
1 parent d4ca0b9 commit b1886b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/steamcompmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4891,11 +4891,11 @@ handle_selection_request(xwayland_ctx_t *ctx, XSelectionRequestEvent *ev)
{
Atom targetList[] = {
ctx->atoms.targets,
XA_STRING,
ctx->atoms.utf8StringAtom,
};

XChangeProperty(ctx->dpy, ev->requestor, ev->property, XA_ATOM, 32, PropModeReplace,
(unsigned char *)&targetList, 2);
(unsigned char *)&targetList, sizeof(targetList) / sizeof(targetList[0]));
response.xselection.property = ev->property;
response.xselection.target = ev->target;
}
Expand Down

0 comments on commit b1886b8

Please sign in to comment.