Issue 22061 - force detection of Gnome ...
Summary: force detection of Gnome ...
Status: CLOSED FIXED
Alias: None
Product: gsl
Classification: Code
Component: code (show other issues)
Version: OOo 1.1 RC5
Hardware: PC Linux, all
: P3 Trivial (vote)
Target Milestone: OOo 1.1.1
Assignee: philipp.lohmann
QA Contact: issues@gsl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-03 16:02 UTC by mmeeks
Modified: 2004-01-27 10:27 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description mmeeks 2003-11-03 16:02:37 UTC
This tiny patch does the obvious, and allows users with whacked out systems:
XFCE + no nautilus + no gnome session to force the gtk+/gnome integration bits
to be used:

--- vcl/unx/source/gdi/dtint.cxx	28 May 2003 12:33:47 -0000	1.16
+++ vcl/unx/source/gdi/dtint.cxx	3 Nov 2003 15:59:48 -0000
@@ -161,7 +161,9 @@ DtIntegrator* DtIntegrator::CreateDtInte
     // 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 )
+	const char *pEnv = getenv ("OOO_GNOME_DESKTOP");
+	bool bIsGnome = pEnv && atoi (pEnv);
+    if( nDtAtom || nDtAtom2 || bIsGnome )
     {
         int nProperties = 0;
         Atom* pProperties = XListProperties( pDisplay,
pSalDisplay->GetRootWindow(), &nProperties );
Comment 1 christof.pintaske 2003-11-03 17:24:16 UTC
cp->pl: maybe you can skip the getenv() if (nDtAtom || nDtAtom2) is
already set (though maybe it's overdose optimizing). Please take care
of it.
Comment 2 philipp.lohmann 2003-11-04 09:30:16 UTC
Would it be OK if i instead ask for an environment variable
OOO_FORCE_DESKTOP that could be set to "gnome" or "kde" ?
Comment 3 philipp.lohmann 2003-11-04 17:20:54 UTC
made it so in CWS vcl7pp1r3
Comment 4 mmeeks 2003-11-06 07:39:12 UTC
Oh; sure - the problem being that it didn't look elegant / easy to
construct the stock RTL strings to do this right.

It's well worth using the RTL strings - since (AFAIR) strncasecmp is
not that portable.

Anyhow - I've extracted your patch for our set too.
Comment 5 philipp.lohmann 2003-11-06 09:17:22 UTC
? which platform does not have strncasecmp ?
Comment 6 mmeeks 2003-11-06 18:38:12 UTC
No idea - I googled for this:

> I've noticed that glib has a lot of wrappers/substitute functions for
> things like strerror() and strcasecmp() which I use, and are very
helpful
> from a portability standpoint, since if glib compiled for them, I'm over
> the portability hurdle on those functions.

The functions have been in glib for a while - along with locale
insensitive versions more recently.

My man page specifies only BSD 4.4 for strncasecmp.

HTH.
Comment 7 chris 2003-11-10 10:12:19 UTC
Hi Philipp,

Can we add support for OOO_FORCE_DESKTOP=none too please?

        if( strncasecmp( pOverride, "none", 4 ) == 0 )
            return new DtIntegrator( pFrame );

It is helpful for comparing/testing non-themed behaviour.

Chris
Comment 8 philipp.lohmann 2003-11-10 10:43:52 UTC
Done. Also eliminated strncasecmp and replaced by OString method.
Comment 9 chris 2003-11-12 14:24:45 UTC
(OString("This is a string").equalsIgnoreAsciiCase("This is a string")
== 0) == false!

You need to remove the '==0' from each of the
aOver.equalsIgnoreAsciiCase lines..

Or is this designed to fan the desktop flamewars?  Choose KDE, you get
Gnome.  Choose Gnome, you get KDE :D
Comment 10 philipp.lohmann 2003-11-12 14:54:25 UTC
*blush* Sorry, it was a leftover from the strncasecmp version - and i
didn't check after the change compiled as i should have.

Thank you for noticing.
Comment 11 philipp.lohmann 2003-11-13 13:20:19 UTC
verified changes are in CWS vcl7pp1r3
Comment 12 philipp.lohmann 2004-01-27 10:27:47 UTC
merged in 645m25s1