tomthewombat wrote:suka wrote:Don't know which "gnome things" you mean, but it should activate gtk theme and file selector when not in gnome.
It doesn't seem to activate the file selector, which is GTK. I did notice that my cups printers show up with <> around them and the TYPE is listed as SGENPRT instead of CUPS. Maybe the libgnomecups backend isn't turned on?
The file selectors are what makes me believe this might not be the only variable that needs to be set. You'd think it would be enabled with GTK. The printers are also curious.
I've been hacking around the source code of OO-X. My own motivation was that I use fvwm with KDE, and I wanted KDE-integration - but OO-X wouldn't give it to me unless I was running Kwin (ew).
Yes, you can choose which widget set to use by setting the SAL_USE_VCLPLUGIN envvar. This envvar cancels autodetection. However there is a second function that doesn't heed by SAL_USE_VCL_PLUGIN and instead goes through autodetection. I'm pretty sure this is why the native file selectors don't work if you just set the SAL_USE_VCLPLUGIN envvar.
Code: Select all
const OUString& SalGetDesktopEnvironment()
{
static OUString aRet = OStringToOUString(OString(get_desktop_environment()), RTL_TEXTENCODING_ASCII_US);
return aRet;
}
As you can see, it calls the get_desktop_environment() function. My solution was to make a small patch to the autodetection routine.
Here it my patch:
Code: Select all
diff -ur oowork/oo_1.1.2_src/vcl/unx/source/plugadapt/salplug.cxx ooworknew/oo_1.1.2_src/vcl/unx/source/plugadapt/salplug.cxx
--- oowork/oo_1.1.2_src/vcl/unx/source/plugadapt/salplug.cxx 2004-08-23 16:17:32.000000000 -0700
+++ ooworknew/oo_1.1.2_src/vcl/unx/source/plugadapt/salplug.cxx 2004-08-23 17:43:17.000000000 -0700
@@ -350,7 +350,24 @@
static const char * get_desktop_environment()
{
static const char *pRet = NULL;
+
+ static const char* pOverride = getenv( "OOO_FORCE_DESKTOP" );
+ if( pOverride && *pOverride )
+ {
+ OString aOver( pOverride );
+#if USE_CDE
+ if( aOver.equalsIgnoreAsciiCase( "cde" ) )
+ pRet = desktop_strings[DESKTOP_CDE];
+#endif
+ if( aOver.equalsIgnoreAsciiCase( "kde" ) )
+ pRet = desktop_strings[DESKTOP_KDE];
+ if( aOver.equalsIgnoreAsciiCase( "gnome" ) )
+ pRet = desktop_strings[DESKTOP_GNOME];
+ if( aOver.equalsIgnoreAsciiCase( "none" ) )
+ pRet = desktop_strings[DESKTOP_UNKNOWN];
+ }
+
if ( NULL == pRet )
{
// get display to connect to
Basically, it looks at the OOO_FORCE_DESKTOP variable to allow overriding of desktop-environment autodetection. With my newly patched OO-X, I can force OO-X to provide full KDE integration in spite of the fact that I'm running fvwm.
A side-effect is that now the SAL_USE_VCL_PLUGIN variable is no longer needed at all, as the overriding is built into the autodetection function itself.
Anyways, with my patch all I need to do is set the OOO_FORCE_DESKTOP envvar to "kde", and I have full KDE integration even though I'm running under fvwm. I think it wouldn't be too hard to be able to force GTK/Gnome integration with some more hacking.
Unfortunately, the KDE Open/Save dialog crashes for me, as reported by a poster previously on this thread. This is unrelated to my patch. Hopefully, that'll stabilize soon. The easy workaround is to disable the native file selectors from within the "General" section of the Preferences dialog box.
--------
Regarding the previous poster talking about how "OOO_FORCE_DESKTOP=gnome" no longer works...
GTK still doesn't work for me at all either... and I'm reasonably sure it's because the latest Ximian patchset actually TAKES OUT the code for some GTK/Gnome stuff. Here's an excerpt of the latest Ximian patch. As you can see, your "OOO_FORCE_DESKTOP=gnome" won't work anymore, because it's been ripped out of the source.
Code: Select all
diff -u -p -u -r1.16.82.1 -r1.22
--- vcl/unx/source/gdi/dtint.cxx 15 Jan 2004 12:52:24 -0000 1.16.82.1
+++ vcl/unx/source/gdi/dtint.cxx 10 May 2004 15:58:19 -0000 1.22
@@ -72,10 +72,8 @@
#include <cdeint.hxx>
#endif
#include <kdeint.hxx>
-#include <gnomeint.hxx>
#include <saldisp.hxx>
#include <saldata.hxx>
-#include <salframe.hxx>
#include <wmadaptor.hxx>
#include <svapp.hxx>
@@ -103,16 +101,12 @@ BOOL bSymbolLoadFailed = FALSE;
DtIntegratorList DtIntegrator::aIntegratorList;
String DtIntegrator::aHomeDir;
-DtIntegrator::DtIntegrator( SalFrame* pFrame ) :
- mpSalFrame( pFrame ),
+DtIntegrator::DtIntegrator() :
meType( DtGeneric ),
mnRefCount( 0 ),
mnSystemLookCommandProcess( -1 )
{
- if( pFrame )
- mpSalDisplay = pFrame->maFrameData.GetDisplay();
- else
- mpSalDisplay = GetSalData()->GetDefDisp();
+ mpSalDisplay = GetSalData()->GetDisplay();
mpDisplay = mpSalDisplay->GetDisplay();
aIntegratorList.Insert( this, LIST_APPEND );
static const char* pHome = getenv( "HOME" );
@@ -123,16 +117,12 @@ DtIntegrator::~DtIntegrator()
{
}
-DtIntegrator* DtIntegrator::CreateDtIntegrator( SalFrame* pFrame )
+DtIntegrator* DtIntegrator::CreateDtIntegrator()
{
- // hack for sclient
- if( ! pFrame && aIntegratorList.Count() )
- return aIntegratorList.GetObject( 0 );
-
- SalDisplay* pSalDisplay = pFrame ? pFrame->maFrameData.GetDisplay() : GetSalData()->GetDefDisp();
+ SalDisplay* pSalDisplay = GetSalData()->GetDisplay();
Display* pDisplay = pSalDisplay->GetDisplay();
- for( int i = 0; i < aIntegratorList.Count(); i++ )
+ for( unsigned int i = 0; i < aIntegratorList.Count(); i++ )
{
DtIntegrator* pIntegrator = aIntegratorList.GetObject( i );
if( pIntegrator->mpDisplay == pDisplay )
@@ -150,14 +140,12 @@ DtIntegrator* DtIntegrator::CreateDtInte
OString aOver( pOverride );
#if USE_CDE
if( aOver.equalsIgnoreAsciiCase( "cde" ) )
- return new CDEIntegrator( pFrame );
+ return new CDEIntegrator();
#endif
if( aOver.equalsIgnoreAsciiCase( "kde" ) )
- return new KDEIntegrator( pFrame );
- if( aOver.equalsIgnoreAsciiCase( "gnome" ) )
- return new GNOMEIntegrator( pFrame );
+ return new KDEIntegrator();
if( aOver.equalsIgnoreAsciiCase( "none" ) )
- return new DtIntegrator( pFrame );
+ return new DtIntegrator();
}
Atom nDtAtom = None;
@@ -168,461 +156,20 @@ DtIntegrator* DtIntegrator::CreateDtInte
// check dt type
// CDE
nDtAtom = XInternAtom( pDisplay, "_DT_WM_READY", True );
- if( nDtAtom && ( pLibrary = dlopen( "libDtSvc.so", DLOPEN_MODE ) ) )
+ if( nDtAtom && ( pLibrary = dlopen( "/usr/dt/lib/libDtSvc.so", DLOPEN_MODE ) ) )
{
dlclose( pLibrary );
- return new CDEIntegrator( pFrame );
+ return new CDEIntegrator();
}
#endif
if( pSalDisplay->getWMAdaptor()->getWindowManagerName().EqualsAscii( "KWin" ) )
- return new KDEIntegrator( pFrame );
-
- // actually this is not that good an indicator for a GNOME running
- // but there currently does not seem to be a better one
- nDtAtom = XInternAtom( pDisplay, "GNOME_SM_PROXY", True );
- Atom nDtAtom2 = XInternAtom( pDisplay, "NAUTILUS_DESKTOP_WINDOW_ID", True );
- if( nDtAtom || nDtAtom2 )
- {
- int nProperties = 0;
- Atom* pProperties = XListProperties( pDisplay, pSalDisplay->GetRootWindow(), &nProperties );
- if( pProperties && nProperties )
- {
- for( int i = 0; i < nProperties; i++ )
- if( pProperties[ i ] == nDtAtom ||
- pProperties[ i ] == nDtAtom2 )
- {
- XFree( pProperties );
- return new GNOMEIntegrator( pFrame );
- }
- XFree( pProperties );
- }
- }
+ return new KDEIntegrator();
// default: generic implementation
- return new DtIntegrator( pFrame );
+ return new DtIntegrator();
}
Such a change doesn't seem like something they would do on purpose. Maybe they made a small mistake. It shouldn't be too hard to correct this.
-----
Now back to my own patch... For your reference, the patch is applied in the ebuild right before compilation starts.
Here's the patch for the ebuild:
Code: Select all
--- /usr/portage/app-office/openoffice-ximian/openoffice-ximian-1.3.0.ebuild2004-08-23 08:10:45.000000000 -0700
+++ /usr/local/portage/app-office/openoffice-ximian/openoffice-ximian-1.3.0.ebuild 2004-08-23 16:22:31.000000000 -0700
@@ -266,6 +266,9 @@
${PATCHDIR}/bin/font-munge ${S}/officecfg/registry/data/org/openoffice/VCL.xcu
echo "done munging fonts."
+ einfo "Applying desktop-forcing patch"
+ epatch ${FILESDIR}/desktopfix.patch
+
# Compile problems with these ...
filter-flags "-funroll-loops"
filter-flags "-fomit-frame-pointer"
I'd love see my patch included in the official Gentoo ebuild of openoffice-ximian. I'm also sure that my placement of the patch is suboptimal. If that's the case, excuse me, for I've never edited an ebuild before.
EDIT: Just sent to OO-X, and they'll probably include this into OOO-Ximian.