Winit: Add Window::get_fullscreen() -> bool

Created on 27 Jun 2018  路  4Comments  路  Source: rust-windowing/winit

set_fullscreen takes an Option<WindowId>.
However we dont need to make get_fullscreen() return an Option<WindowId> because we can use get_current_monitor() -> WindowId instead.

The window manager (at least on X11) can set the fullscreen state so just remembering the state in winit will not be enough.

needs discussion api

Most helpful comment

The way I'd want to address this is similar to #208, since:

  • Maximization events are necessary and it would make sense for the fullscreen API to follow the same pattern.
  • There's also a fullscreen button on macOS.
  • I tend to favor events over getters, since people presumably usually only want to know about changes, and only as often as they happen.

So I'd go with WindowEvent::Fullscreen(Option<MonitorId>). However, I'm not opposed to having the getter as well, though I think it really should return Option<MonitorId>, for consistency with set_fullscreen. That also makes it easier to do dumb stuff with combinators.

All 4 comments

The way I'd want to address this is similar to #208, since:

  • Maximization events are necessary and it would make sense for the fullscreen API to follow the same pattern.
  • There's also a fullscreen button on macOS.
  • I tend to favor events over getters, since people presumably usually only want to know about changes, and only as often as they happen.

So I'd go with WindowEvent::Fullscreen(Option<MonitorId>). However, I'm not opposed to having the getter as well, though I think it really should return Option<MonitorId>, for consistency with set_fullscreen. That also makes it easier to do dumb stuff with combinators.

Thanks, that all makes sense.

Are there any WMs you recommend for testing this?

Not sure if your asking me directly? I only use i3.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chrisduerr picture chrisduerr  路  3Comments

chrisduerr picture chrisduerr  路  4Comments

francesca64 picture francesca64  路  5Comments

mistodon picture mistodon  路  4Comments

nvzqz picture nvzqz  路  5Comments