Cloudef / wlc

High-level Wayland compositor library
MIT License
331 stars 58 forks source link

glfw window not showing when not creating OpenGL context #260

Open karroffel opened 7 years ago

karroffel commented 7 years ago

When trying to create a glfw windows without using a client API (aka not creating an OpenGL context) then the window doesn't display.

#include <stdio.h>

#include <GLFW/glfw3.h>

int main()
{
        if (glfwInit() != GLFW_TRUE) {
                fprintf(stderr, "Couldn't initialize glfw\n");
                return 1;
        }

        glfwWindowHint(GLFW_RESIZABLE, GLFW_TRUE);

        // if you comment out this line then it works just fine.
        glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);

        GLFWwindow *window = glfwCreateWindow(1280, 720, "sway test", NULL, NULL);

        while (!glfwWindowShouldClose(window)) {
                glfwPollEvents();
        }

        glfwTerminate();

        return 0;
}

(compile with clang/gcc filename.c -lglfw)

Neither the wayland or the x11 build of glfw work.

Works on:

Doesn't work on:

Both sway and orbment use wlc, so the problem might lie here somewhere.