mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
view: don't try to restore to very small width/height on unmaximize
Thonny (Python IDE made with Tk) may set the window geometry to 1x1 and
maximizes the window before mapping. This set `view->natural_geometry`
to 1x1, so labwc tried to restore the window geometry to it on
unmaximize, causing validation errors in `ssd_update_geometry()` as its
width and height are smaller than `LAB_MIN_VIEW_{WIDTH,HEIGHT}`.
This commit fixes it by not allowing geometries smaller than
`LAB_MIN_VIEW_{WIDTH,HEIGHT}` in `view->natural_geometry`.
This commit is contained in:
parent
3b605b0142
commit
74e1ba72e3
1 changed files with 5 additions and 3 deletions
|
|
@ -841,10 +841,12 @@ view_store_natural_geometry(struct view *view)
|
|||
|
||||
/**
|
||||
* If an application was started maximized or fullscreened, its
|
||||
* natural_geometry width/height may still be zero in which case we set
|
||||
* some fallback values. This is the case with foot and Qt applications.
|
||||
* natural_geometry width/height may still be zero (or very small
|
||||
* values) in which case we set some fallback values. This is the case
|
||||
* with foot and some Qt/Tk applications.
|
||||
*/
|
||||
if (wlr_box_empty(&view->pending)) {
|
||||
if (view->pending.width < LAB_MIN_VIEW_WIDTH
|
||||
|| view->pending.height < LAB_MIN_VIEW_HEIGHT) {
|
||||
set_fallback_geometry(view);
|
||||
} else {
|
||||
view->natural_geometry = view->pending;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue