Bug 192086 - PATCH: (proper) fullscreen support
PATCH: (proper) fullscreen support
Product: Fedora
Classification: Fedora
Component: plib (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Hans de Goede
Fedora Extras Quality Assurance
Depends On:
Blocks: 192119
  Show dependency treegraph
Reported: 2006-05-17 11:03 EDT by Hans de Goede
Modified: 2007-11-30 17:11 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-06-03 17:31:25 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch as described (19.70 KB, patch)
2006-05-17 11:03 EDT, Hans de Goede
no flags Details | Diff

  None (edit)
Description Hans de Goede 2006-05-17 11:03:15 EDT

I've been busy the last 2 days packaging tuxkart which uses plib. During this
packaging I've found both a bug and a missing feature in plib, wich are both
fixed by the attached patch:
-The bug is that plib (pw) creates a resizable window, but that tuxkart expects
 the window to always be the size it has specified iow it expects a non
 resizable window. Now one could concider this a bug in tuxkart, but its not
 uncommon for games to be written to a hardcoded resolution and not written for
 a resizable window. Besides making the window non resizable is much easier then
 fixing tuxkart. To fix this I've added a new function:
 void pwSetResizable ( bool enable ) ;
 The default behaviour is still to create a resizable window because I didn't
 want to break the api and/or change any defautl behaviour.
-The missing feature is the fact that plib doesn't have fullscreen support, 
 atleast not really:
 * Its possible to create a fullscreen window by passing -1 
   for width and height and disabling the border. But I've tried this (6 months
   ago or so) and there were issues (If I remember correctly the panel was on
   top of the window).
 * Besides the issues their is the problem that in that case your desktop size
   gets used and the application thus cannot specify the size it wants (see
   above). Also the desktop size usually is a rather high resoltution
   which peformance wise is not ideal for 3D games.
 * Last but not least with the current "fullscreen" code its not possible to
   switch between fullscreen <-> window easily.
 * The attached patch uses XF86VidMode to switch to the requested resolution
   instead of always using the desktopsize and it allows easy fullscreen <->
   window switching:
   void pwSetFullscreen () ;
   void pwSetWindowed () ;
   void pwToggleFullscreen () ;
 * Notice that I've choosen not to reuse the border flag for the new fullscreen
   support, so that the behaviour of plib is 100% identical for apps who do not
   use these new functions. If an app wants to use the new fullscreen code it
   must call pwSetFullscreen () after pwInit ().
 * Some apps don't want to show a cursor when fullscreen, whereas a hidden
   cursor in windowed mode is annoying. Thus I've added a new function which
   allows an app to specify seperate cursors for fullscreen and windowed mode:
   void pwSetCursorEx ( int wm, int fs ) ;

Phew, long story. Well thats it I hope you like it! I will also send the patch
upstream for intergration there.

I can understand if you're a bit worried this patch may break other stuff *, so
I would like to offer to co-maintain plib with yopu. If you agree I'll ad myself
to the initial CC field of owners.list so that I get copied on any plib bugs.
(If you want I'm even in for taking plib completly over).

* although the normal code path without using the new functions is hardly
changed, so that really shouldn't happen. 


I've also noticed that plib currently creates .a files. For easy pushing of
bugfixes to plib without having to recompile plib I would like to see plib
providing (properly versioned) .so files. Will yuo accept a patch for this?
Comment 1 Hans de Goede 2006-05-17 11:03:15 EDT
Created attachment 129324 [details]
Patch as described
Comment 2 Hans de Goede 2006-05-17 14:26:46 EDT
I've completed packaging tuxkart so you can now use tuxkart to test out the
patch, the review request is bug 192119 .
Comment 3 Hans de Goede 2006-05-18 01:18:26 EDT
One last important note which I forgot: you need to add -DXF86VIDMODE to the
CXXFLAGS when compiling plib with this patch, so the new configure line should
%configure CXXFLAGS="%{optflags} -fPIC -DXF86VIDMODE"

Comment 4 Hans de Goede 2006-05-29 04:38:30 EDT
I don't want to be rude and I know we are all volunteers, but: ping?
Comment 5 Matthias Saou 2006-05-29 06:44:52 EDT
Oops, sorry for not replying earlier!
I really appreciate all your work, and know how well you contribute upstream to
projects you make changes to, so I'm really all for you taking over
maintainership of plib (and plib16 if you want) in Extras :-)
Just let me know if/when you make incompatible changes or have it provide a
shared library at last so that I can patch/rebuild the packages I maintain that
use it (only torcs from the top of my head).

What do you think?
Comment 6 Hans de Goede 2006-05-29 14:09:22 EDT
Sounds like a plan shall I edit owners.list and put me in as owner then?

I'll take a look at making a proper .so's out of plib and once I'm ready with
that I'll let you know.

Have you had contact with upstream lately, I haven't had a response to my patch
from upstream yet?

About plib 1.6 I didn't do  a complete check but 1.8 mostly seems api compatible
with 1.6 wouldn't it be better to fix 1.6 using packages to compile against 1.8,
send patches upstream and just drop 1.6? If you can point me to any packages
using 1.6 I can take a stab at moving them to 1.8 (as time permits).
Comment 7 Matthias Saou 2006-05-31 14:42:28 EDT
Yes, it's the plan : You can change owners.list :-)
As for plib 1.6 vs. 1.8, I thought the changes were major since configure checks
are quite strict on one vs. the other, and I even thought that important changes
went in between point releases since plib builds only as a static library by
default... I really have no objections in seeing that change, go for it!
Comment 8 Hans de Goede 2006-06-01 06:29:11 EDT

Ive made myself owner of plib and added you into the initial-CC field. I've
added myself into the initial-CC field for plib16.

I'm waiting with releasing a plib with this patch untill I've also got an .so
patch ready. Reassigning to me in the mean time.
Comment 9 Hans de Goede 2006-06-03 17:30:24 EDT

I've finished writing .so support for plib into the spec file. The solution
isn't pretty by besides that it should work fine. I've concidered adding proper
shared lib support to the autoxxx files in plib. But upstream currently isn't
interested so my current solution will do fine and is probably easier to
maintain seperate from upstream too.

I've comitted this to devel and requested a build. I think its best to lett this
sit in devel for a while before making the same changes to FC-5 and FC-4 .
Comment 10 Hans de Goede 2006-06-07 04:38:47 EDT

Adding you to the CC (should have done that when assigning to me) a new version
with the fullscreen support and creating .so files is in -devel now, can you
rebuild and test your packages against this I would like to push it for FC-4 and
FC-5 too.

See above comments for more details on the .so file stuff.

Note You need to log in before you can comment on or make changes to this bug.