[Libreoffice-commits] .: 3 commits - vcl/inc vcl/unx
Thomas Arnhold
tarnhold at kemper.freedesktop.org
Mon Jan 30 13:50:44 PST 2012
vcl/inc/win/salids.hrc | 2 -
vcl/unx/generic/app/saldisp.cxx | 62 ++++++----------------------------------
2 files changed, 10 insertions(+), 54 deletions(-)
New commits:
commit ae501cc73fe11c0f7b85b9f8be2bfb0d6fbe487f
Author: Thomas Arnhold <thomas at arnhold.org>
Date: Mon Jan 30 22:48:36 2012 +0100
W40ONLY is never defined
diff --git a/vcl/inc/win/salids.hrc b/vcl/inc/win/salids.hrc
index 3049f11..f8aec19 100644
--- a/vcl/inc/win/salids.hrc
+++ b/vcl/inc/win/salids.hrc
@@ -30,9 +30,7 @@
// Cursor
#define SAL_RESID_POINTER_NULL 10000
-#ifndef W40ONLY
#define SAL_RESID_POINTER_HELP 10001
-#endif
#ifndef WNT
#define SAL_RESID_POINTER_HSIZE 10002
#define SAL_RESID_POINTER_VSIZE 10003
commit 3b90a3f1eaf9b98e52917d97b6991762d498c10d
Author: Thomas Arnhold <thomas at arnhold.org>
Date: Sun Jan 29 15:24:33 2012 +0100
vcl: stuff
diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx
index 90cfe61..4c10665 100644
--- a/vcl/unx/generic/app/saldisp.cxx
+++ b/vcl/unx/generic/app/saldisp.cxx
@@ -243,14 +243,18 @@ sal_Bool SalDisplay::BestVisual( Display *pDisplay,
VisualID nDefVID = XVisualIDFromVisual( DefaultVisual( pDisplay, nScreen ) );
XVisualInfo aVI;
+// aVI.visualid = nDefVID;
aVI.screen = nScreen;
// get all visuals
int nVisuals;
XVisualInfo* pVInfos = XGetVisualInfo( pDisplay, VisualScreenMask,
&aVI, &nVisuals );
+ if (!pVInfos)
+ return sal_False;
+
// HACK
- rVI = pVInfos[ 0 ];
+ rVI = *pVInfos;
XFree( pVInfos );
return rVI.visualid == nDefVID;
@@ -434,10 +438,11 @@ SalDisplay::initScreen( SalX11Screen nXScreen ) const
if( SalDisplay::BestVisual( pDisp_, nXScreen.getXScreen(), aVI ) ) // DefaultVisual
aColMap = DefaultColormap( pDisp_, nXScreen.getXScreen() );
else
- aColMap = XCreateColormap( pDisp_,
- RootWindow( pDisp_, nXScreen.getXScreen() ),
- aVI.visual,
- AllocNone );
+ fprintf( stderr, "HACK: XCreateColormap would be called...\n" );
+// aColMap = XCreateColormap( pDisp_,
+// RootWindow( pDisp_, nXScreen.getXScreen() ),
+// aVI.visual,
+// AllocNone );
Screen* pScreen = ScreenOfDisplay( pDisp_, nXScreen.getXScreen() );
commit 9c1a107696d032ec4e5e5ac0526c643d3a666c06
Author: Thomas Arnhold <thomas at arnhold.org>
Date: Sun Jan 29 13:50:45 2012 +0100
vcl: BestVisuals strip
diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx
index 5269065..90cfe61 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;
More information about the Libreoffice-commits
mailing list