aboutsummaryrefslogtreecommitdiffstats
path: root/src/x11.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/x11.c')
-rw-r--r--src/x11.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/x11.c b/src/x11.c
index 15f9e92..d7ac4a5 100644
--- a/src/x11.c
+++ b/src/x11.c
@@ -1451,3 +1451,23 @@ puglSetCursor(PuglView* const view, const PuglCursor cursor)
return PUGL_FAILURE;
#endif
}
+
+// Semi-public platform API used by backends
+
+PuglStatus
+puglX11Configure(PuglView* view)
+{
+ PuglInternals* const impl = view->impl;
+ XVisualInfo pat = {0};
+ int n = 0;
+
+ pat.screen = impl->screen;
+ impl->vi = XGetVisualInfo(impl->display, VisualScreenMask, &pat, &n);
+
+ view->hints[PUGL_RED_BITS] = impl->vi->bits_per_rgb;
+ view->hints[PUGL_GREEN_BITS] = impl->vi->bits_per_rgb;
+ view->hints[PUGL_BLUE_BITS] = impl->vi->bits_per_rgb;
+ view->hints[PUGL_ALPHA_BITS] = 0;
+
+ return PUGL_SUCCESS;
+}