Open Hupka opened 2 years ago
So according to the commit it's there to make windows resizable when there's no decorations. I would've assumed that you could remove decorations while keeping NSWindowStyleMask::NSResizableWindowMask
?
@lemarier @wusyong and @keiya01 seem to have touched that code, so maybe they have some ideas
I'd like to see this feature implemented. @Hupka Is there any update on this? Or could you provide more hints about how to make this happen?
I have some exciting news! After much experimentation, I finally created a fully functional NSPanel from Tauri's NSWindow
. Please take a look at https://github.com/ahkohd/tauri-macos-spotlight-example/pull/6 for more details. It would be great to get your feedback on this new development.
My next objective is to develop a Tauri plugin, tauri-nspanel
. This plugin will be a valuable tool for creating NSPanels in Tauri's NSWindow, allowing us to streamline the process.
A rough API to convert to NSPanel
might look like this.
#[cfg(target="macos")]
window.to_panel();
Yoyoyo, it's here https://github.com/ahkohd/tauri-nspanel
Hey folks,
I need a feature in Tauri, and I am attempting to work my way upstream through the libraries which Tauri builds upon.
Context
I need Tauri/Tao windows to behave like
NSPanel
in macOS.NSPanel
is not part of thecore-foundation/cocoa
library, wherefore I am working to contribute there (core-foundation/#511). The change is relatively straightforward and has already been tested successfully. 👌🏻I am now investigating how
Tao
is working with thecocoa
crate to instantiate windows. And happened to find a code block from 5 years ago [❗Implemetation today] that seems to actually subclassNSWindow
introducing the classTaoWindow
. For this subclass, the methodscanBecomeMainWindow
andcanBecomeKeyWindow
are overwritten to always return yes. Strangely, this is the default behavior ofNSWindow
🤔 .Q1: Is Tao here actually subclassing NSWindow overwriting default behavior? Or is it just potentially rewriting responses coming from macOS when calling the methods listed there?
Goal
I want to help make the contribution needed to allow Tao to spawn views as either
NSWindow
orNSPanel
.Solution
Because of the questions I wrote about above, it is unclear how to proceed. Early investigations made me consider introducing a new field in
PlatformSpecificWindowBuilderAttributes
to spawn a window in either anNSWindow
orNSPanel
. Theoretically, the code change would be minimal if the underlyingcore-foundation/cocoa
library provides this class.NSPanel
shares all methods ofNSWindow
, wherefore no breaking changes would be introduced.NSPanel
introduces three additional methods which, for the time being, could be just invoked directly on thens_window()
.If I get some guidance on how to conceptually introduce such changes, I'm offering to make the contribution myself. 🤓