最大化窗口后,调用 SDL_SetWindowSize 外层窗口大小没有变小。 在SDL中,当你最大化一个窗口后,再调用 SDL_SetWindowSize 函数尝试改变窗口大小,可能会发现外层窗口的大小并没有如预期那样变小。这是因为窗口在最大化状态下,其大小是由系统控制的,而不是由SDL库直接控制的。 原因分析 窗口状态:当窗口处于最大化状态时
However, SDL is given no chance to process the ConfigureNotify between the SDL SetWindowFullScreen call and the SetWindowSize call. The SetWindowSize call will then perform what should be a no-op move to where SDL thinks the window already is, in an attempt to to encourage the WM to pr...
window.event == SDL_WINDOWEVENT_SIZE_CHANGED)) { SDL_SetWindowSize(window, e.window.data1, e.window.data2); } if(e.type == SDL_QUIT) { SDL_Quit(); return 0; } } } I'm not really sure if this issue would belong here, as this really is the product of dubious code, so ...
2)多屏幕下单实例窗口,当父窗口移动到其它屏幕时,单实例窗口再次弹出时,位置才更新到父窗口屏幕。发...
Windows created with SDL2 which have a SDL_WINDOW_RESIZABLE flag and no SDL_SetWindowMinimumSize() that requires them to do so, shouldn't ever spawn with parts cut off. Sadly, this happens anyway at least with the wayland video driver (I haven't tested any other). This seems to mean...
Workaround is that I call SDL_SetWindowSize() right after the SDL_SetWindowDisplayMode(). Then the size changes immediately. #include "SDL.h" #include #include int main(int argc, char* argv[]) { SDL_Init(SDL_INIT_EVERYTHING);