-
Notifications
You must be signed in to change notification settings - Fork 15
Split TrayApp into a separate composenativetray-app module (#418) #419
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
Open
kdroidFilter
wants to merge
5
commits into
master
Choose a base branch
from
feat/split-trayapp-module
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c212612
feat: split TrayApp into a separate composenativetray-app module (#418)
kdroidFilter e16e01d
refactor: move geometry/positioning to tray-app, distinct package, no…
kdroidFilter 31585bb
refactor: move getTrayPosition + TrayPosition enum into tray-app
kdroidFilter 523c00d
Merge remote-tracking branch 'origin/master' into feat/split-trayapp-…
kdroidFilter 26c10e3
build(tray-app): sign publications only when the in-memory key is pre…
kdroidFilter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,4 +30,5 @@ dependencyResolutionManagement { | |
| } | ||
| } | ||
|
|
||
| include(":tray-app") | ||
| include(":demo") | ||
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can it be replaced with the
core-runtimeinstead?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NucleusApplicationScope— the receiver of everyTray(...)overload — is defined innucleus-application, so we can't type againstcore-runtimewithout a breaking API change. The dependency is also effectively free: you can't callTraywithout already being insidenucleusApplication {}. The heavy part from #418 (decorated-window-tao) is not pulled transitively — it'scompileOnlyinnucleus-applicationand now lives only incomposenativetray-app.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens for applications that are not using "NucleusApplication"?
Previously, this was based on the Compose application scope, which made it available to any Compose application. From what I can see, "NucleusApplication" does not provide any additional behavior here (the receiver is unused). Unlike the Compose default tray implementation, which requires access to "awt.Window", the creation logic in this library is already handled on the native side and does not require this receiver.
Using the Nucleus application scope seems to only introduce the dependency itself. This is not a small dependency either, as it pulls in a large part of the Nucleus framework (window decoration, styles, graalvm and other related components), even for applications that do not use those features.
Would it be possible to keep this independent from "NucleusApplication"? Otherwise, applications that do not use Nucleus would need to add a dependency that they cannot actually use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The old implementation of TrayApp was based on a massive amount of AWT hacks—code that was highly burdensome to maintain—and despite that, there were still bugs that seemed impossible to resolve. The reason I created my own backend is that I could no longer stand all those AWT hacks I had to deal with on a daily basis. Today's TrayApp implementation has been entirely rewritten and can only function with the Tao backend from Nucleus. I am not forcing the use of my backend, but indeed, others of my libraries—like Compose Media Player—will eventually only work with my backend because it allows me to reduce code complexity by a factor of 10.
I prefer maintaining my own backend with a clean, modern implementation rather than tons of hacks, because AWT is an aging, low-performance framework that hasn't been updated in at least 15 years. The core, however, will continue to function, which is all that is expected from a tray library. TrayApp is a very specific implementation meant solely for creating JetBrains Toolbox-style applications.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation. Just to make sure I understand correctly:
Does this mean the basic "@composable Tray" (not the TrayApp) in v2.0.0 implementation actually depends on the Tao backend at runtime? In other words, if "NucleusApplicationScope" (or the Tao backend) is not present, the basic "Tray" won't work and will fail at runtime. Is that why the "NucleusApplicationScope" receiver remains in the core module, even though it isn't used directly?
My original assumption was that "NucleusApplication" was just an unused receiver, so I was wondering whether it was really necessary to pull a dependency for an unused receiver.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, my bad, Yes, I haven't finished this PR yet, but once it's merged, even the simple tray won't use NucleusApplicationReceiver anymore and can be used without Nucleus."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to hear that. looking forward to the new version🔥