Skip to content

Add the ability to configure mac-os specific properties to WindowConfig#457

Merged
dzhou121 merged 3 commits into
lapce:mainfrom
timboudreau:mac_os_windows
May 27, 2024
Merged

Add the ability to configure mac-os specific properties to WindowConfig#457
dzhou121 merged 3 commits into
lapce:mainfrom
timboudreau:mac_os_windows

Conversation

@timboudreau

@timboudreau timboudreau commented May 22, 2024

Copy link
Copy Markdown
Contributor

Rationale: Mac OS supports a number of window features that users of Mac OS applications expect, but which don't make sense as lowest-common-denominator cases.

I am one of the authors of NetBeans, and did all of the initial make it Mac user friendly circa 2002, which was extra difficult due to Java AWT's purity-test that any windowing feature that was not supported by Window, Solaris, Linux and Mac OS had no business being supported by AWT. That significantly worsened the user experience (eventually Apple supported magic "component properties" that made some improvements possible), and is not a mistake you want to imitate.

I've endeavored to make the result minimally invasive to the existing API - all Mac OS specific properties are on a separate struct accessed via a closure, but did ensure that the types are visible on other OS's, so developers creating floem-based apps do not need to litter their code with #[cfg(target_os = "macos")].

Use Case: I have some palette windows that I need more control of the appearance of than is possible without this.

Built and tested on Mac OS and Gentoo Linux without problems.

Comment thread src/app_handle.rs
Rationale: Mac OS supports a number of window features that users of Mac OS applications expect, but
which don't make sense as lowest-common-denominator cases.

I am one of the authors of NetBeans, and did *all* of the initial *make it Mac user friendly* circa 2002,
which was extra difficult due to Java AWT's purity-test that if it were a feature supported by Window,
Solaris, Linux *and* Mac OS then it had no place being supported by AWT.  That significantly worsened
the user experience (eventually Apple supported magic "component properties" that made some improvements
possible), and is not a mistake you want to imitate.

I've endeavored to make the result minimally invasive to the existing API - all Mac OS specific properties are on a separate
`struct` accessed via a closure, but did ensure that the types are *visible* on other OS's, so developers creating floem-based apps
do not need to litter their code with `#[cfg(target_os = "macos")]`.

Use Case: I have some palette windows that I need more control of the appearance of than is possible
without this.

Built and tested on Mac OS *and* Gentoo Linux without problems.
@dominikwilkowski

Copy link
Copy Markdown
Contributor

This is such a great PR. There are some macos specific bugs that need attention here including supporting REOPEN. Appreciate the focus!

@dzhou121 dzhou121 merged commit cd4d3b6 into lapce:main May 27, 2024
@timboudreau timboudreau deleted the mac_os_windows branch May 30, 2024 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants