summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-04-19 16:55:36 +0200
committerAlexander Larsson <alexl@redhat.com>2010-04-23 16:36:31 +0200
commitaeab661c5df12e6f3d225597643530f08792c4b6 (patch)
tree9625e9c3b4ee4195e11df4c4484a71659f8e0f53 /client
parent9c02d1539624403506b93fc6b5cb425978fcfd92 (diff)
Make client start if screen is 16bpp
The current glx code is looking for a rgb32 visual and always failing if there is none. This means not even software rendering starts up on e.g. 16bit visuals. This commit makes it pick software fallbacks on 16bit visuals. Long term we need to fix the gl implementation to do 16bpp too.
Diffstat (limited to 'client')
-rw-r--r--client/x11/platform.cpp27
1 files changed, 18 insertions, 9 deletions
diff --git a/client/x11/platform.cpp b/client/x11/platform.cpp
index 228069f..dba276d 100644
--- a/client/x11/platform.cpp
+++ b/client/x11/platform.cpp
@@ -2016,7 +2016,9 @@ static void cleanup(void)
}
if (fb_config) {
for (i = 0; i < ScreenCount(x_display); ++i) {
- XFree(fb_config[i]);
+ if (fb_config[i]) {
+ XFree(fb_config[i]);
+ }
}
delete fb_config;
fb_config = NULL;
@@ -2209,22 +2211,29 @@ void Platform::init()
};
for (int i = 0; i < ScreenCount(x_display); ++i) {
- if (!(fb_config[i] = glXChooseFBConfig(x_display, i, attrlist, &num_configs))) {
- vinfo[i] = get_x_vis_info(i);
- } else {
+ fb_config[i] = glXChooseFBConfig(x_display, i, attrlist, &num_configs);
+ if (fb_config[i] != NULL) {
ASSERT(num_configs > 0);
vinfo[i] = glXGetVisualFromFBConfig(x_display, fb_config[i][0]);
}
- if (!vinfo[i]) {
- THROW("XGetVisualInfo failed");
+ if (vinfo[i] == NULL) {
+ if (fb_config[i]) {
+ XFree(fb_config[i]);
+ fb_config[i] = NULL;
+ }
+ vinfo[i] = get_x_vis_info(i);
}
}
} else {
for (int i = 0; i < ScreenCount(x_display); ++i) {
- if (!(vinfo[i] = get_x_vis_info(i))) {
- THROW("XGetVisualInfo failed");
- }
+ vinfo[i] = get_x_vis_info(i);
+ }
+ }
+
+ for (int i = 0; i < ScreenCount(x_display); ++i) {
+ if (vinfo[i] == NULL) {
+ THROW("Unable to find a visual for screen");
}
}