Comments (16)
Apologies for my delayed response. I wasn't aware of this macOS feature. Could you kindly guide me on how to set it up? I'm eager to troubleshoot the issue. My hunch is that the Panel window level may be higher than that of the Input Method Editor.
from tauri-macos-spotlight-example.
@zhouyangtingwen Will you close this issue? Please explain how to fix this issue so others can learn.
from tauri-macos-spotlight-example.
Before I finish this question, may I ask you one last question?
Now, when the focus leaves the NSPanel window, the NSPanel window will be hidden.
How to prevent the NSPanel from being hidden when the focus leaves the NSPanel window? @ahkohd
from tauri-macos-spotlight-example.
How to prevent the NSPanel from being hidden when the focus leaves the NSPanel window?
Did you ever figure out how to accomplish that? I'm wondering how to listen for
windowWillClose
or something similar, in order to update a different part of an app when the user clicks outside of the NSPanel window. Do you know of a good way to accomplish that @ahkohd ?
You should probably use the Tauri plugin I created., use it to listen to the window_did_resign
event, which fires when the window resigns.
let app_handle: tauri::AppHandle = ....
let delegate = panel_delegate!(MyPanelDelegate {
window_did_become_key,
window_did_resign_key
});
// Listen to when a delegate is called
delegate.set_listener(Box::new(move |delegate_name: String| {
println!("{} was called!", delegate_name);
// See, https://developer.apple.com/documentation/appkit/nswindowdelegate?language=objc
// for an exhaustive list of delegate events.
// emit an event to your window
if delegate_name == "window_did_resign" {
app_handle.get_window("some_window").emit("event_name", ());
}
}));
from tauri-macos-spotlight-example.
from tauri-macos-spotlight-example.
Input Method Editor works well on your window, but it cannot be displayed
from tauri-macos-spotlight-example.
Looking forward to hearing from you, Many thanks๐.
from tauri-macos-spotlight-example.
I'm afraid I don't understand you. Can you provide a screen recording and elaborate more on the problem?
from tauri-macos-spotlight-example.
Excuse me, can this problem be solved?
from tauri-macos-spotlight-example.
Thank you very much. I solved the problem of input method.
But now there is another question: Does the window support corner radius?
Look forward to your reply. Thank you very much.
@ahkohd
from tauri-macos-spotlight-example.
You can add the implementation below here:
The implementation should roughly look like this:
fn set_corner_radius(&self, radius: f64) {
let content_view: id = unsafe { msg_send![self, contentView] };
let _: () = unsafe { msg_send![content_view, wantsLayer] };
let layer: id = unsafe { msg_send![content_view, layer] };
let _: () = unsafe { msg_send![layer, setCornerRadius: radius] };
}
the usage:
panel.set_corner_radius(12.0);
from tauri-macos-spotlight-example.
@ahkohd Thank you very much๐๐. I will.๐
from tauri-macos-spotlight-example.
How to prevent the NSPanel from being hidden when the focus leaves the NSPanel window?
Did you ever figure out how to accomplish that? I'm wondering how to listen for windowWillClose
or something similar, in order to update a different part of an app when the user clicks outside of the NSPanel window. Do you know of a good way to accomplish that @ahkohd ?
from tauri-macos-spotlight-example.
Before I finish this question, may I ask you one last question? Now, when the focus leaves the NSPanel window, the NSPanel window will be hidden. How to prevent the NSPanel from being hidden when the focus leaves the NSPanel window? @ahkohd
from tauri-macos-spotlight-example.
@zhouyangtingwen can we close this issue?
from tauri-macos-spotlight-example.
@zhouyangtingwen can we close this issue?
Sure
from tauri-macos-spotlight-example.
Related Issues (11)
- Resizeable Window HOT 1
- Spotlight w/ file picker upload HOT 6
- Hover is not working on macOS (12.3). HOT 10
- Package as an application? HOT 8
- Dependency Dashboard
- Windows / Linux support ? HOT 1
- Can a solution be provided to prevent the window from stealing focus from the currently active window HOT 47
- Close the application on `escape` key press HOT 5
- [SOLVED] App panicks when using more than one window
- How to prevent the NSPanel from being hidden when the focus leaves the NSPanel window? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tauri-macos-spotlight-example.