| Summary: | Maximize and restore events not generated | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Charles Huber <genpfault> |
| Component: | events | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P1 | CC: | amaranth72, andreidrx-sdl2, henrique_santiago93, icculus, rainerd, szaszg |
| Version: | HG 2.0 | Keywords: | target-2.0.0 |
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: |
SDL_WINDOWEVENT logger
Generate maximize/restore events with x11 patch for hg snapshot |
||
(Sorry if you get a lot of copies of this email, we're touching dozens of bug reports right now.) Tagging a bunch of bugs as target-2.0.0, Priority 1. This means we're in the final stretch for an official SDL 2.0.0 release! These are the bugs we really want to fix before shipping if humanly possible. That being said, we don't promise to fix them because of this tag, we just want to make sure we don't forget to deal with them before we bless a final 2.0.0 release, and generally be organized about what we're aiming to ship. Hopefully you'll hear more about this bug soon. If you have more information (including "this got fixed at some point, nevermind"), we would love to have you come add more information to the bug report when you have a moment. Thanks! --ryan. I still have this bug on 2.0.0.
I've been looking at:
/src/video/x11/SDL_x11events.c
Line 509:
case ConfigureNotify:{
******
Maximized event is raised at ConfigureNotify case.
So i guess X11_GetNetWMState should be called from there to check if it's maximized or not, and then raise an SDL_WINDOWEVENT_MAXIMIZED if it's maximized.
I couldn't test it, but it seems that this can be the solution.
Created attachment 1327 [details]
Generate maximize/restore events with x11
Patch created against SDL2-2.0.0, generating maximize/restore events when running in x11.
You should probably create the patch based on SDL-HG, rather than 1 year old code... Well that's embarrassing, I didn't see the date on your reply. :) Created attachment 1853 [details]
patch for hg snapshot
(In reply to Gergely Szász from comment #6) > Created attachment 1853 [details] > patch for hg snapshot I modified this slightly, and now this patch is https://hg.libsdl.org/SDL/rev/bb0b744fd1a6 Thanks, everyone! --ryan. |
Created attachment 837 [details] SDL_WINDOWEVENT logger Running the attached program and maximizing/minimizing/restoring the window results in the following events: Maximize: No event Restore (from maximize): No event Restore (from minimize): Event received Minimize: Event received Ubuntu 10.04, amd64. GNOME2 with Metacity. testver output: Compiled with SDL 2.0 or newer Compiled version: 2.0.0.6303 (hg-6303:6bb657898f55) Linked version: 2.0.0.6303 (hg-6303:6bb657898f55)