Merged
Conversation
Contributor
Author
|
I also noticed middle clicking a "source code" URL in egui.rs triggers Safari's popup blocker. This is likely the same issue - eframe should run logic headlessly from inside the click handler so it inherits the "user interaction" permissions when processing the click. |
emilk
approved these changes
Nov 10, 2023
| "cut", | ||
| |event: web_sys::ClipboardEvent, runner| { | ||
| runner.input.raw.events.push(egui::Event::Cut); | ||
| runner.logic(); |
Owner
There was a problem hiding this comment.
Suggested change
| runner.logic(); | |
| // In Safari we are only allowed to write to the clipboard during the | |
| // event callback, which is why we run the app logic here and now. | |
| runner.logic(); |
| &document, | ||
| "copy", | ||
| |event: web_sys::ClipboardEvent, runner| { | ||
| runner.input.raw.events.push(egui::Event::Copy); |
Owner
There was a problem hiding this comment.
Suggested change
| runner.input.raw.events.push(egui::Event::Copy); | |
| runner.input.raw.events.push(egui::Event::Copy); | |
| // In Safari we are only allowed to write to the clipboard during the | |
| // event callback, which is why we run the app logic here and now. |
emilk
added a commit
that referenced
this pull request
Nov 24, 2023
* Closes lampsitter/egui_commonmark#21 Follow-up to #3513 Safari only allows access to the clipboard as response to user action, so we need to take an extra logic step right in the event handler.
emilk
added a commit
that referenced
this pull request
Nov 24, 2023
* Follow-up to #3621 and #3513 To work around a Safari limitation, we run the app logic in the event handler of copy, cut, and mouse up and down. Previously the output of that frame was discarded, but in this PR it is now saved to be used in the next requestAnimationFrame. The result is noticeable more distinct clicks on buttons (one more frame of highlight) Bonus: also fix auto-save of a sleeping web app
emilk
pushed a commit
to rerun-io/rerun
that referenced
this pull request
Dec 1, 2023
…d guides (#4300) ### What egui 0.24 will fix the bug where coping from Safari was impossible: - emilk/egui#3513 This PR removes the related warnings in the in-app Getting Started guides. - May be blocked by lampsitter/egui_commonmark#21?? - Blocked by #4111 - Fixes #4292 ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/4300) (if applicable) * [x] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG - [PR Build Summary](https://build.rerun.io/pr/4300) - [Docs preview](https://rerun.io/preview/0a0e58f6c169798c01d1932ecec3fb51cfe6360e/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/0a0e58f6c169798c01d1932ecec3fb51cfe6360e/examples) <!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've tested this on Safari and Chrome on macOS Sonoma 14.0.
Could be improved to only call
event.preventDefault()ifrunner.logic()actually performed a copy, but I don't see a way to get that information out with the current API.