mirror of
https://github.com/nishiowo/nishbox
synced 2025-04-21 20:24:39 +00:00
fix window size on windows
This commit is contained in:
parent
5710975dfd
commit
304aa97bea
@ -78,6 +78,7 @@ void _nb_draw_create(nb_draw_t** pdraw) {
|
||||
PFNWGLSWAPINTERVALPROC wglSwapIntervalEXT;
|
||||
RECT rect;
|
||||
int fmt;
|
||||
DWORD style;
|
||||
draw->instance = (HINSTANCE)GetModuleHandle(NULL);
|
||||
if(draw->instance == NULL) {
|
||||
nb_function_log("Failed to get the instance", "");
|
||||
@ -113,6 +114,11 @@ void _nb_draw_create(nb_draw_t** pdraw) {
|
||||
return;
|
||||
}
|
||||
|
||||
SetRect(&rect, 0, 0, draw->width, draw->height);
|
||||
style = (DWORD)GetWindowLongPtr(draw->window, GWL_STYLE);
|
||||
AdjustWindowRect(&rect, style, FALSE);
|
||||
SetWindowPos(draw->window, NULL, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_NOMOVE);
|
||||
|
||||
SetWindowLongPtr(draw->window, GWLP_USERDATA, (LONG_PTR)draw);
|
||||
|
||||
GetClientRect(draw->window, &rect);
|
||||
|
Loading…
x
Reference in New Issue
Block a user