Do not iconify full screen windows that lose focus #143

Closed
miroandel opened this Issue Sep 24, 2013 · 7 comments

Projects

None yet

3 participants

@miroandel

Fullscreen windows are minimized when loosing focus. This makes it impossible to run multiple fullscreen windows on a multi monitor setup. It's also annoying if using a GUI window + a fullscreen window because every time the user interacts with the GUI, the fullscreen window is iconified/minimized.

@elmindreda elmindreda was assigned Sep 24, 2013
@cafarm
cafarm commented Feb 25, 2014

Is anyone aware of the Windows API call required to achieve this behavior? I'm in need of this functionality at the moment. I suspect I can get the HWND from GLFW and hack it together before 3.1 but I'm not super familiar with the Windows API.

@elmindreda
Member

@cafarm It's not a matter of adding code. You'll need to remove the iconification performed by GLFW on focus loss.

@cafarm
cafarm commented Feb 25, 2014

@elmindreda Got it. I see the line in win32_window.c. Thanks. I thought this was default Windows behavior because it does not occur on OS X.

@elmindreda
Member

@cafarm Yup. That's a bug on OS X.

@miroandel

Hi, in win32_window.c which line do you remove? I commented out line
421: _glfwPlatformIconifyWindow(window); in order to run full screen on
all monitors. The problem now is that the windows are flashing for a short
while when loosing focus.

2014-02-25 20:12 GMT+01:00 Camilla Berglund notifications@github.com:

@cafarm https://github.com/cafarm Yup. That's a bug on OS X.

Reply to this email directly or view it on GitHubhttps://github.com/glfw/glfw/issues/143#issuecomment-36045661
.

@cafarm
cafarm commented Mar 5, 2014

In 3.0.4 it's around line 421 in win32_window.c.

Unmodified:

if (!focused && _glfw.focusedWindow == window)
{
    // The window was defocused (or iconified, see above)

    if (window->cursorMode != GLFW_CURSOR_NORMAL)
        showCursor(window);

    if (window->monitor)
    {
        if (!iconified)
        {
            // Iconify the (on top, borderless, oddly positioned)
            // window or the user will be annoyed
            _glfwPlatformIconifyWindow(window);
        }

        _glfwRestoreVideoMode(window->monitor);
    }
}

Modified:

if (!focused && _glfw.focusedWindow == window)
{
    // The window was defocused (or iconified, see above)

    if (window->cursorMode != GLFW_CURSOR_NORMAL)
        showCursor(window);

    // if (window->monitor)
    // {
    //     if (!iconified)
    //     {
    //         // Iconify the (on top, borderless, oddly positioned)
    //         // window or the user will be annoyed
    //         _glfwPlatformIconifyWindow(window);
    //     }
    // 
    //     _glfwRestoreVideoMode(window->monitor);
    // }
}
@miroandel

Thanks, but I still have some problems where the windows are flickering
when changing focus between the windows. Seems like the video mode
changes/updates for a while.

2014-03-05 19:00 GMT+01:00 cafarm notifications@github.com:

In 3.0.4 it's around line 421 in win32_window.c.

Unmodified:

if (!focused && _glfw.focusedWindow == window){
// The window was defocused (or iconified, see above)

if (window->cursorMode != GLFW_CURSOR_NORMAL)
    showCursor(window);

if (window->monitor)
{
    if (!iconified)
    {
        // Iconify the (on top, borderless, oddly positioned)
        // window or the user will be annoyed
        _glfwPlatformIconifyWindow(window);
    }

    _glfwRestoreVideoMode(window->monitor);
}}

Modified:

if (!focused && _glfw.focusedWindow == window){
// The window was defocused (or iconified, see above)

if (window->cursorMode != GLFW_CURSOR_NORMAL)
    showCursor(window);

// if (window->monitor)
// {
//     if (!iconified)
//     {
//         // Iconify the (on top, borderless, oddly positioned)
//         // window or the user will be annoyed
//         _glfwPlatformIconifyWindow(window);
//     }
//
//     _glfwRestoreVideoMode(window->monitor);
// }}

Reply to this email directly or view it on GitHubhttps://github.com/glfw/glfw/issues/143#issuecomment-36772624
.

@elmindreda elmindreda added a commit that referenced this issue Apr 8, 2014
@elmindreda elmindreda Added GLFW_ICONIFY_DEFOCUSED.
By default, full screen windows that lose focus will be iconified and
the video mode will be restored.  This makes it impossible to create
applications spanning multiple monitors.  The GLFW_ICONIFY_DEFOCUSED
window hint will allow users to disable this behavior.

Fixes #143.
ba4bab2
@elmindreda elmindreda added a commit that referenced this issue Apr 23, 2014
@elmindreda elmindreda Added GLFW_ICONIFY_DEFOCUSED.
By default, full screen windows that lose focus will be iconified and
the video mode will be restored.  This makes it impossible to create
applications spanning multiple monitors.  The GLFW_ICONIFY_DEFOCUSED
window hint will allow users to disable this behavior.

Fixes #143.
83609b2
@elmindreda elmindreda added a commit that referenced this issue Apr 24, 2014
@elmindreda elmindreda Added GLFW_ICONIFY_DEFOCUSED.
By default, full screen windows that lose focus will be iconified and
the video mode will be restored.  This makes it impossible to create
applications spanning multiple monitors.  The GLFW_ICONIFY_DEFOCUSED
window hint will allow users to disable this behavior.

Fixes #143.
ee39678
@elmindreda elmindreda added a commit that referenced this issue May 19, 2014
@elmindreda elmindreda Added GLFW_ICONIFY_DEFOCUSED.
By default, full screen windows that lose focus will be iconified and
the video mode will be restored.  This makes it impossible to create
applications spanning multiple monitors.  The GLFW_ICONIFY_DEFOCUSED
window hint will allow users to disable this behavior.

Fixes #143.
c7cd042
@elmindreda elmindreda added a commit that referenced this issue May 21, 2014
@elmindreda elmindreda Added GLFW_ICONIFY_DEFOCUSED.
By default, full screen windows that lose focus will be iconified and
the video mode will be restored.  This makes it impossible to create
applications spanning multiple monitors.  The GLFW_ICONIFY_DEFOCUSED
window hint will allow users to disable this behavior.

Fixes #143.
55f79ee
@elmindreda elmindreda added a commit that referenced this issue May 29, 2014
@elmindreda elmindreda Added GLFW_ICONIFY_DEFOCUSED.
By default, full screen windows that lose focus will be iconified and
the video mode will be restored.  This makes it impossible to create
applications spanning multiple monitors.  The GLFW_ICONIFY_DEFOCUSED
window hint will allow users to disable this behavior.

Fixes #143.
1e1e15e
@elmindreda elmindreda added a commit that closed this issue Jun 18, 2014
@elmindreda elmindreda Added GLFW_AUTO_ICONIFY.
By default, full screen windows that lose focus will be iconified and
the video mode will be restored.  This makes it impossible to create
applications spanning multiple monitors.  The GLFW_AUTO_ICONIFY window
hint will allow users to disable this behavior.

Fixes #143.
25e7ff1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment