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

feat(desktop): spawn app where cursor is #129

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

xikxp1
Copy link
Contributor

@xikxp1 xikxp1 commented Feb 16, 2025

This PR addresses #123 and introduces new logic where window follows cursor (like Raycast does). New config entry is present to enable toggling this feature on and off.

For now window is spawned in the middle of current screen. Probably a more sophisticated implementation exists

@HuakunShen
Copy link
Member

Great work! Let me try.

@HuakunShen HuakunShen linked an issue Feb 16, 2025 that may be closed by this pull request
1 task
@HuakunShen
Copy link
Member

HuakunShen commented Feb 18, 2025

CI is failing because of Mac only code. I am trying to fix.

@@ -209,6 +209,7 @@ pub fn run() {
.unwrap();
})
.setup(move |app| {
app.set_activation_policy(ActivationPolicy::Accessory);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad. I think wrapping this up with #[cfg(target_os = "macos")] should be enough. Good thing we have CI now

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already did, fixing another bug from adding the new config field.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also think changing the default showOnCursorPosition value to true is a better.

@HuakunShen
Copy link
Member

HuakunShen commented Feb 18, 2025

The beta build CI just finished. https://github.com/kunkunsh/kunkun/actions/runs/13383208119
Artifact generated.
I tried on Windows. It's not fully working.
I have 2 monitors. If I press hotkey on the secondary screen, it will open the window in bottom left corner.
image
But If I hide it again and reopen it with hotkey the second time on the secondary display, it's in the center of the screen.
@xikxp1 Have you tried on Windows? This didn't happen on Mac for me.

@xikxp1
Copy link
Contributor Author

xikxp1 commented Feb 18, 2025

@xikxp1 Have you tried on Windows? This didn't happen on Mac for me.

I tried on Mac using 2 monitors with different scaling factors. Probably some inconsistencies between platforms. I'll check today

@HuakunShen
Copy link
Member

@xikxp1 Have you tried on Windows? This didn't happen on Mac for me.

I tried on Mac using 2 monitors with different scaling factors. Probably some inconsistencies between platforms. I'll check today

My Ubuntu 24 is also broken after switching from x11 to wayland. So I can't test on Linux for now.

@parkuman
Copy link

just tested out the MacOS 14 beta build, working beautifully!

@HuakunShen
Copy link
Member

HuakunShen commented Feb 22, 2025

just tested out the MacOS 14 beta build, working beautifully!

This PR works for mac but doesn’t work well on windows.

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.

[feat] Make window visible on all workspaces
3 participants