Mixing full screen and none full screen windows on Ubuntu

I am trying to create 2 windows, each on a separate monitor where one window is full screen and the other is not full screen.
It appears that when I create the secondary window the compositor starts to manage also my full screen window.

Is it possible to bypass the compositor on one window(monitor) and not on a second window(monitor)?

Below is the code I use to create the windows:

int openGlSyncMode = 1;

if (glfwGetPrimaryMonitor() == monitor)
{
    glfwWindow = glfwCreateWindow(videoMode->width, videoMode->height, "Primary", monitor, nullptr);
}
else
{
    openGlSyncMode = 0;
    glfwWindow = glfwCreateWindow(videoMode->width, videoMode->height, "Secondary",nullptr, nullptr);
    int xpos, ypos;
    glfwGetMonitorPos(monitor, &xpos, &ypos);
    glfwSetWindowMonitor(glfwWindow, nullptr, xpos, ypos, videoMode->width-1,videoMode->height, videoMode->refreshRate);
}

glfwMakeContextCurrent(glfwWindow);
glfwSwapInterval(openGlSyncMode);

What visible behaviour are you seeing in your application and what is the desired behaviour?

GLFW doesn’t have control over bypassing the compositor - on X11 and Wayland I think this is purely up to the compositor itself (Note: I’m not an expert on Linux compositors and window managers so could be wrong here, but this is my understanding).

If you’re on X11 then there is a window property that applications can set on windows that should bypass the compositor. GLFW sets this for full screen windows since version 3.0.4, but has no control beyond that. It’s up to the compositor whether to obey it.

You could check whether it helps to set the property on the windowed mode window as well. Run xprop -f _NET_WM_BYPASS_COMPOSITOR 32c -set _NET_WM_BYPASS_COMPOSITOR 1 and click on the desired window. If so, that’s something to look into as a GLFW fix.

If you’re on Wayland, even if running via XWayland, then I don’t know yet.

1 Like