stuartlangridge / magnus

A very simple screen magnifier for Ubuntu
MIT License
38 stars 13 forks source link

fix restore_window_metrics to allow downward resizing below last stored size #11

Closed bgarnham closed 3 years ago

bgarnham commented 4 years ago

This is a fix for issue #10. It appears to resolve the issue as the window can always be sized down as low as 300x300 regardless of what size it was when it was last closed. The window also opens to the last saved dimensions, as expected.

stuartlangridge commented 4 years ago

I like the look of this -- if set_size_request to something small followed by resize to the actual size does what we want then it's good. Is there a reason you made min_width and min_height variables? They're only used in one place so they're essentially hardcoded constants anyway, and keeping the code as set_size_request(300, 300); resize(saved_size) would make the changes smaller.

bgarnham commented 4 years ago

I made min_width and min_height so they could be used in two places, restore_window_metrics and start_everything_first_time. The values could be hard coded but it made more sense to me, given that there are two instances of set_size_request, to create variables. What do you think?