From 500e9184f1081753f85df7f0a6d13b6b62a53ee3 Mon Sep 17 00:00:00 2001 From: nyorain Date: Tue, 20 Jun 2017 18:44:11 +0200 Subject: [PATCH] Fix egl workaround; Test with weston --- backend/egl.c | 13 ++++++------- backend/wayland/output.c | 1 + 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/egl.c b/backend/egl.c index cfee59ce..1ce2d8a7 100644 --- a/backend/egl.c +++ b/backend/egl.c @@ -68,7 +68,7 @@ static bool egl_exts() { return true; } -static bool egl_get_config(EGLDisplay disp, EGLConfig *out) { +static bool egl_get_config(EGLDisplay disp, EGLConfig *out, EGLenum platform) { EGLint count = 0, matched = 0, ret; ret = eglGetConfigs(disp, NULL, 0, &count); @@ -88,11 +88,10 @@ static bool egl_get_config(EGLDisplay disp, EGLConfig *out) { for (int i = 0; i < matched; ++i) { EGLint gbm_format; - // TODO, see below - // best would probably be to propagate parameter or config - // choose callback - *out = configs[i]; - return true; + if(platform == EGL_PLATFORM_WAYLAND_EXT) { + *out = configs[i]; + return true; + } if (!eglGetConfigAttrib(disp, configs[i], @@ -136,7 +135,7 @@ bool wlr_egl_init(struct wlr_egl *egl, EGLenum platform, void *display) { goto error; } - if (!egl_get_config(egl->display, &egl->config)) { + if (!egl_get_config(egl->display, &egl->config, platform)) { wlr_log(L_ERROR, "Failed to get EGL config"); goto error; } diff --git a/backend/wayland/output.c b/backend/wayland/output.c index f8751c3c..3ec167bc 100644 --- a/backend/wayland/output.c +++ b/backend/wayland/output.c @@ -166,6 +166,7 @@ struct wlr_output *wlr_wl_output_create(struct wlr_backend_state* backend, wl_shell_surface_set_class(ostate->shell_surface, "sway"); wl_shell_surface_set_title(ostate->shell_surface, "sway-wl"); wl_shell_surface_add_listener(ostate->shell_surface, &shell_surface_listener, ostate); + wl_shell_surface_set_toplevel(ostate->shell_surface); ostate->egl_window = wl_egl_window_create(ostate->surface, width, height); ostate->egl_surface = wlr_egl_create_surface(&backend->egl, ostate->egl_window);