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 1852 - Add support for the _NET_WM_BYPASS_COMPOSITOR hint
Summary: Add support for the _NET_WM_BYPASS_COMPOSITOR hint
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords: target-2.0.0
Depends on:
Blocks:
 
Reported: 2013-05-14 13:09 UTC by Jasper St. Pierre
Modified: 2013-07-21 14:07 UTC (History)
2 users (show)

See Also:


Attachments
Patch to implement support for _NET_WM_BYPASS_COMPOSITOR (1.14 KB, patch)
2013-05-14 13:10 UTC, Jasper St. Pierre
Details | Diff
Updated patch. (1.19 KB, patch)
2013-07-21 01:01 UTC, Ryan C. Gordon
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jasper St. Pierre 2013-05-14 13:09:22 UTC
See patch. This should improve performance for Linux games that use SDL2 under WMs that support the hint, like gnome-shell.
Comment 1 Jasper St. Pierre 2013-05-14 13:10:08 UTC
Created attachment 1139 [details]
Patch to implement support for _NET_WM_BYPASS_COMPOSITOR
Comment 2 Sam Lantinga 2013-05-16 03:38:07 UTC
It seems like you'd want to only turn this on for fullscreen windows?
Comment 3 Jasper St. Pierre 2013-05-16 09:32:55 UTC
Well, the compositor should make decisions about what it can and cannot support. It's possible a compositor could redirect non-full-screen windows that are stacked to the front while it can.
Comment 4 drago01 2013-05-16 11:57:06 UTC
(In reply to comment #3)
> Well, the compositor should make decisions about what it can and cannot
> support. It's possible a compositor could redirect non-full-screen windows
> that are stacked to the front while it can.

Yeah I have though about lifting the "must be monitor sized" restriction in mutter but only for windows that explicitly ask for being unredirected using the hint. It might make sense for windowed games but I have not tested it yet how well it works in practice but we might do that in the future.
Comment 5 Jasper St. Pierre 2013-06-22 13:54:09 UTC
Any update on this? Right now we're sort of using a strange hack in mutter / gnome-shell to detect 100 or so full-window damages, but that doesn't play well with some SDL2 games that resize on minimize or similar, where we get the Damage before the ConfigureNotify.
Comment 6 Ryan C. Gordon 2013-07-12 22:15:55 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 2.

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 7 Ryan C. Gordon 2013-07-21 00:27:00 UTC
Just making sure...

        const int _NET_WM_BYPASS_COMPOSITOR_HINT_ON = 1;

Should that be a "long"? I can never remember what XChangeProperty() wants here, and just want to make sure we get it right for both 32 and 64-bit platforms.

--ryan.
Comment 8 Jasper St. Pierre 2013-07-21 00:35:46 UTC
Hm, scanning through GDK, I think we do want "long" here. Can you update the patch? I can't seem to compile SDL at the moment.
Comment 9 Ryan C. Gordon 2013-07-21 01:01:14 UTC
Created attachment 1245 [details]
Updated patch.

(In reply to comment #8)
> Hm, scanning through GDK, I think we do want "long" here. Can you update the
> patch? I can't seem to compile SDL at the moment.

Attached. I left your name as the author of the patch, I hope you don't mind.

Sam: this seems reasonable to me. Unless you want to add a hint to allow apps to optionally disable it first, I think we should push this patch.

--ryan.
Comment 10 Jasper St. Pierre 2013-07-21 01:05:10 UTC
I think the only case where we want to disable compositor bypass is when the application doesn't sync to vblank, in which case you might get tearing or flickering. Of course, not syncing to vblank introduces a bunch of artifacts anyway, so it's probably not too important to change the property in that case.
Comment 11 Jasper St. Pierre 2013-07-21 01:05:48 UTC
(oh, and I don't mind being credited with the patch, if I have to explicitly give permission)
Comment 12 Sam Lantinga 2013-07-21 14:07:20 UTC
Applied!
http://hg.libsdl.org/SDL/rev/fc864efbc1a6