Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 7 of 7

Thread: OpenGL app loses focus in fullscreen

  1. #1
    Junior Member Regular Contributor
    Join Date
    May 2008
    Posts
    116

    OpenGL app loses focus in fullscreen

    Hi,

    on Windows 7 SOMETIMES (not always) during fullscreen
    switch (where Aero disabled) the app loses its focus
    although the fullscreen window is still displayed
    in foreground.

    Then Windows own mouse cursor appears in front of
    the OpenGL fullscreen window and a mouse click
    makes the app disappear (another window or the
    desktop is shown).

    This is really annoying and I can't do anything
    about it, I tried SetForegroundWindow() or
    SetFocus().

    I guess sometimes during the Aero disable process
    something goes wrong and removes the input focus
    from the OpenGL app.

    I have the latest NVidia drivers for my 8800 GTS
    installed and my OS is Windows 7 x64.

    Any ideas?

    Thanks

  2. #2
    Member Regular Contributor
    Join Date
    Dec 2007
    Posts
    258

    Re: OpenGL app loses focus in fullscreen

    i got this problem too on vista

  3. #3
    Junior Member Regular Contributor
    Join Date
    May 2008
    Posts
    116

    Re: OpenGL app loses focus in fullscreen

    I tried a lot of things to sovle this problem
    but without luck. I just can't do anything
    about it

  4. #4
    Member Regular Contributor
    Join Date
    Oct 2006
    Posts
    353

    Re: OpenGL app loses focus in fullscreen

    Make sure the window is HWND_TOPMOST (SetWindowPos).
    [The Open Toolkit library: C# OpenGL 4.4, OpenGL ES 3.1, OpenAL 1.1 for Mono/.Net]

  5. #5
    Junior Member Regular Contributor
    Join Date
    May 2008
    Posts
    116

    Re: OpenGL app loses focus in fullscreen

    Thanks for the hint!

    I'll give it a try with the WS_EX_TOPMOST flag
    Should be the same like SetWindowPos().

    Code :
    [...]
     
    if (Fullscreen) dwStyleEx|= WS_EX_TOPMOST;
     
    Window_Handle_Main= CreateWindowEx(dwStyleEx, ...);


    I'll report if the problem still exist.

  6. #6
    Senior Member OpenGL Pro k_szczech's Avatar
    Join Date
    Feb 2006
    Location
    Poland
    Posts
    1,107

    Re: OpenGL app loses focus in fullscreen

    Also, you can inform system that screen saver is running (your application will then be considered to be a screensaver) - this stops a few things from happening.

    I'm not doing so though - since I never had problems (I use TOPMOST), but I will probably add it as option.

  7. #7
    Member Regular Contributor remdul's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands
    Posts
    346

    Re: OpenGL app loses focus in fullscreen

    Make sure the nVidia control panel is closed. It steals the focus occasionally. Very annoying.

Posting Permissions

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