linebender / glazier

Deprecated Rust Window Creation Library
Apache License 2.0
206 stars 32 forks source link

Support window close / minimize buttons with content in full view #94

Open jrmoulton opened 1 year ago

jrmoulton commented 1 year ago

Currently glazier allows the title bar to be disabled but this also disables the OS native buttons for closing and resizing (and macOS and windows stop treating them as main application windows).

This is fine but it would be nice to be able to configure a the window to have a full content view but still keep the OS native buttons and title_bar.

On macOS this can be done by adding NSWindowStyleMask::NSFullSizeContentViewWindowMask to the style_mask here

and by setting the window.setTitlebarAppearsTransparent_ with true.

I could open a PR for this but I wasn't sure how to name these items and also how to ensure consistency with windows / linux.

jneem commented 1 year ago

I haven't looked too much into this, but I suspect it will be painful on linux, what with the variety of different window decoration behaviors available in different environments. Maybe it's worth thinking about an API for platform-specific extensions? I know this was discussed in druid-shell at some point, although I can't find that discussion right now...

jrmoulton commented 1 year ago

Looks like the backend for Wayland is currently lacking quite a bit of support for window decorations and now glazier just logs a warning. For now I might just throw together a PR for macOS and windows. And then for Wayland I'll just follow the current pattern and just log an error (unless I can figure out out how to make it work)