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 1008 - Better Fullscreen support on X11
Summary: Better Fullscreen support on X11
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: x86_64 Linux
: P2 enhancement
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-21 09:51 UTC by Karl F. Glatzer
Modified: 2010-07-17 18:54 UTC (History)
0 users

See Also:


Attachments
The patch file (13.66 KB, patch)
2010-06-21 09:51 UTC, Karl F. Glatzer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Karl F. Glatzer 2010-06-21 09:51:43 UTC
Created attachment 510 [details]
The patch file

The patch removes override-redirect and xsizehints and ungrabs the keyboard to allow the Window-Manager to modify the Window and Receive keyboard input.

It adds basic support for _NET_WM_STATE_FULLSCREEN to get real Fullscreen without using override-redirect and includes some Fixmes and Todos that i suggest to implement this better.
Comment 1 Sam Lantinga 2010-07-13 15:11:26 UTC
Thanks for your patch!

Do you give me permission to release your contributions to SDL under both the LGPL and a closed-source commercial license?
Comment 2 Karl F. Glatzer 2010-07-13 15:21:47 UTC
Yes, i hope it helps ;)
Comment 3 Sam Lantinga 2010-07-13 15:43:03 UTC
Notes:

* Tested on gnome, metacity and compiz
* Need to test on twm and without a window manager
* The minimize on lose focus isn't needed when the window manager is managing the window (do we still want that behavior for consistency with other platforms?)
* There is a crash in GL_DeleteContext() when SDL_SetVideoMode() is called a second time (might already be in the system as a separate bug)
* You can have the window change the fullscreen mode on a window in Gnome with ALT-Enter
* Setting the _NET_WM_STATE_FULLSCREEN property actually changes the size of the window.
Comment 4 Sam Lantinga 2010-07-14 07:34:12 UTC
I took a look at your patch and adapted some of the concepts there and I think I have it working without polling.

Can you take a look a the latest SDL 1.3 snapshot and see how this works for you?

Thanks!
Comment 5 Karl F. Glatzer 2010-07-14 07:56:38 UTC
The patch mostly works, but i got some weird behaviour. 

I used testgl2 to test it and when started in windowed mode when I press alt+enter the window switches to fullscreen at the next press it switches back to windowed and when i press again it switches to fullscreen, after that i can't switch back to windowed by pressing alt+enter until i minimize the window.

The bug is in fullscreen mode too, but unnoticed because the window always minimizes when changed to fullscreen.

It seems like the change from fullscreen to windowed and backwards isn't noticed by SDL so it always behaves like in the mode it was started with although the windowmanager changed it.
Comment 6 Sam Lantinga 2010-07-17 18:54:31 UTC
Okay, there are some issues with various window managers, but overall this works very well.  Can you enter separate bugs for the individual issues that you're seeing?