From eee1a64d1475c42e6313f33fb04f9dac1b34f781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BB=D0=BE=D0=B2=20=D0=90=D0=BD=D0=B4=D1=80?= =?UTF-8?q?=D0=B5=D0=B9=20=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D0=BC=D0=B8=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=B8=D1=87?= Date: Mon, 27 Apr 2026 17:50:21 +0300 Subject: [PATCH] render/opengl/linux/glx: publish chosen visual + colormap to os layer --- .../linux/glx/render_opengl_linux_glx.c | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/render/opengl/linux/glx/render_opengl_linux_glx.c b/src/render/opengl/linux/glx/render_opengl_linux_glx.c index 69106f1b..fecdc4a4 100644 --- a/src/render/opengl/linux/glx/render_opengl_linux_glx.c +++ b/src/render/opengl/linux/glx/render_opengl_linux_glx.c @@ -50,12 +50,22 @@ r_ogl_os_init(CmdLine *cmdln) } GLXFBConfig framebuffer_config = framebuffer_configs[0]; XFree(framebuffer_configs); - - //- rjf: construct set-window-attributes - XSetWindowAttributes set_window_attributes = {0}; - set_window_attributes.background_pixmap = None; - set_window_attributes.border_pixel = 0; - set_window_attributes.event_mask = StructureNotifyMask; + + //- extract visual/colormap from chosen fbconfig, publish to os layer + { + XVisualInfo *vi = glXGetVisualFromFBConfig(lnx_wm_state->display, framebuffer_config); + if(vi == 0) + { + wm_graphical_message(1, str8_lit("Fatal Error"), str8_lit("Could not get visual from GLX framebuffer config.")); + abort_self(1); + } + lnx_wm_state->window_visual = vi->visual; + lnx_wm_state->window_depth = vi->depth; + lnx_wm_state->window_colormap = XCreateColormap(lnx_wm_state->display, + XRootWindow(lnx_wm_state->display, vi->screen), + vi->visual, AllocNone); + XFree(vi); + } //- rjf: construct context {