summaryrefslogtreecommitdiff
path: root/src/Fl_visual.cxx
diff options
context:
space:
mode:
authorBill Spitzak <spitzak@gmail.com>2000-01-23 01:56:42 +0000
committerBill Spitzak <spitzak@gmail.com>2000-01-23 01:56:42 +0000
commitbe12eee3e5aab53510a5d8f0de7825586807b5ba (patch)
treed23149d409748ccd93d646eef5612e72eedc88e6 /src/Fl_visual.cxx
parenteb9472f8d3bb3498d80f8a26e9fee79c7350903d (diff)
If compiled with USE_COLORMAP=0 it will always try to find a TrueColor
visual on the X display, rather than failing if the default is not TrueColor. This does not affect any normal compilation because USE_COLORMAP is defaulted to 1. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@993 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_visual.cxx')
-rw-r--r--src/Fl_visual.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Fl_visual.cxx b/src/Fl_visual.cxx
index 8b7768d23..2a37afe7c 100644
--- a/src/Fl_visual.cxx
+++ b/src/Fl_visual.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_visual.cxx,v 1.7 1999/01/07 19:17:32 mike Exp $"
+// "$Id: Fl_visual.cxx,v 1.7.2.1 2000/01/23 01:56:42 bill Exp $"
//
// Visual support for the Fast Light Tool Kit (FLTK).
//
@@ -46,6 +46,7 @@ int Fl::visual(int flags) {
static int test_visual(XVisualInfo& v, int flags) {
if (v.screen != fl_screen) return 0;
+#if USE_COLORMAP
if (!(flags & FL_INDEX)) {
if (v.c_class != StaticColor && v.c_class != TrueColor) return 0;
if (v.depth <= 8) return 0; // fltk will work better in colormap mode
@@ -55,6 +56,10 @@ static int test_visual(XVisualInfo& v, int flags) {
}
// for now, fltk does not like colormaps of more than 8 bits:
if ((v.c_class&1) && v.depth > 8) return 0;
+#else
+ // simpler if we can't use colormapped visuals at all:
+ if (v.c_class != StaticColor && v.c_class != TrueColor) return 0;
+#endif
#if USE_XDBE
if (flags & FL_DOUBLE) {
static XdbeScreenVisualInfo *xdbejunk;
@@ -102,5 +107,5 @@ int Fl::visual(int flags) {
#endif
//
-// End of "$Id: Fl_visual.cxx,v 1.7 1999/01/07 19:17:32 mike Exp $".
+// End of "$Id: Fl_visual.cxx,v 1.7.2.1 2000/01/23 01:56:42 bill Exp $".
//