Skip to content

Commit 500afa8

Browse files
fix x11 maximized on NET event
1 parent 8ea44d8 commit 500afa8

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

RGFW.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3278,6 +3278,7 @@ void RGFW_windowMaximizedCallback(RGFW_window* win, i32 x, i32 y, i32 w, i32 h)
32783278

32793279
RGFW_event event;
32803280
event.type = RGFW_windowMaximized;
3281+
event.common.win = win;
32813282
RGFW_eventQueuePush(&event);
32823283

32833284
if (RGFW_windowMaximizedCallbackSrc) RGFW_windowMaximizedCallbackSrc(win, x, y, w, h);
@@ -3290,6 +3291,7 @@ void RGFW_windowMinimizedCallback(RGFW_window* win) {
32903291

32913292
RGFW_event event;
32923293
event.type = RGFW_windowMinimized;
3294+
event.common.win = win;
32933295
RGFW_eventQueuePush(&event);
32943296

32953297
if (RGFW_windowMinimizedCallbackSrc) RGFW_windowMinimizedCallbackSrc(win);
@@ -3303,6 +3305,7 @@ void RGFW_windowRestoredCallback(RGFW_window* win, i32 x, i32 y, i32 w, i32 h) {
33033305

33043306
RGFW_event event;
33053307
event.type = RGFW_windowRestored;
3308+
event.common.win = win;
33063309
RGFW_eventQueuePush(&event);
33073310

33083311
if (RGFW_windowRestoredCallbackSrc) RGFW_windowRestoredCallbackSrc(win, x, y, w, h);
@@ -3315,18 +3318,20 @@ void RGFW_windowMovedCallback(RGFW_window* win, i32 x, i32 y) {
33153318

33163319
RGFW_event event;
33173320
event.type = RGFW_windowMoved;
3321+
event.common.win = win;
33183322
RGFW_eventQueuePush(&event);
33193323

33203324
if (RGFW_windowMovedCallbackSrc) RGFW_windowMovedCallbackSrc(win, x, y);
33213325
}
33223326

33233327
void RGFW_windowResizedCallback(RGFW_window* win, i32 w, i32 h) {
3324-
win->h = h;
33253328
win->w = w;
3329+
win->h = h;
33263330

33273331
if (!(win->internal.enabledEvents & RGFW_windowResizedFlag)) return;
33283332
RGFW_event event;
33293333
event.type = RGFW_windowResized;
3334+
event.common.win = win;
33303335
RGFW_eventQueuePush(&event);
33313336

33323337
if (RGFW_windowResizedCallbackSrc) RGFW_windowResizedCallbackSrc(win, w, h);
@@ -3337,6 +3342,7 @@ void RGFW_windowQuitCallback(RGFW_window* win) {
33373342

33383343
RGFW_event event;
33393344
event.type = RGFW_quit;
3345+
event.common.win = win;
33403346
RGFW_eventQueuePush(&event);
33413347

33423348
if (RGFW_windowQuitCallbackSrc) RGFW_windowQuitCallbackSrc(win);
@@ -3367,6 +3373,7 @@ void RGFW_windowRefreshCallback(RGFW_window* win) {
33673373
if (!(win->internal.enabledEvents & RGFW_windowRefreshFlag)) return;
33683374
RGFW_event event;
33693375
event.type = RGFW_windowRefresh;
3376+
event.common.win = win;
33703377
RGFW_eventQueuePush(&event);
33713378

33723379
if (RGFW_windowRefreshCallbackSrc) RGFW_windowRefreshCallbackSrc(win);
@@ -3380,6 +3387,7 @@ void RGFW_focusCallback(RGFW_window* win, RGFW_bool inFocus) {
33803387
}
33813388

33823389
RGFW_event event;
3390+
event.common.win = win;
33833391

33843392
if (inFocus == RGFW_TRUE) {
33853393
if ((win->internal.flags & RGFW_windowFullscreen))
@@ -6196,7 +6204,7 @@ void RGFW_XHandleEvent(void) {
61966204
break;
61976205
}
61986206
} else if (E.xproperty.atom == _NET_WM_STATE) {
6199-
if (!(win->internal.flags & RGFW_windowMaximize)) {
6207+
if (RGFW_window_isMaximized(win) && !(win->internal.flags & RGFW_windowMaximize)) {
62006208
RGFW_windowMaximizedCallback(win, win->x, win->y, win->w, win->h);
62016209
break;
62026210
}
@@ -6448,8 +6456,8 @@ void RGFW_XHandleEvent(void) {
64486456
break;
64496457
case ConfigureNotify: {
64506458
/* detect resize */
6451-
RGFW_window_checkMode(win);
64526459
if (E.xconfigure.width != win->src.w || E.xconfigure.height != win->src.h) {
6460+
RGFW_window_checkMode(win);
64536461
win->src.w = E.xconfigure.width;
64546462
win->src.h = E.xconfigure.height;
64556463
RGFW_windowResizedCallback(win, E.xconfigure.width, E.xconfigure.height);

0 commit comments

Comments
 (0)