We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1526 - X11 - XUnmapWindow should not be called directly
Summary: X11 - XUnmapWindow should not be called directly
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: x86 Linux
: P1 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords: target-2.0.0
Depends on:
Blocks:
 
Reported: 2012-06-22 15:43 UTC by driedfruit
Modified: 2013-07-27 03:50 UTC (History)
2 users (show)

See Also:


Attachments
Patch to fix the issue (replace XUnmapWindow with XWithdrawWindow call) (716 bytes, patch)
2012-06-22 15:43 UTC, driedfruit
Details | Diff
minimal test case (551 bytes, text/plain)
2013-07-13 09:14 UTC, driedfruit
Details
Patch to fix the issue (replace XUnmapWindow with XWithdrawWindow call) (1.53 KB, text/plain)
2013-07-13 09:16 UTC, driedfruit
Details

Note You need to log in before you can comment on or make changes to this bug.
Description driedfruit 2012-06-22 15:43:01 UTC
Created attachment 886 [details]
Patch to fix the issue (replace XUnmapWindow with XWithdrawWindow call)

In X11_HideWindow, we call XUnmapWindow to unmap. According to ICCCN2.0, this should never happen, and XWithdrawWindow should be called instead.

http://www.tronche.com/gui/x/icccm/sec-4.html#s-4.1.4 

"The reason for requiring the client to send a synthetic UnmapNotify event is to ensure that the window manager gets some notification of the client's desire to change state, ***even though the window may already be unmapped when the desire is expressed***."

Additionally, this can be observed at http://cgit.freedesktop.org/xorg/lib/libX11/tree/src/Withdraw.c#n65

Failure to comply leads to "MapNotify" event never appearing on non-reparenting WMs after subsequent show-hide-show requests. (I'm currently observing this behavior, thus my bug report).
Comment 1 Ryan C. Gordon 2013-07-12 18:52:40 UTC
(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.
Comment 2 driedfruit 2013-07-13 09:14:03 UTC
Created attachment 1228 [details]
minimal test case

Expected behavior: program flickers a window and quits.

Observed behavior: program freezes forever.
Comment 3 driedfruit 2013-07-13 09:16:13 UTC
Created attachment 1229 [details]
Patch to fix the issue (replace XUnmapWindow with XWithdrawWindow call)

Updated patch for the latest hg tip.
Comment 4 driedfruit 2013-07-13 09:17:04 UTC
Note: this issue is still relevant.
Comment 5 miscab 2013-07-14 23:25:57 UTC
(In reply to comment #4)
> Note: this issue is still relevant.

your solution is great, does work but something new raised, Please see Bug 1974.

Thank you so much!

Joy
Comment 6 Sam Lantinga 2013-07-27 03:50:04 UTC
Fixed, thanks!
http://hg.libsdl.org/SDL/rev/b186724247dd