# SDL: x11: Don't report hidden windows as minimized

**URL:** <https://discourse.libsdl.org/t/sdl-x11-dont-report-hidden-windows-as-minimized/69489>\
**Category:** SDL Commits\
**Created:** [October 5, 2026, 2:55pm UTC](https://discourse.libsdl.org/t/sdl-x11-dont-report-hidden-windows-as-minimized/69489 "2026-10-05T14:55:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [October 5, 2026, 2:55pm UTC](https://discourse.libsdl.org/t/sdl-x11-dont-report-hidden-windows-as-minimized/69489/1 "2026-10-05T14:55:35Z")

</div>

> <https://github.com/libsdl-org/SDL/commit/804cf651b1d2302d248da5b08f91e4025f13fdee>

```diff
From 804cf651b1d2302d248da5b08f91e4025f13fdee Mon Sep 17 00:00:00 2001
From: Frank Praznik <[EMAIL REDACTED]>
Date: Mon, 5 Oct 2026 10:29:41 -0400
Subject: [PATCH] x11: Don't report hidden windows as minimized

---
 src/video/x11/SDL_x11events.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c
index dbfe50424e2e0..a7305d78e8ab4 100644
--- a/src/video/x11/SDL_x11events.c
+++ b/src/video/x11/SDL_x11events.c
@@ -2169,7 +2169,8 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
                     // WM_STATE: 0=Withdrawn, 1=Normal, 3=Iconic
                     Uint32 state = *(Uint32 *)prop_data;
 
- if (state == 0 || state == 3) { // Withdrawn or Iconic
+ if ((state == 0 || state == 3) && !data->window->is_hiding && !(data->window->flags & SDL_WINDOW_HIDDEN)) {
+ // Withdrawn or Iconic
                         if (!(data->window->flags & SDL_WINDOW_MINIMIZED)) {
                             SDL_SendWindowEvent(data->window, SDL_EVENT_WINDOW_MINIMIZED, 0, 0);
                             SDL_SendWindowEvent(data->window, SDL_EVENT_WINDOW_OCCLUDED, 0, 0);

```
