-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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] On Windows, set name of Window Class, closes #7498 #7518
base: dev
Are you sure you want to change the base?
Conversation
allow to customize it instead of current value hard coded "Window Class"
allow to customize the window class name instead of current value hard coded "Window Class" * feat: add window_classname, closes tauri-apps#7498 * add changes file * Update core/tauri-config-schema/schema.json * Update tooling/cli/schema.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for you contribution, there is a few changes needed before I can merge this.
"tauri-runtime-wry": 'minor:feat' | ||
"tauri-runtime": 'minor:feat' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove these two and split the other two bumps into two change files.
#[cfg(windows)] | ||
fn window_classname<S: Into<String>>(mut self, window_classname: S) -> Self { | ||
self.inner = self.inner.with_window_classname(window_classname); | ||
self | ||
} | ||
|
||
#[cfg(not(windows))] | ||
fn window_classname<S: Into<String>>(self, _window_classname: S) -> Self { | ||
self | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#[cfg(windows)] | |
fn window_classname<S: Into<String>>(mut self, window_classname: S) -> Self { | |
self.inner = self.inner.with_window_classname(window_classname); | |
self | |
} | |
#[cfg(not(windows))] | |
fn window_classname<S: Into<String>>(self, _window_classname: S) -> Self { | |
self | |
} | |
fn window_classname<S: Into<String>>(mut self, _window_classname: S) -> Self { | |
#[cfg(windows)] | |
{ | |
self.inner = self.inner.with_window_classname(_window_classname); | |
} | |
self | |
} |
/// | ||
/// ## Platform-specific | ||
/// | ||
/// - **Linux / iOS / Android:** Unsupported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// - **Linux / iOS / Android:** Unsupported. | |
/// - **macOS / Linux / iOS / Android:** Unsupported. |
#[serde(default = "default_window_classname")] | ||
pub window_classname: String, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of providing a default, lets change this to an Option<String>
[patch.crates-io] | ||
tao = {git = "https://github.com/geraudloup/tao"} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove and use the latest tao version
/// | ||
/// ## Platform-specific | ||
/// | ||
/// - **Linux / iOS / Android:** Unsupported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// - **Linux / iOS / Android:** Unsupported. | |
/// - **macOS / Linux / iOS / Android:** Unsupported. |
allow to customize it instead of current value hard coded "Window Class" for all Tauri windows...
From #7498 : Currently, on Windows, all app windows created by tauri have the same class named "Window Class", it would be neet to allow for customization of the Windows' window class name.
One use case: some windows custom hotkey managers leverage window class names to select windows...
Non breaking, since the default value passed corresponds to the previous value that was hard-coded.
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
Checklist
fix: remove a typo, closes #___, #___
)Other information
This feature depends on an evolution of Tao, which has been already merged today by @amrbashir : tauri-apps/tao#770