Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_window.c
| Context not available. | |||||
| /* store actual window size in blender window */ | /* store actual window size in blender window */ | ||||
| bounds = GHOST_GetClientBounds(win->ghostwin); | bounds = GHOST_GetClientBounds(win->ghostwin); | ||||
| win->sizex = GHOST_GetWidthRectangle(bounds); | /* GHOST_GetClientBounds can return a zero sized window for minimized windows */ | ||||
| win->sizey = GHOST_GetHeightRectangle(bounds); | /* Only update the size of the window if the bounds are actually valid */ | ||||
| if (GHOST_GetWidthRectangle(bounds) && GHOST_GetHeightRectangle(bounds)) { | |||||
sergey: Should it be more explicit check here? Like
if (GHOST_GetWindowState(win->ghostwin) ==… | |||||
LazyDodoAuthorUnsubmitted Not Done Inline Actionstested with if (GHOST_GetWindowState(win->ghostwin) != GHOST_kWindowStateMinimized) {
...
}and while this works equally well, it might change behavior on platforms that do give sane values for non visible windows. Your call really, i have no strong preference here. LazyDodo: tested with
```
if (GHOST_GetWindowState(win->ghostwin) != GHOST_kWindowStateMinimized) {
... | |||||
sergeyUnsubmitted Not Done Inline ActionsBut why would we want to update size of invisible windows to begin with? :) It's not my call, i'll leave the call to someome more familiar here :P Both ways are fine to me. sergey: But why would we want to update size of invisible windows to begin with? :)
It's not my call… | |||||
brechtUnsubmitted Not Done Inline ActionsWe do a similar test in ghost_event_proc, I prefer to do the same here. /* win32: gives undefined window size when minimized */
if (state != GHOST_kWindowStateMinimized) {brecht: We do a similar test in `ghost_event_proc`, I prefer to do the same here.
```
/* win32: gives… | |||||
| win->sizex = GHOST_GetWidthRectangle(bounds); | |||||
| win->sizey = GHOST_GetHeightRectangle(bounds); | |||||
| } | |||||
| GHOST_DisposeRectangle(bounds); | GHOST_DisposeRectangle(bounds); | ||||
| #ifndef __APPLE__ | #ifndef __APPLE__ | ||||
| Context not available. | |||||
Should it be more explicit check here? Like
if (GHOST_GetWindowState(win->ghostwin) == GHOST_kWindowStateMinimized) { ... }Or at least avoid calling GHOST_Get{Width,Height}Rectangle twice.