summaryrefslogtreecommitdiffstats
path: root/vcl
diff options
context:
space:
mode:
authorThomas Arnhold <thomas@arnhold.org>2012-01-29 13:50:45 +0100
committerThomas Arnhold <thomas@arnhold.org>2012-01-30 22:49:08 +0100
commit9c1a107696d032ec4e5e5ac0526c643d3a666c06 (patch)
treeecd840c70d4a9f6abb665f2409d547a205b44347 /vcl
parentDo not forward declare Splitter or include its header file if unneeded (diff)
downloadcore-9c1a107696d032ec4e5e5ac0526c643d3a666c06.tar.gz
core-9c1a107696d032ec4e5e5ac0526c643d3a666c06.zip
vcl: BestVisuals strip
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/generic/app/saldisp.cxx51
1 files changed, 2 insertions, 49 deletions
diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx
index 52690656beeb..90cfe61b65af 100644
--- a/vcl/unx/generic/app/saldisp.cxx
+++ b/vcl/unx/generic/app/saldisp.cxx
@@ -241,13 +241,6 @@ sal_Bool SalDisplay::BestVisual( Display *pDisplay,
XVisualInfo &rVI )
{
VisualID nDefVID = XVisualIDFromVisual( DefaultVisual( pDisplay, nScreen ) );
- VisualID nVID = 0;
- char *pVID = getenv( "SAL_VISUAL" );
- if( pVID )
- sscanf( pVID, "%li", &nVID );
-
- if( nVID && sal_GetVisualInfo( pDisplay, nVID, rVI ) )
- return rVI.visualid == nDefVID;
XVisualInfo aVI;
aVI.screen = nScreen;
@@ -255,49 +248,9 @@ sal_Bool SalDisplay::BestVisual( Display *pDisplay,
int nVisuals;
XVisualInfo* pVInfos = XGetVisualInfo( pDisplay, VisualScreenMask,
&aVI, &nVisuals );
- // pVInfos should contain at least one visual, otherwise
- // we're in trouble
- int* pWeight = (int*)alloca( sizeof(int)*nVisuals );
- int i;
- for( i = 0; i < nVisuals; i++ )
- {
- sal_Bool bUsable = sal_False;
- int nTrueColor = 1;
-
- if ( pVInfos[i].screen != nScreen )
- {
- bUsable = sal_False;
- }
- else
- if( pVInfos[i].c_class == TrueColor )
- {
- nTrueColor = 2048;
- if( pVInfos[i].depth == 24 )
- bUsable = sal_True;
- }
- else if( pVInfos[i].c_class == PseudoColor )
- {
- if( pVInfos[i].depth <= 8 )
- bUsable = sal_True;
- else if( pVInfos[i].depth == 12 )
- bUsable = sal_True;
- }
- pWeight[ i ] = bUsable ? nTrueColor*pVInfos[i].depth : -1024;
- pWeight[ i ] -= pVInfos[ i ].visualid;
- }
-
- int nBestVisual = 0;
- int nBestWeight = -1024;
- for( i = 0; i < nVisuals; i++ )
- {
- if( pWeight[ i ] > nBestWeight )
- {
- nBestWeight = pWeight[ i ];
- nBestVisual = i;
- }
- }
- rVI = pVInfos[ nBestVisual ];
+ // HACK
+ rVI = pVInfos[ 0 ];
XFree( pVInfos );
return rVI.visualid == nDefVID;