From 383f5134ce408eca038541f49b4809602166f2dc Mon Sep 17 00:00:00 2001 From: Sergey Chupligin Date: Thu, 21 Sep 2023 13:44:20 +0300 Subject: [PATCH] Window controls must me used in compositor --- CMakeLists.txt | 3 -- src/glacierapp.cpp | 19 +------------ tools/CMakeLists.txt | 16 ----------- tools/libglacierconfig.cpp | 58 -------------------------------------- 4 files changed, 1 insertion(+), 95 deletions(-) delete mode 100644 tools/CMakeLists.txt delete mode 100644 tools/libglacierconfig.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index ee90914..42fdec3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,9 +40,6 @@ else() endif() add_subdirectory(src) -if(MLITE_FOUND) - add_subdirectory(tools) -endif() if(BUILD_EXAMPLES) add_subdirectory(examples) diff --git a/src/glacierapp.cpp b/src/glacierapp.cpp index b654c74..fef3d8c 100644 --- a/src/glacierapp.cpp +++ b/src/glacierapp.cpp @@ -111,17 +111,6 @@ QQuickWindow* GlacierApp::showWindow() qCritical() << "Top object is not Window!"; return nullptr; } - // Add GLACIER_FORCE_WINDOW_MODE=1 into /var/lib/compositor/*.conf to run all app in window mode - bool forceWindowMode = false; - if (qgetenv("GLACIER_FORCE_WINDOW_MODE") == "1") { - forceWindowMode = true; - } -#ifdef HAS_MLITE5 - // Check desktop mode in mlite config - if (MGConfItem(QStringLiteral("/nemo/apps/libglacier/desktopmode")).value(0).toBool() == true) { - forceWindowMode = true; - } -#endif /*Load last params of window*/ #ifdef HAS_MLITE5 @@ -141,13 +130,7 @@ QQuickWindow* GlacierApp::showWindow() if (QCoreApplication::arguments().contains("--prestart") || QCoreApplication::arguments().contains("-p")) { qDebug() << "Application run in shadow mode"; } else { - if (QCoreApplication::arguments().contains("--window") - || QCoreApplication::arguments().contains("-w") - || forceWindowMode) { - window->show(); - } else { - window->showFullScreen(); - } + window->show(); } return window; } diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt deleted file mode 100644 index 797d3de..0000000 --- a/tools/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -set(SRC libglacierconfig.cpp) - -add_executable(glacierconfig ${SRC}) - -set(QT_LIB_LIST Core Gui Qml Quick) -find_qt_package("${QT_LIB_LIST}" REQUIRED ) -add_qt_library(QT_DEPLIBS "${QT_LIB_LIST}") - - -target_link_libraries(glacierconfig PRIVATE - Glacier${LIBGLACIER_PKG_VER}::App - ${QT_DEPLIBS} - PkgConfig::MLITE) - -install(TARGETS glacierconfig RUNTIME - DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/tools/libglacierconfig.cpp b/tools/libglacierconfig.cpp deleted file mode 100644 index 5a1bc3e..0000000 --- a/tools/libglacierconfig.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2021 Chupligin Sergey - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include -#include -#include -#include - -int main(int argc, char* argv[]) -{ - QCoreApplication app(argc, argv); - - QCommandLineParser parser; - QCommandLineOption desktopModeOption(QStringList() << "d" - << "desktopMode", - QCoreApplication::translate("main", "Enable/Disable descktop "), - QCoreApplication::translate("main", "mode")); - parser.addOption(desktopModeOption); - parser.addHelpOption(); - parser.process(app); - - bool currentDesktopMode = MGConfItem(QStringLiteral("/nemo/apps/libglacier/desktopmode")).value(0).toBool(); - - QString desktopMode = parser.value(desktopModeOption); - - if (!desktopMode.isEmpty()) { - MGConfItem* desktopModeValue = new MGConfItem(QStringLiteral("/nemo/apps/libglacier/desktopmode")); - if (desktopMode == "true" || desktopMode == "enable" || desktopMode == "on" || desktopMode == "1") { - desktopModeValue->set(1); - qDebug() << "Window mode enabled"; - } else if (desktopMode == "false" || desktopMode == "disable" || desktopMode == "off" || desktopMode == "0") { - desktopModeValue->set(0); - qDebug() << "Window mode disabled"; - } - desktopModeValue->sync(); - } else { - // Just print current values - qDebug() << " desktop mode is" << currentDesktopMode; - } - - return EXIT_SUCCESS; -}