So far, Application::GetDesktopEnvironment was returning
a string to identify the desktop environment
(or OS, as e.g. "Windows" or "MacOSX" could also
be returned).
Use the existing DesktopType enum class instead of strings
to avoid one potential of errors, move its header from
being vcl-internal to a global vcl header and add a few
enum values for those cases that didn't have any yet.
This should e.g. prevent issues like the one detected
and fixed in previous commit
Change-Id: I9cd5076a3eeca8b8c02a121add8dd1cec18c77a8
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Fri Mar 13 22:39:40 2026 +0100
gtk: Fix desktop environment strings in comparison
"tde" is no longer used and KDE Plasma environments
are identified by "PLASMA5" and "PLASMA6", respectively,
see SalGetDesktopEnvironment.
from happening again in the future.
Change-Id: Ifab1d67f4fa3e9150e4eb3449b3fed54e8e53b98
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201687
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
45 lines
1.2 KiB
C++
45 lines
1.2 KiB
C++
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
/*
|
|
* This file is part of the LibreOffice project.
|
|
*
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
*
|
|
* This file incorporates work covered by the following license notice:
|
|
*
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
* with this work for additional information regarding copyright
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
* except in compliance with the License. You may obtain a copy of
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <sal/config.h>
|
|
|
|
enum class DesktopType
|
|
{
|
|
Headless,
|
|
Unknown, // unknown desktop, simple WM, etc.
|
|
GNOME,
|
|
Unity,
|
|
Xfce,
|
|
MATE,
|
|
Plasma5,
|
|
Plasma6,
|
|
LXQt,
|
|
macOS,
|
|
Windows,
|
|
WASM,
|
|
Android,
|
|
iOS,
|
|
};
|
|
|
|
DesktopType get_desktop_environment();
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|