11@file:OptIn(
2- ExperimentalTrayAppApi ::class ,
32 ExperimentalTransitionApi ::class ,
43 InternalAnimationApi ::class ,
54)
@@ -51,6 +50,7 @@ import dev.nucleusframework.composenativetray.utils.MenuContentHash
5150import dev.nucleusframework.composenativetray.utils.PersistentAnimatedVisibility
5251import dev.nucleusframework.composenativetray.utils.TrayScreenGeometry
5352import dev.nucleusframework.composenativetray.utils.debugln
53+ import dev.nucleusframework.composenativetray.utils.errorln
5454import dev.nucleusframework.composenativetray.utils.getTrayWindowPosition
5555import dev.nucleusframework.composenativetray.utils.getTrayWindowPositionForInstance
5656import dev.nucleusframework.composenativetray.utils.isMenuBarInDarkMode
@@ -123,7 +123,6 @@ private val defaultVerticalOffset =
123123
124124// --------------------- Public API (overloads) ---------------------
125125
126- @ExperimentalTrayAppApi
127126@Composable
128127fun NucleusApplicationScope.TrayApp (
129128 icon : ImageVector ,
@@ -179,7 +178,6 @@ fun NucleusApplicationScope.TrayApp(
179178 )
180179}
181180
182- @ExperimentalTrayAppApi
183181@Composable
184182fun NucleusApplicationScope.TrayApp (
185183 icon : Painter ,
@@ -227,7 +225,6 @@ fun NucleusApplicationScope.TrayApp(
227225}
228226
229227/* * Painter on Windows, ImageVector on macOS/Linux */
230- @ExperimentalTrayAppApi
231228@Composable
232229fun NucleusApplicationScope.TrayApp (
233230 windowsIcon : Painter ,
@@ -297,7 +294,6 @@ fun NucleusApplicationScope.TrayApp(
297294 }
298295}
299296
300- @ExperimentalTrayAppApi
301297@Composable
302298fun NucleusApplicationScope.TrayApp (
303299 icon : DrawableResource ,
@@ -341,7 +337,6 @@ fun NucleusApplicationScope.TrayApp(
341337 )
342338}
343339
344- @ExperimentalTrayAppApi
345340@Composable
346341fun NucleusApplicationScope.TrayApp (
347342 windowsIcon : DrawableResource ,
@@ -414,17 +409,16 @@ fun NucleusApplicationScope.TrayApp(
414409// --------------------- Core implementation (Tao backend only) ---------------------
415410
416411/* *
417- * Tray icon + anchored popup. Runs exclusively on the Nucleus Tao backend —
418- * call it inside `nucleusApplication( backend = NucleusBackend.Tao)` (or
419- * `Auto` with ` decorated-window-tao` on the classpath) .
412+ * Tray icon + anchored popup. Runs exclusively on the Nucleus Tao backend,
413+ * which the `Auto` backend selects automatically once the
414+ * `decorated-window-tao` module is on the classpath.
420415 *
421416 * On Windows + macOS the popup body is hosted in a standalone per-pixel
422417 * transparent, non-activating native panel — no backing window exists anywhere
423418 * (nothing in the taskbar/Dock, Alt-Tab or the Start task view). On Linux the
424419 * popup is a regular undecorated Tao window (opaque): no cross-WM transparency
425420 * equivalent exists.
426421 */
427- @ExperimentalTrayAppApi
428422@Composable
429423fun NucleusApplicationScope.TrayApp (
430424 iconContent : @Composable () -> Unit ,
@@ -446,10 +440,13 @@ fun NucleusApplicationScope.TrayApp(
446440 menu : (TrayMenuBuilder .() -> Unit )? = null,
447441 content : @Composable () -> Unit ,
448442) {
449- require(backend == NucleusBackend .Tao ) {
450- " TrayApp requires the Tao window backend. Launch with " +
451- " nucleusApplication(backend = NucleusBackend.Tao) and ship the " +
452- " nucleus.decorated-window-tao module."
443+ if (backend != NucleusBackend .Tao ) {
444+ errorln {
445+ " TrayApp requires the Tao window backend. Launch with " +
446+ " nucleusApplication() and ship the " +
447+ " nucleus.decorated-window-tao module."
448+ }
449+ return
453450 }
454451
455452 // Linux gates on runtime availability: the panel is a raw X11 window,
0 commit comments