Results 1 to 6 of 6

Thread: Fix for Fullscreen mode

  1. #1

    Cool Fix for Fullscreen mode

    Hi all!

    First of all, I am using Ubuntu 6.10 and ClanLib 0.8. When I was playing around with it I noticed that in some resolutions when the application goes fullscreen the Ubuntu's 'taskbars' were still showing, and that the application was actually still in some sort of a windowed more because I could see the top of the window with the caption and the buttons on it.

    Strangely, this happened only in certain resolutions. The fullscreen mode worked as expected in the 640x480 and 800x600 resolutions, but when I created a window in 1024x768 or 1280x800 the fullscreen mode did not work properly. This probably has something to do with Ubuntu or my graphics card (I am using a laptop with Intel 845G i think).

    So I went through the GLX window creation code and managed to fix my problem. In the file display_window_opengl.cpp on the line 251 I have changed:

    Code:
    attributes.override_redirect = False;
    to
    Code:
    if (desc.is_fullscreen()) attributes.override_redirect = True; 
    else attributes.override_redirect = False;
    This fixed my problem but now the keyboard input didn't work. So I needed to add the following on the line 304 (before "keyboard = CL_InputDevice(new CL_InputDevice_X11Keyboard(this));" )

    Code:
    if (desc.is_fullscreen()) XGrabKeyboard(disp, window, True, GrabModeAsync,GrabModeAsync, CurrentTime);
    Now the fullscreen covers the entire screen, and both the keyboard and the mouse work. I don't know if anyone else has this problem, but these changes fixed it for me. Hopefully I didn't create any problems elsewhere.

    Cheers.


    Rados

  2. #2
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,345

    Default

    Hi,

    Some big changes were made today in the GLX code, can you try the newest version on SVN? (0.8 development..)

    Please let me know if things are working right!
    Seth A. Robinson
    Robinson Technologies

  3. #3

    Thumbs up

    Hello Seth,

    I have just tried the newest SVN version and everything works fine. That fullscreen problem that I had doesn't manifest with this version. So far there are no problems, but if something pops up I will let you know.

    Thanks for the changes!

  4. #4

    Default

    Hey glorified_amoeba.

    How did you figure out that this is the fix, I'm just wondering. Thats pretty cool.

  5. #5
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    554

    Default

    "attributes.override_redirect = True;" tells the Window Manager to get lost. From this you get a X11 window which the WM does not govern.

    The biggest problem with this approach is that alt-tab or similar task switching operations will stop functioning, and if your application goes into a deadlock the user is basically ****ed. It is an approach that generally should be avoided unless the Window Manager does not support any kinds of hints whatsoever that allows you to create a full-screen window with the WM watching over it.

    That said, I have no idea if modern Linux window managers have full-screen support or not. Last I used Linux the override_redirect option was the only way.

  6. #6

    Default

    Quote Originally Posted by Magnus Norddahl View Post
    "attributes.override_redirect = True;" tells the Window Manager to get lost. From this you get a X11 window which the WM does not govern.

    The biggest problem with this approach is that alt-tab or similar task switching operations will stop functioning, and if your application goes into a deadlock the user is basically ****ed. It is an approach that generally should be avoided unless the Window Manager does not support any kinds of hints whatsoever that allows you to create a full-screen window with the WM watching over it.

    That said, I have no idea if modern Linux window managers have full-screen support or not. Last I used Linux the override_redirect option was the only way.
    Thanks dude. I have no experience with X11 so I read the unix manual on xlib and yea I saw redirect_overide being used, then I googled some more and eventually came across its definition that you just told me.

    It seems metacity the window manager I use with ubuntu has full-screen support only up to 1024x768. After that it doesn't seem to want to take hints. So I guess I have to force it to go fullscreen somehow.

    I have changed the code as in the fix in the /usr/local/include but it seems to have no effect. Do I need to recompile clanlib before this code takes effect?

Similar Threads

  1. Novashell fullscreen overrides command-tab app swithing in osx
    By whisperstorm in forum Novashell Game Creation System
    Replies: 2
    Last Post: 01-13-2007, 06:32 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •