Clarification of borderless fullscreen and borderless windowed modes?


#1

As far as I understand, there are 4 main modes in GLFW:

  1. Windowed mode (monitor = nullptr)
  2. Fullscreen mode (monitor != nullptr)
  3. Windowed borderless (monitor = nullptr, decorated = false)
  4. Fullscreen borderless (monitor != nullptr, video mode = monitor mode)

You can then specify the auto iconify hint to determine whether the fullscreen borderless will minimize when focus is lost.

What is the difference between #3 and #4? For example, if I create a borderless, maximized, and undecorated, window compared to creating a fullscreen borderless window with the same monitor mode?

    glfwWindowHint(GLFW_RED_BITS, video_mode->redBits);
    glfwWindowHint(GLFW_GREEN_BITS, video_mode->greenBits);
    glfwWindowHint(GLFW_BLUE_BITS, video_mode->blueBits);
    glfwWindowHint(GLFW_REFRESH_RATE, video_mode->refreshRate);

    etc...

    window = glfwCreateWindow(video_mode->width, video_mode->height, "example", monitor, nullptr);

Versus

    glfwWindowHint(GLFW_DECORATED, GLFW_FALSE);

    etc...

    window = glfwCreateWindow(video_mode->width, video_mode->height, "example", nullptr, nullptr);

Are they treated the same by Windows 8/10 and/or does one go through the compositor and the other does not?

Thanks much for the clarification.


#2

There are two main differences at the moment with your #3 and #4 on Windows (I’m not sure about other platforms, but your question was Win 8/10 related).

  1. The fullscreen window is topmost, which you can replicate with a floating window.
  2. SwapBuffers does not use DwmFlush.

Topmost windows the exact size/position of the monitor have some special behaviour under windows, but I can’t find decent documentation on this nor if they completely avoid the DWM compositor.

There are some related issues on borderless windows you might want to follow:


and


#3

Windows has been covered very well by @dougbinks.

On X11, where there is a high-level “full screen window” concept, GLFW will tell the window manager to treat a mode 4 window as full screen for the chosen monitor. From that point the window manager takes care of things like placement, z-order, compositor bypassing and possibly other things. GLFW also supports the separate mechanism specifically for asking a window manager to bypass compositing and will apply it to mode 4 windows but not mode 3 ones.

On macOS we don’t yet but will support optionally giving mode 4 windows their own Spaces, which is another (weirder) kind of high-level full screen window concept.

A mode 3 window (if you also make it topmost but leave out maximization) and a mode 4 window will likely be treated the same wrt compositing on Windows. OpenGL compositor bypassing on Windows is controlled by the GPU driver, which as far as I can tell will ignore the hints available for this and instead decide ad-hoc based on the placement and style flags of the window. These will look pretty similar for modes 3 and 4 since Windows doesn’t have a real full screen concept.