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] On Windows, set name of Window Class, closes #7498 #7518

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

geraudloup
Copy link

@geraudloup geraudloup commented Jul 28, 2023

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?

  • Bugfix
  • Feature
  • Docs
  • New Binding issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes, and the changes were approved in issue #___
  • No

Checklist

  • When resolving issues, they are referenced in the PR's title (e.g fix: remove a typo, closes #___, #___)
  • A change file is added if any packages will require a version bump due to this PR per the instructions in the readme.
  • I have added a convincing reason for adding this feature, if necessary

Other information

This feature depends on an evolution of Tao, which has been already merged today by @amrbashir : tauri-apps/tao#770

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
@geraudloup geraudloup requested a review from a team as a code owner July 28, 2023 18:26
Copy link
Member

@amrbashir amrbashir left a 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.

Comment on lines +3 to +4
"tauri-runtime-wry": 'minor:feat'
"tauri-runtime": 'minor:feat'
Copy link
Member

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.

Comment on lines +973 to +982
#[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
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
#[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.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/// - **Linux / iOS / Android:** Unsupported.
/// - **macOS / Linux / iOS / Android:** Unsupported.

Comment on lines +975 to +976
#[serde(default = "default_window_classname")]
pub window_classname: String,
Copy link
Member

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>

Comment on lines +70 to +72
[patch.crates-io]
tao = {git = "https://github.com/geraudloup/tao"}

Copy link
Member

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.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/// - **Linux / iOS / Android:** Unsupported.
/// - **macOS / Linux / iOS / Android:** Unsupported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

None yet

2 participants