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

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

Open
ghost opened this issue Sep 7, 2023 · 1 comment
Open

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

ghost opened this issue Sep 7, 2023 · 1 comment

Comments

@ghost
Copy link

ghost commented Sep 7, 2023

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
@kengruven
Copy link
Contributor

I can confirm this occurs on Linux, and can report that neither problem is present on macOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant