tauri-nspanel icon indicating copy to clipboard operation
tauri-nspanel copied to clipboard

NSPanel Cursor Hover effect and keep animations

Open moralespanitz opened this issue 8 months ago • 5 comments

Hi, is it possible to achieve the same effect? It works perfectly with native Swift, but it's not working with tauri-nspanel. Any solution? For tauri implementation I need to click to apply effects, because the panel "did resign key window" @ahkohd

Image

moralespanitz avatar Mar 19 '25 08:03 moralespanitz

In Electron, it works without clicking the panel to start the effect. (It's a hover)

https://www.electronjs.org/docs/latest/api/structures/base-window-options

https://github.com/electron/electron/blob/273baf4ec2c95a399468aa0cb170d609046fffba/shell/browser/ui/cocoa/electron_ns_panel.mm#L4

@ahkohd

moralespanitz avatar Mar 20 '25 14:03 moralespanitz

Hey! Def should be able to do something like this. Been discussing this with the cap team. Currently, we use a fake window and check if the mouse position is within that window to focus on the NSPanel.

Suboptimal, especially when electron's already doing it - it seems pretty straightforward.

Here's Cap's fake_window.rs implementation.

thisislvca avatar Mar 27 '25 10:03 thisislvca

@thisislvca I sensed a PR solution https://github.com/ahkohd/tauri-nspanel/pull/80

moralespanitz avatar Mar 29 '25 15:03 moralespanitz

@thisislvca I sensed a PR solution https://github.com/ahkohd/tauri-nspanel/pull/80

Will test soon. Does it require any specific quirks/workarounds or does it just work the same as in electron

thisislvca avatar Mar 29 '25 15:03 thisislvca

I have seen PR #80, but I can't merge it into v2; it needs to be its own separate branch. v2-mouse-hover

ahkohd avatar Mar 29 '25 15:03 ahkohd

[email protected] adds support for this feature! you can test it now: https://github.com/ahkohd/tauri-nspanel/tree/v2.1/examples/hover_activate

ahkohd avatar Jul 20 '25 22:07 ahkohd