Repository navigation
Add ability to change the min/max size of windows at runtime - #405
Conversation
f46d1c8 to
b333d02
Compare
|
Sorry for hijacking your PR; I was originally planning to just give you a review on the X11 portions, but fixing it turned out to be more involved, and I figured you wouldn't enjoy dealing with that. Since Some other changes:
Note that this still needs to be looked at on Wayland and OSX. While this works fine now on X11, I've found that setting the min/max to the same size tends to permanently disable resizing for me (on XFCE). If I try to change the min/max after the fact, the hints are set correctly according to xwininfo, but the window still can't be resized (occasionally, resizing is re-enabled as expected, but it's very unreliable). However, that doesn't seem to have anything to do with anything introduced here (setting them to the same size during window building causes it to happen as well, it's just we never had a way to try to change it afterwards before), and there's a chance that it's just an issue with my WM. Thus, it would be good for more people to test this on X11. Anyway, thanks for the contribution! |
tomaka
left a comment
There was a problem hiding this comment.
Would be nice to specify what happens when the min/max intersect or when the max is below the min. But since his isn't specified in the builder either, I'm ok with the change as it is.
|
I got a OSX VM running, and it seems like the code works fine. Would it be possible to merge this, once the changelog conflict is resolved? |
|
@Osspial I'm in favor of that, since I don't see getting further review as likely, and both the OS X and Wayland code are straightforward and small enough that I don't see any meaningful risk of introducing technical debt. |
|
Needs a rebase and we're good to go I think. |
|
@tomaka Just rebased. Everything should be good now. |
…ndowing#405) * Add min/max size setting for win32 and wayland backends * Implement dynamic min/max size on macos * Add min/max size setting for x11 * Add empty functions for remaining platforms * Improved min/max size setting for x11 * Added CHANGELOG entry for new min/max methods * Added documentation for new min/max methods * On win32, bound window size to min/max dimensions on window creation * On win32, force re-check of window size when changing min/max dimensions * Fix freeze when setting min and max size
…0, 1). Partially addresses rust-windowing#405.
Initialize resized mask textures to rgba(0, 0, 0, 0), not rgba(0, 0, 0, 1). Partially addresses rust-windowing#405.
Adds the ability to change the minimum and maximum sizes of a window, even after it's been created, with
set_min_dimensionsandset_max_dimensionsfunctions on the Window struct.I've only tested this on Windows, and I'm pretty sure the OSX and Linux code compiles, but it's much harder for me to test them personally than it is to test the Windows code. I'll probably be able to test the Linux code in the next couple of days but I don't think I can test the OSX code personally.