Repository navigation
#144: links and sign-in pages bring the browser in front on Linux - #167
Merged
Merged
Conversation
Every page MailCraft opens (Microsoft's sign-in, consent and approval pages, and every link the window follows) now goes through apps/mailcraft/src/browser.rs. On Linux and FreeBSD the window asks winit for an activation token (xdg-activation under Wayland, startup notification under X11), and xdg-open is started with it in XDG_ACTIVATION_TOKEN and DESKTOP_STARTUP_ID, so that the compositor lets the browser come forward. eframe drops the token event, so the window runs on an event loop of our own there (eframe::create_native) wrapped to catch it. No token within a second, a plain-http(s)-only check failing, $BROWSER set, or xdg-open missing: the page opens the old way. Windows and macOS are unchanged.
Member
Author
|
Held for the owner's hand test on KDE Wayland before merging: it changes how the window's event loop is started on Linux/FreeBSD. Also to review: on a start-up failure the app now exits with code 0; it should exit non-zero. |
# Conflicts: # Cargo.lock
…n token with the latest click KWin brings a program forward only for a token whose request names the user's input; winit 0.30.13 sends none, so the browser was only marked as wanting attention. winit comes from UCS-Care-Group/winit at 0.30.13 with that one change until winit does it itself. A page's opening logs whether it had a token (never its address).
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.
Closes #144
What changes
apps/mailcraft/src/browser.rs. That covers Microsoft's sign-in, consent and admin-approval pages, links in messages, the meeting Join link, contact websites, update/credits pages and egui hyperlinks. egui'sOpenUrloutput is taken out of each frame before eframe would open it itself.xdg-open <url>with the token inXDG_ACTIVATION_TOKENandDESKTOP_STARTUP_ID. eframe ignores winit'sActivationTokenDoneevent, so on these platforms the window runs on our own event loop (eframe::create_native), with a thin wrapper that catches the token and passes everything else through. There is nounsafeand no fork.webbrowser):$BROWSERis setxdg-opencan't be started or failsTests: a fake launcher checks the following:
OpenUrloutput is taken and other commands are left alonexdg-opencommand carries both environment variables and rejects non-web or control-character addressesOwner to check on KDE Plasma (Wayland)