Skip to content

Conversation

@madsmtm
Copy link
Member

@madsmtm madsmtm commented Sep 5, 2025

Add the following methods to Window:

  • min_surface_size.
  • max_surface_size.
  • is_transparent.
  • is_blurred.
  • window_level.
  • window_icon.
  • content_protected.
  • cursor.

Some of these are not implemented on all platforms yet, I have marked that in their documentation. I it to be a general theme of Window, you should be able to query all the properties that you can set.

Related to #1295 and #3690.

  • Tested on all platforms changed
  • Added an entry to the changelog module if knowledge of this change could be valuable to users
  • Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • Created or updated an example program if it would help users understand this functionality

Implemented properly when it was easy for me, but a lot of places are
stubbed out for now.
@madsmtm madsmtm added the S - api Design and usability label Sep 5, 2025
@madsmtm madsmtm requested a review from MarijnS95 as a code owner September 5, 2025 17:49
Copy link
Member

@daxpedda daxpedda left a comment

Choose a reason for hiding this comment

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

Just documentation nits.

Only checked the core and Web implementation.

/// ## Platform-specific
///
/// - **iOS / Android / Orbital:** Unsupported.
/// - **Web:** Unimplemented, returns `None`.
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
/// - **Web:** Unimplemented, returns `None`.
/// - **Web:** Unimplemented.

I propose if it returns Option, we don't have to specify that it returns None.

///
/// - **iOS / Android:** Unsupported.
fn set_title(&self, title: &str);
/// - **iOS / Android / Web:** 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
/// - **iOS / Android / Web:** Unsupported.
/// - **iOS / Android / Web:** Unsupported. Always returns `false`.

I propose if it returns a bool, we should specify what it returns in case its unsupported or unimplemented.

/// - **iOS / Android:** Unsupported.
fn set_title(&self, title: &str);
/// - **iOS / Android / Web:** Unsupported.
/// - **X11:** Unimplemented, returns `false`.
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
/// - **X11:** Unimplemented, returns `false`.
/// - **X11:** Unimplemented. Returns `false`.

I propose we use two sentences. Was told before by people who know better that in English you don't use commas a whole lot, but what do I know.

///
/// ## Note
///
/// - You shouldn't stop rendering for minimized windows, however you could lower the fps.
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
/// - You shouldn't stop rendering for minimized windows, however you could lower the fps.
/// - To support window previews you should continue rendering minimized windows. However, you could lower the frame rate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S - api Design and usability

Development

Successfully merging this pull request may close these issues.

3 participants