glfw/glfw

Stage Manager iconified window never says it's iconified

TotallyGamerJet opened this issue · 0 comments

On MacOS when using stage manager and calling glfwIconifyWindow the window goes into the side panel and not the system tray which is desired behavior. I then want to check that the iconifying succeeded so I call glfwGetWindowAttrib(window, GLFW_ICONIFIED) but it never returns 1.

Full program:

#define GLFW_INCLUDE_NONE
#include <GLFW/glfw3.h>

 
#include <stdlib.h>
#include <stdio.h>

 
int main(void)
{
    GLFWwindow* window;
 
    if (!glfwInit())
        exit(EXIT_FAILURE);
 
    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
 
    window = glfwCreateWindow(640, 480, "Simple example", NULL, NULL);
    if (!window)
    {
        glfwTerminate();
        exit(EXIT_FAILURE);
    }

 
    glfwMakeContextCurrent(window);
    int i = 0;
 
    while (!glfwWindowShouldClose(window))
    {
	// delay iconifying to let the window fully be opened
	// otherwise the window does actually get placed in the tray
	if (i == 500)
		glfwIconifyWindow(window);
	i++;
	printf("%d %d\n", i, glfwGetWindowAttrib(window, GLFW_ICONIFIED));
        glfwSwapBuffers(window);
        glfwPollEvents();
    }
 
    glfwDestroyWindow(window);
 
    glfwTerminate();
    exit(EXIT_SUCCESS);
}

Related to: hajimehoshi/ebiten#2932