racket / racket/gui

Clipboard access functions don't return #f as documented

Open
#328 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Racket
Stars
68
Forks
82
PR merge metrics
No merged PRs in 30d

Description

The function get-clipboard-data says:

Gets the current clipboard contents in a specific format, returning #f if the clipboard does not contain data in the requested format.

In practice, on Linux, I can't get it to return #f:

> (require racket/gui)
> (send the-clipboard set-clipboard-string "hello, world" (current-seconds))
> (send the-clipboard get-clipboard-data "image/jpeg" (current-seconds))
#""

I've confirmed that after calling set-clipboard-string, the only types on the clipboard are "COMPOUND_TEXT", "STRING", "TEXT", "text/plain", "text/plain;charset=utf-8", and "UTF8_STRING". I don't know what comparison algorithm it's using for comparing formats, but by any reasonable measure, there's no JPEG image here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Linux example for get-clipboard-data from the issue and compare the result with the documented behavior in the linked clipboard documentation. Trace how the requested format is compared with the available clipboard formats; done means a missing format returns #f rather than an empty byte string.

Written by the indexing model from the issue text.

Assessment

Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.