summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2019-01-29 09:28:01 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2019-01-29 12:28:57 +0100
commitf8f1d2f4419cd96a6aa16101d97b42d2fbb0310b (patch)
treea147acced5ec8b79fdbf98f9aeb5413bdb7f24ee
parent48c6f4e0885976f9d8ccbffc5088f37bb5f1b9f0 (diff)
Drop kde4 desktop detection
KDE 4 has been unmaintained upstream for various year now and the kde4 VCL Plugin was removed with 6ca3b3648e25ae9d4d2d29a0df83349198ec3f5e in favor of the kde5 one. Drop desktop detection for this obsolete KDE 4 version as well. Should new LO versions be run on old systems still running KDE 4, it's very unlikely that they have the kf5 libraries that are required to use the kde5 or gtk3_kde5 SAL plugins anyway, so the default fallback for an unknown desktop environment is quite as good. Change-Id: If8de489fbca836a80451435edfb00d2a8d501031 Reviewed-on: https://gerrit.libreoffice.org/67053 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
-rw-r--r--vcl/inc/unx/desktops.hxx1
-rw-r--r--vcl/source/app/IconThemeSelector.cxx3
-rw-r--r--vcl/source/app/salplug.cxx8
-rw-r--r--vcl/unx/generic/desktopdetect/desktopdetector.cxx85
4 files changed, 4 insertions, 93 deletions
diff --git a/vcl/inc/unx/desktops.hxx b/vcl/inc/unx/desktops.hxx
index d034a9b8dd3a..a4a6700b7e96 100644
--- a/vcl/inc/unx/desktops.hxx
+++ b/vcl/inc/unx/desktops.hxx
@@ -31,7 +31,6 @@ enum SAL_DLLPUBLIC_RTTI DesktopType {
DESKTOP_UNITY,
DESKTOP_XFCE,
DESKTOP_MATE,
- DESKTOP_KDE4,
DESKTOP_KDE5,
DESKTOP_LXQT
}; // keep in sync with desktop_strings[] in salplug.cxx
diff --git a/vcl/source/app/IconThemeSelector.cxx b/vcl/source/app/IconThemeSelector.cxx
index d0454c37fb34..57eee4d1344b 100644
--- a/vcl/source/app/IconThemeSelector.cxx
+++ b/vcl/source/app/IconThemeSelector.cxx
@@ -56,8 +56,7 @@ IconThemeSelector::GetIconThemeForDesktopEnvironment(const OUString& desktopEnvi
return OUString("colibre");
#else
OUString r;
- if ( desktopEnvironment.equalsIgnoreAsciiCase("kde4") ||
- desktopEnvironment.equalsIgnoreAsciiCase("kde5") ||
+ if ( desktopEnvironment.equalsIgnoreAsciiCase("kde5") ||
desktopEnvironment.equalsIgnoreAsciiCase("lxqt") ) {
r = "breeze";
}
diff --git a/vcl/source/app/salplug.cxx b/vcl/source/app/salplug.cxx
index 555cfe04f5d7..bc96e9810713 100644
--- a/vcl/source/app/salplug.cxx
+++ b/vcl/source/app/salplug.cxx
@@ -94,8 +94,6 @@ SalInstance* tryInstance( const OUString& rModuleBase, bool bForce = false )
* not access the 'gnome_accessibility_module_shutdown' anymore.
* So make sure libgtk+ & co are still mapped into memory when
* atk-bridge's atexit handler gets called.
- * #i109007# KDE3 seems to have the same problem.
- * And same applies for KDE4.
*/
if( rModuleBase == "gtk" || rModuleBase == "gtk3" || rModuleBase == "gtk3_kde5" || rModuleBase == "win" )
{
@@ -186,8 +184,7 @@ SalInstance* autodetect_plugin()
desktop == DESKTOP_XFCE ||
desktop == DESKTOP_MATE )
pList = pStandardFallbackList;
- else if( desktop == DESKTOP_KDE4 ||
- desktop == DESKTOP_KDE5 ||
+ else if( desktop == DESKTOP_KDE5 ||
desktop == DESKTOP_LXQT )
pList = pKDEFallbackList;
@@ -320,8 +317,7 @@ const OUString& SalGetDesktopEnvironment()
// Order to match desktops.hxx' DesktopType
static const char * const desktop_strings[] = {
"none", "unknown", "GNOME", "UNITY",
- "XFCE", "MATE", "KDE4", "KDE5",
- "LXQT" };
+ "XFCE", "MATE", "KDE5", "LXQT" };
static OUString aDesktopEnvironment;
if( aDesktopEnvironment.isEmpty())
{
diff --git a/vcl/unx/generic/desktopdetect/desktopdetector.cxx b/vcl/unx/generic/desktopdetect/desktopdetector.cxx
index 9f65b1624181..7a1757a94e27 100644
--- a/vcl/unx/generic/desktopdetect/desktopdetector.cxx
+++ b/vcl/unx/generic/desktopdetect/desktopdetector.cxx
@@ -117,80 +117,6 @@ static bool is_gnome_desktop( Display* pDisplay )
return ret;
}
-static bool bWasXError = false;
-
-static bool WasXError()
-{
- bool bRet = bWasXError;
- bWasXError = false;
- return bRet;
-}
-
-extern "C"
-{
- static int autodect_error_handler( Display*, XErrorEvent* )
- {
- bWasXError = true;
- return 0;
- }
-
- typedef int(* XErrorHandler)(Display*,XErrorEvent*);
-}
-
-static int KDEVersion( Display* pDisplay )
-{
- int nRet = 0;
-
- Atom nFullSession = XInternAtom( pDisplay, "KDE_FULL_SESSION", True );
- Atom nKDEVersion = XInternAtom( pDisplay, "KDE_SESSION_VERSION", True );
-
- if( nFullSession )
- {
- if( !nKDEVersion )
- return 3;
-
- Atom aRealType = None;
- int nFormat = 8;
- unsigned long nItems = 0;
- unsigned long nBytesLeft = 0;
- unsigned char* pProperty = nullptr;
- XGetWindowProperty( pDisplay,
- DefaultRootWindow( pDisplay ),
- nKDEVersion,
- 0, 1,
- False,
- AnyPropertyType,
- &aRealType,
- &nFormat,
- &nItems,
- &nBytesLeft,
- &pProperty );
- if( !WasXError() && nItems != 0 && pProperty )
- {
- nRet = *reinterpret_cast< sal_Int32* >( pProperty );
- }
- if( pProperty )
- {
- XFree( pProperty );
- pProperty = nullptr;
- }
- }
- return nRet;
-}
-
-static bool is_kde4_desktop( Display* pDisplay )
-{
- static const char * pFullVersion = getenv( "KDE_FULL_SESSION" );
- static const char * pSessionVersion = getenv( "KDE_SESSION_VERSION" );
- if ( pFullVersion && pSessionVersion && strcmp(pSessionVersion, "4") == 0 )
- return true;
-
- if ( KDEVersion( pDisplay ) == 4 )
- return true;
-
- return false;
-}
-
static bool is_kde5_desktop()
{
static const char * pFullVersion = getenv( "KDE_FULL_SESSION" );
@@ -216,8 +142,6 @@ DESKTOP_DETECTOR_PUBLIC DesktopType get_desktop_environment()
return DESKTOP_LXQT;
if ( aOver.equalsIgnoreAsciiCase( "kde5" ) )
return DESKTOP_KDE5;
- if ( aOver.equalsIgnoreAsciiCase( "kde4" ) )
- return DESKTOP_KDE4;
if ( aOver.equalsIgnoreAsciiCase( "gnome" ) )
return DESKTOP_GNOME;
if ( aOver.equalsIgnoreAsciiCase( "gnome-wayland" ) )
@@ -326,18 +250,11 @@ DESKTOP_DETECTOR_PUBLIC DesktopType get_desktop_environment()
if( pDisplay == nullptr )
return DESKTOP_NONE;
- XErrorHandler pOldHdl = XSetErrorHandler( autodect_error_handler );
-
- if ( is_kde4_desktop( pDisplay ) )
- ret = DESKTOP_KDE4;
- else if ( is_gnome_desktop( pDisplay ) )
+ if ( is_gnome_desktop( pDisplay ) )
ret = DESKTOP_GNOME;
else
ret = DESKTOP_UNKNOWN;
- // set the default handler again
- XSetErrorHandler( pOldHdl );
-
XCloseDisplay( pDisplay );
}