racket / racket/gui

the-clipboard cannot be cleared, or set at the end of a program.

Open
#306 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 system clipboard the-clipboard cannot be cleared by sending it an empty string. And as far as I can tell, there is no clear-clipboard-string procedure available.

Also, if the clipboard is set using set-clipboard-string at the end of a program, it will not set the clipboard unless an extra (sleep 1) is inserted after.

This happens on Linux X11.

#lang racket/base

(require racket/class)
(require racket/gui/base)

;; This works.
(send the-clipboard set-clipboard-string "test" (current-seconds))
(sleep 1)

;; Problem 1: doesn't clear the clipboard
(send the-clipboard set-clipboard-string "" (current-seconds))
(sleep 1)

;; Problem 2: Clipboard not set without an extra sleep
(send the-clipboard set-clipboard-string "test2" (current-seconds))
;; (sleep 1) ;shouldn't need this

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 two cases in the issue's Racket snippet using the-clipboard and set-clipboard-string on Linux X11. Then trace the implementation behind those entry points and any existing clipboard tests. Done means an empty string clears the clipboard and a final clipboard update persists without an added sleep.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.