configure.ac | 10 +++++++- vcl/inc/unx/desktops.hxx | 2 + vcl/unx/generic/desktopdetect/desktopdetector.cxx | 25 +++++++++++++++++++--- vcl/unx/generic/plugadapt/salplug.cxx | 10 +++++++- 4 files changed, 40 insertions(+), 7 deletions(-)
New commits: commit d2a71b952850cdf1a7efc5c0f86df9864201a950 Author: Michael Meeks <[email protected]> Date: Tue Jul 2 21:58:12 2013 +0100 fdo#46990 - re-work new desktop checks, guard against NULL DESKTOP_SESSION. Change-Id: Ia3e408b372989b757f7dde080849e38d315d53cd diff --git a/vcl/unx/generic/desktopdetect/desktopdetector.cxx b/vcl/unx/generic/desktopdetect/desktopdetector.cxx index a133449..d2d91de 100644 --- a/vcl/unx/generic/desktopdetect/desktopdetector.cxx +++ b/vcl/unx/generic/desktopdetect/desktopdetector.cxx @@ -42,11 +42,8 @@ static bool is_gnome_desktop( Display* pDisplay ) // warning: these checks are coincidental, GNOME does not // explicitly advertise itself - - if ( "gnome" == getenv( "DESKTOP_SESSION" ) || NULL != getenv( "GNOME_DESKTOP_SESSION_ID" ) ) - { + if ( NULL != getenv( "GNOME_DESKTOP_SESSION_ID" ) ) ret = true; - } if( ! ret ) { @@ -121,24 +118,6 @@ static bool is_gnome_desktop( Display* pDisplay ) return ret; } -static bool is_xfce_desktop( Display* pDisplay ) -{ - if ( "xfce" == getenv( "DESKTOP_SESSION" ) ) - { - return true; - } - return false; -} - -static bool is_mate_desktop( Display* pDisplay ) -{ - if ( "mate" == getenv( "DESKTOP_SESSION" ) ) - { - return true; - } - return false; -} - static bool bWasXError = false; static inline bool WasXError() @@ -369,18 +348,30 @@ DESKTOP_DETECTOR_PUBLIC DesktopType get_desktop_environment() XErrorHandler pOldHdl = XSetErrorHandler( autodect_error_handler ); - if ( is_tde_desktop( pDisplay ) ) - ret = DESKTOP_TDE; + const char *pSession; + OString aDesktopSession; + + if ( ( pSession = getenv( "DESKTOP_SESSION" ) ) ) + aDesktopSession = OString( pSession, strlen( pSession ) ); + + // fast environment variable checks + if ( aDesktopSession.equalsIgnoreAsciiCase( "gnome" ) ) + ret = DESKTOP_GNOME; + else if ( aDesktopSession.equalsIgnoreAsciiCase( "mate" ) ) + ret = DESKTOP_MATE; + else if ( aDesktopSession.equalsIgnoreAsciiCase( "xfce" ) ) + ret = DESKTOP_XFCE; + + // these guys can be slower, with X property fetches, + // round-trips etc. and so are done later. else if ( is_kde4_desktop( pDisplay ) ) ret = DESKTOP_KDE4; else if ( is_gnome_desktop( pDisplay ) ) ret = DESKTOP_GNOME; - else if ( is_xfce_desktop( pDisplay ) ) - ret = DESKTOP_XFCE; - else if ( is_mate_desktop( pDisplay ) ) - ret = DESKTOP_MATE; else if ( is_kde_desktop( pDisplay ) ) ret = DESKTOP_KDE; + else if ( is_tde_desktop( pDisplay ) ) + ret = DESKTOP_TDE; else ret = DESKTOP_UNKNOWN; diff --git a/vcl/unx/generic/plugadapt/salplug.cxx b/vcl/unx/generic/plugadapt/salplug.cxx index fba45f1..4cb49f9 100644 --- a/vcl/unx/generic/plugadapt/salplug.cxx +++ b/vcl/unx/generic/plugadapt/salplug.cxx @@ -188,7 +188,9 @@ static SalInstance* autodetect_plugin() // no server at all: dummy plugin if ( desktop == DESKTOP_NONE ) pList = pHeadlessFallbackList; - else if ( desktop == DESKTOP_GNOME || desktop == DESKTOP_XFCE || desktop == DESKTOP_MATE ) + else if ( desktop == DESKTOP_GNOME || + desktop == DESKTOP_XFCE || + desktop == DESKTOP_MATE ) pList = pStandardFallbackList; else if( desktop == DESKTOP_TDE ) pList = pTDEFallbackList; @@ -287,7 +289,11 @@ void SalAbort( const OUString& rErrorText, bool bDumpCore ) _exit(1); } -static const char * desktop_strings[] = { "none", "unknown", "GNOME", "XFCE", "MATE", "TDE", "KDE", "KDE4" }; +// Order to match desktops.hxx' DesktopType +static const char * desktop_strings[] = { + "none", "unknown", "GNOME", + "XFCE", "MATE", "TDE", + "KDE", "KDE4" }; const OUString& SalGetDesktopEnvironment() { commit f31fad32005c6709eaae71b49af31264e585478a Author: Pader Rezso <[email protected]> Date: Tue Jul 2 21:23:56 2013 +0100 fdo#46990 - detect MATE and XFCE desktops. Change-Id: Id72860fc2e7d6b40f4fcb96b8f504a4f86a335b1 diff --git a/vcl/inc/unx/desktops.hxx b/vcl/inc/unx/desktops.hxx index c97d708..e41add4 100644 --- a/vcl/inc/unx/desktops.hxx +++ b/vcl/inc/unx/desktops.hxx @@ -24,6 +24,8 @@ enum DesktopType { DESKTOP_NONE, // headless, i.e. no X connection at all DESKTOP_UNKNOWN, // unknown desktop, simple WM, etc. DESKTOP_GNOME, + DESKTOP_XFCE, + DESKTOP_MATE, DESKTOP_KDE, DESKTOP_KDE4, DESKTOP_TDE diff --git a/vcl/unx/generic/desktopdetect/desktopdetector.cxx b/vcl/unx/generic/desktopdetect/desktopdetector.cxx index f1d6c26..a133449 100644 --- a/vcl/unx/generic/desktopdetect/desktopdetector.cxx +++ b/vcl/unx/generic/desktopdetect/desktopdetector.cxx @@ -43,8 +43,10 @@ static bool is_gnome_desktop( Display* pDisplay ) // warning: these checks are coincidental, GNOME does not // explicitly advertise itself - if ( NULL != getenv( "GNOME_DESKTOP_SESSION_ID" ) ) + if ( "gnome" == getenv( "DESKTOP_SESSION" ) || NULL != getenv( "GNOME_DESKTOP_SESSION_ID" ) ) + { ret = true; + } if( ! ret ) { @@ -119,6 +121,24 @@ static bool is_gnome_desktop( Display* pDisplay ) return ret; } +static bool is_xfce_desktop( Display* pDisplay ) +{ + if ( "xfce" == getenv( "DESKTOP_SESSION" ) ) + { + return true; + } + return false; +} + +static bool is_mate_desktop( Display* pDisplay ) +{ + if ( "mate" == getenv( "DESKTOP_SESSION" ) ) + { + return true; + } + return false; +} + static bool bWasXError = false; static inline bool WasXError() @@ -291,6 +311,10 @@ DESKTOP_DETECTOR_PUBLIC DesktopType get_desktop_environment() return DESKTOP_KDE4; if ( aOver.equalsIgnoreAsciiCase( "gnome" ) ) return DESKTOP_GNOME; + if ( aOver.equalsIgnoreAsciiCase( "xfce" ) ) + return DESKTOP_XFCE; + if ( aOver.equalsIgnoreAsciiCase( "mate" ) ) + return DESKTOP_MATE; if ( aOver.equalsIgnoreAsciiCase( "kde" ) ) return DESKTOP_KDE; if ( aOver.equalsIgnoreAsciiCase( "none" ) ) @@ -351,6 +375,10 @@ DESKTOP_DETECTOR_PUBLIC DesktopType get_desktop_environment() ret = DESKTOP_KDE4; else if ( is_gnome_desktop( pDisplay ) ) ret = DESKTOP_GNOME; + else if ( is_xfce_desktop( pDisplay ) ) + ret = DESKTOP_XFCE; + else if ( is_mate_desktop( pDisplay ) ) + ret = DESKTOP_MATE; else if ( is_kde_desktop( pDisplay ) ) ret = DESKTOP_KDE; else diff --git a/vcl/unx/generic/plugadapt/salplug.cxx b/vcl/unx/generic/plugadapt/salplug.cxx index 2eec717..fba45f1 100644 --- a/vcl/unx/generic/plugadapt/salplug.cxx +++ b/vcl/unx/generic/plugadapt/salplug.cxx @@ -188,7 +188,7 @@ static SalInstance* autodetect_plugin() // no server at all: dummy plugin if ( desktop == DESKTOP_NONE ) pList = pHeadlessFallbackList; - else if ( desktop == DESKTOP_GNOME ) + else if ( desktop == DESKTOP_GNOME || desktop == DESKTOP_XFCE || desktop == DESKTOP_MATE ) pList = pStandardFallbackList; else if( desktop == DESKTOP_TDE ) pList = pTDEFallbackList; @@ -287,7 +287,7 @@ void SalAbort( const OUString& rErrorText, bool bDumpCore ) _exit(1); } -static const char * desktop_strings[] = { "none", "unknown", "GNOME", "TDE", "KDE", "KDE4" }; +static const char * desktop_strings[] = { "none", "unknown", "GNOME", "XFCE", "MATE", "TDE", "KDE", "KDE4" }; const OUString& SalGetDesktopEnvironment() { commit 3887ba5677b1902fcf45f076d7a8e3ac96322dff Author: Michael Meeks <[email protected]> Date: Tue Jul 2 17:57:36 2013 +0100 Fix opencl path and linking issues on windows. Change-Id: Ie39a3c02d6021ae200d6e3939ec9a14ed7f34d21 diff --git a/configure.ac b/configure.ac index 66733ea..fdca180 100644 --- a/configure.ac +++ b/configure.ac @@ -9840,8 +9840,14 @@ elif test "z$with_opencl_sdk" = "z"; then else if test -d "$with_opencl_sdk/include"; then ENABLE_OPENCL=TRUE - OPENCL_CFLAGS="-I$with_opencl_sdk/include" - OPENCL_LIBS="-L$with_opencl_sdk/lib/x86 -lOpenCL" + if test "$_os" = "WINNT"; then + PathFormat "$with_opencl_sdk" + OPENCL_CFLAGS="-I$formatted_path/include" + OPENCL_LIBS="-LIBPATH:$formatted_path/lib/x86 OpenCL.lib" + else + OPENCL_CFLAGS="-I$with_opencl_sdk/include" + OPENCL_LIBS="-L$with_opencl_sdk/lib/x86 -lOpenCL" + fi AC_MSG_RESULT([found at path $with_opencl_sdk]) AC_DEFINE(HAVE_FEATURE_OPENCL) else _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
