Skip to content
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

Fixes kunkunsh/kunkun#104 #105

Closed
wants to merge 4 commits into from
Closed

Conversation

alpha-og
Copy link

@alpha-og alpha-og commented Feb 13, 2025

Fixes issue #104 and floating behavior works as expected after tweaks to the window configuration in tauri.conf.json and updated client body transparency with some caveats
image

Caveats

  • window may not be visible on first startup if the process is blocked before the UI is rendered (window becomes visible after the blocking task is completed)
  • pages that rely on the window being non-transparent appears with a transparent background

@HuakunShen
Copy link
Member

I didn't understand this PR. You disabled decorations and made the window transparent.
How does this affect tiling?
I haven't used aerospace. What is the expected behavior?

@HuakunShen
Copy link
Member

image
It has fully transparent window on load.

@HuakunShen
Copy link
Member

The transparent window seems to only happen in the on boarding process.
image
To reproduce, you can change the onBoarded field to false in the config file at ~/Library/Application\ Support/sh.kunkun.desktop/kk-config.json

@HuakunShen
Copy link
Member

image

The preference also becomes transparent.

@HuakunShen
Copy link
Member

1a6a8e1
This seems to fix the transparency problem.

@HuakunShen
Copy link
Member

I don't think setting decorations to false is a good solution.
This is the sidebar of the settings page.
image
All the pages will have sharp corners, I don't want to set border radius for every page.

@alpha-og
Copy link
Author

I didn't understand this PR. You disabled decorations and made the window transparent. How does this affect tiling? I haven't used aerospace. What is the expected behavior?

From what I understand, disabling decorations causes the window to no longer behave or identify as a regular macOS window (which aerospace uses to tile windows). Similar behavior can be seen in recent developments like Ghostty (it is not a one-to-one reproduction of this behavior, but is similar). The workaround that is possible from the end-user's side is to add a window rule in aerospace's config to explicitly float it (not sure if this is a good idea for UX though since launchers are expected to float out of the box)

@HuakunShen
Copy link
Member

HuakunShen commented Feb 14, 2025

Found an issue tauri-apps/tauri#2801

I have also seen discussion saying a regular window needs to be converted into a nspanel

Maybe this will be useful https://github.com/ahkohd/tauri-nspanel

@alpha-og
Copy link
Author

alpha-og commented Feb 14, 2025

Yeah, it needs to behave as a native component to be truly seamless and not result in cascading changes. I do however have a working version of this behavior that works exactly as intended (see below image). The key difference is that, the body does not have any styles applied and i have a wrapper component (within the body) that applies the required rounded corners and background color. Code for this is available at https://github.com/alpha-og/fin
Screenshot 2025-02-14 at 7 23 33 PM

@HuakunShen
Copy link
Member

https://github.com/srsholmes/yal/blob/2a689b7c076a75584fdb58ab46c96aaa87768191/apps/yal/src-tauri/tauri.conf.json#L151
Just discovered this repo. It's also using decorations: false.
I will try this again and do more research to see if NSPanel is a better solution.

@HuakunShen
Copy link
Member

This PR #129 may solve the aerospace error by setting mac window's activation policy.

app.set_activation_policy(ActivationPolicy::Accessory);

I tried it with aerospace, it isn't affected by aerospace.

The PR still has some cross-platform compatibility bugs.

@alpha-og
Copy link
Author

Yeah, setting activation policy might be a way to achieve the NSPanel like behavior atleast partially and also remove the dock icon

@HuakunShen
Copy link
Member

#189

@HuakunShen HuakunShen closed this Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants