close
Skip to content

Added set_minimized and set_position to Window#1292

Merged
cart merged 4 commits into
bevyengine:masterfrom
Toniman575:window-minimize-position
Jan 25, 2021
Merged

Added set_minimized and set_position to Window#1292
cart merged 4 commits into
bevyengine:masterfrom
Toniman575:window-minimize-position

Conversation

@Toniman575
Copy link
Copy Markdown
Contributor

No description provided.

@bjorn3
Copy link
Copy Markdown
Contributor

bjorn3 commented Jan 23, 2021

Wayland itself doesn't have a way to set a global position of a window. This is because it was made with the idea that a screen could have arbitrary shapes. Some compositors do provide an extension to set the global position, but this is not something you can depend on. It also doesn't make much sense for tiling compositors I think.

Copy link
Copy Markdown
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

This is useful functionality, and the code quality and comments look good.

A shame about the limited functionality on some platforms, but I think that supporting this on the platforms that do allow it is a clear improvement.

Comment thread crates/bevy_window/src/window.rs Outdated
Toniman575 and others added 3 commits January 24, 2021 14:38
Removed `WindowDescriptor` addition, because winit does not allow setting the position on window creation.
Also changed position in `Window` to an `Option` for the same reason.
@cart
Copy link
Copy Markdown
Member

cart commented Jan 25, 2021

Looks good to me. I just pushed a change that sets the position immediately on construction. This prevents the value from being None on the first schedule run.

@cart cart merged commit 32acbfb into bevyengine:master Jan 25, 2021
@cart
Copy link
Copy Markdown
Member

cart commented Jan 25, 2021

I still included Option because some platforms don't support window position.

Although actually we could just treat that as 0,0 and call it a day. That would make the api easier to consume. Feel free to follow up if you're interested 😄

@Toniman575 Toniman575 deleted the window-minimize-position branch January 25, 2021 11:35
rparrett pushed a commit to rparrett/bevy that referenced this pull request Jan 27, 2021
Added `set_minimized` and `set_position` to `Window`
@DJMcNab
Copy link
Copy Markdown
Member

DJMcNab commented Jul 6, 2021

@Toniman20 please respond in #2373 for the relicense to MIT/Apache 2.0. Thanks!

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.

5 participants