(Wayland) Add toplevel app id - #21982
Conversation
|
Drive-by review from someone who wrote the same patch a couple of hours later and is closing it in favour of this one (#21983) — a few notes that might be useful, take or leave them. Default value. This defaults to Empty string. Unrelated changes. The diff in Naming. Verified the behaviour this fixes on GNOME 49 (Wayland) with |
|
Please read the following Contributor License Agreement (CLA). If you agree with the CLA, please reply with the following: Contributor License AgreementContribution License AgreementThis Contribution License Agreement ( “Agreement” ) is agreed to by the party signing below ( “You” ), 1. Definitions. “Code” means the computer software code, whether in human-readable or machine-executable form, “Project” means any of the projects owned or managed by AvaloniaUI OÜ and offered under a license “Submit” is the act of uploading, submitting, transmitting, or distributing code or other content to any “Submission” means the Code and any other copyrightable material Submitted by You, including any 2. Your Submission. You must agree to the terms of this Agreement before making a Submission to any 3. Originality of Work. You represent that each of Your Submissions is entirely Your 4. Your Employer. References to “employer” in this Agreement include Your employer or anyone else 5. Licenses. a. Copyright License. You grant AvaloniaUI OÜ, and those who receive the Submission directly b. Patent License. You grant AvaloniaUI OÜ, and those who receive the Submission directly or c. Other Rights Reserved. Each party reserves all rights not expressly granted in this Agreement. 6. Representations and Warranties. You represent that You are legally entitled to grant the above 7. Notice to AvaloniaUI OÜ. You agree to notify AvaloniaUI OÜ in writing of any facts or 8. Information about Submissions. You agree that contributions to Projects and information about 9. Governing Law/Jurisdiction. This Agreement is governed by the laws of the Republic of Estonia, and 10. Entire Agreement/Assignment. This Agreement is the entire agreement between the parties, and AvaloniaUI OÜ dedicates this Contribution License Agreement to the public domain according to the Creative Commons CC0 1. Saverin doesn't seem to be a GitHub user. |
Yh sorry about the whitespace changes, my editor was formatting code on save with roslyn.
Agreed to leave this to maintainers' discretion. |
|
You can test this PR using the following package version. |
kekekeks
left a comment
There was a problem hiding this comment.
PR has quite a lot of unrelated formatting/whitespace changes
| FractionalScaleManager = Bind<WpFractionalScaleManagerV1>(1, 1, null); | ||
| Viewporter = Bind<WpViewporter>(1, 1, null); | ||
| TextInputManagerV3 = Bind<ZwpTextInputManagerV3>(1, 1, null); | ||
| WlAppId = platformOptions.AppId; |
There was a problem hiding this comment.
Fallback should be here, I think.
| if (_title != null) | ||
| _xdgTopLevel.SetTitle(_title); | ||
|
|
||
| SetAppId(globals.WlAppId); |
There was a problem hiding this comment.
simplify to direct call on _xdgTopLevel
|
|
||
| private void SetAppId(string? appId) | ||
| { | ||
| var id = string.IsNullOrWhiteSpace(appId) ? Process.GetCurrentProcess().ProcessName : appId; |
There was a problem hiding this comment.
I think we have a precedent of using Assembly.GetEntryAssembly()?.GetName().Name; as WM_CLASS with X11 (that matches desktop-files by StartupWMClass).
Have you checked if wayland is using the same matching mechanism for appid?
There was a problem hiding this comment.
Qt has QGuiApplication::setDesktopFileName API that it uses for app_id.
|
Notes from the API review meeting: (The comments on the internally chosen default are still applicable.) |
What does the pull request do?
Makes the Wayland backend set an app id instead of leaving this unset. An app id is required by freedesktop to load correct taskbar icons and such. Will default to ProcessName the way the x11 backend behaves if not set with WaylandPlatformOptions
What is the current behavior?
Wayland backend leaves app id unset.
What is the updated/expected behavior with this PR?
Wayland backend now sets app id. Will default to the process name if not explicitly set.
How was the solution implemented (if it's not obvious)?
Checklist
Fixed issues
Fixes #21783
New API