diff --git a/CMakeLists.txt b/CMakeLists.txt index 9fef2c3..f22ee6c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,14 +11,15 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake;${CMAKE_CURRENT_SOURCE_DIR}/cmake") -set(QT Core Gui Widgets Quick QuickControls2 DBus Xml X11Extras LinguistTools) -find_package(Qt5 REQUIRED ${QT}) +set(QT Core Gui Widgets Quick QuickControls2 DBus Xml LinguistTools) +find_package(Qt6 REQUIRED ${QT}) # find_package(FishUI REQUIRED) find_package(PkgConfig REQUIRED) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}) include(GNUInstallDirs) +include_directories("${CMAKE_CURRENT_SOURCE_DIR}/compat") add_subdirectory(polkit-agent) add_subdirectory(screen-brightness) diff --git a/chotkeys/CMakeLists.txt b/chotkeys/CMakeLists.txt index 188b802..9693e7d 100644 --- a/chotkeys/CMakeLists.txt +++ b/chotkeys/CMakeLists.txt @@ -1,4 +1,4 @@ -find_package(Qt5 COMPONENTS Core Widgets DBus X11Extras REQUIRED) +find_package(Qt6 COMPONENTS Core Widgets DBus Gui REQUIRED) find_package(XCB MODULE REQUIRED COMPONENTS XCB KEYSYMS) find_package(X11) @@ -14,10 +14,10 @@ add_executable(chotkeys target_link_libraries(chotkeys PRIVATE - Qt5::Core - Qt5::Widgets - Qt5::DBus - Qt5::X11Extras + Qt6::Core + Qt6::Widgets + Qt6::DBus + Qt6::Gui ${XCB_LIBS} ${X11_LIBRARIES} XCB::KEYSYMS diff --git a/chotkeys/application.cpp b/chotkeys/application.cpp index 9196141..cd3c1fd 100644 --- a/chotkeys/application.cpp +++ b/chotkeys/application.cpp @@ -35,9 +35,9 @@ Application::Application(QObject *parent) void Application::setupShortcuts() { - m_hotKeys->registerKey(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_Delete)); - m_hotKeys->registerKey(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_A)); - m_hotKeys->registerKey(QKeySequence(Qt::META + Qt::Key_L)); + m_hotKeys->registerKey(QKeySequence(QKeyCombination(Qt::CTRL | Qt::ALT, Qt::Key_Delete))); + m_hotKeys->registerKey(QKeySequence(QKeyCombination(Qt::CTRL | Qt::ALT, Qt::Key_A))); + m_hotKeys->registerKey(QKeySequence(QKeyCombination(Qt::META, Qt::Key_L))); //m_hotKeys->registerKey(QKeySequence(Qt::META + Qt::Key_6)); m_hotKeys->registerKey(647); } diff --git a/chotkeys/hotkeys.cpp b/chotkeys/hotkeys.cpp index a2b7d82..3abf221 100644 --- a/chotkeys/hotkeys.cpp +++ b/chotkeys/hotkeys.cpp @@ -46,7 +46,7 @@ Hotkeys::~Hotkeys() qApp->removeNativeEventFilter(this); } -bool Hotkeys::nativeEventFilter(const QByteArray &eventType, void *message, long *result) +bool Hotkeys::nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) { Q_UNUSED(result); diff --git a/chotkeys/hotkeys.h b/chotkeys/hotkeys.h index ecc1537..165d28e 100644 --- a/chotkeys/hotkeys.h +++ b/chotkeys/hotkeys.h @@ -37,7 +37,7 @@ public: explicit Hotkeys(QObject *parent = nullptr); ~Hotkeys(); - bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override; + bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) override; void registerKey(QKeySequence keySequence); void registerKey(quint32 keycode); diff --git a/clipboard/CMakeLists.txt b/clipboard/CMakeLists.txt index b1f2826..3af14a6 100644 --- a/clipboard/CMakeLists.txt +++ b/clipboard/CMakeLists.txt @@ -11,16 +11,16 @@ set(CMAKE_AUTORCC ON) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) -find_package(Qt5 COMPONENTS Core Gui Widgets REQUIRED) +find_package(Qt6 COMPONENTS Core Gui Widgets REQUIRED) add_executable(cutefish-clipboard main.cpp clipboard.cpp ) target_link_libraries(cutefish-clipboard - Qt5::Core - Qt5::Gui - Qt5::Widgets + Qt6::Core + Qt6::Gui + Qt6::Widgets ) -install(TARGETS cutefish-clipboard DESTINATION ${CMAKE_INSTALL_BINDIR}) \ No newline at end of file +install(TARGETS cutefish-clipboard DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/compat/QX11Info b/compat/QX11Info new file mode 100644 index 0000000..ed38fc9 --- /dev/null +++ b/compat/QX11Info @@ -0,0 +1,71 @@ +/* + * Small Qt 6 compatibility layer for the Qt 5 QX11Info calls used by the + * original Cutefish X11 helpers. Qt 6 exposes the same handles through the + * public QNativeInterface API instead of QtX11Extras. + */ + +#ifndef CUTEFISH_QX11INFO_COMPAT +#define CUTEFISH_QX11INFO_COMPAT + +#include +#include +#include + +#include + +class QX11Info +{ +public: + static bool isPlatformX11() + { + return nativeInterface() != nullptr; + } + + static xcb_connection_t *connection() + { + const auto native = nativeInterface(); + return native ? native->connection() : nullptr; + } + + static Display *display() + { + const auto native = nativeInterface(); + return native ? native->display() : nullptr; + } + + static xcb_window_t appRootWindow() + { + xcb_connection_t *c = connection(); + if (!c) + return XCB_WINDOW_NONE; + + const xcb_setup_t *setup = xcb_get_setup(c); + const xcb_screen_iterator_t iterator = xcb_setup_roots_iterator(setup); + return iterator.data ? iterator.data->root : XCB_WINDOW_NONE; + } + + static int appScreen() + { + return 0; + } + + static int appDpiY() + { + QScreen *screen = qGuiApp ? qGuiApp->primaryScreen() : nullptr; + return screen ? qRound(screen->logicalDotsPerInchY()) : 96; + } + + // This is only used as the timestamp in synthetic tray input events. + static unsigned long getTimestamp() + { + return 0; + } + +private: + static QNativeInterface::QX11Application *nativeInterface() + { + return qGuiApp ? qGuiApp->nativeInterface() : nullptr; + } +}; + +#endif diff --git a/cpufreq/CMakeLists.txt b/cpufreq/CMakeLists.txt index b8e576c..a96a743 100644 --- a/cpufreq/CMakeLists.txt +++ b/cpufreq/CMakeLists.txt @@ -7,10 +7,10 @@ set(SOURCES add_executable(${TARGET} ${SOURCES} ${DBUS_SOURCES}) target_link_libraries(${TARGET} - Qt5::Core - Qt5::Quick - Qt5::DBus - Qt5::X11Extras + Qt6::Core + Qt6::Quick + Qt6::DBus + Qt6::Gui ) configure_file( diff --git a/cupdatecursor/CMakeLists.txt b/cupdatecursor/CMakeLists.txt index d88080d..45e0555 100644 --- a/cupdatecursor/CMakeLists.txt +++ b/cupdatecursor/CMakeLists.txt @@ -1,13 +1,12 @@ -find_package(Qt5 COMPONENTS Core Gui X11Extras REQUIRED) +find_package(Qt6 COMPONENTS Core Gui REQUIRED) find_package(X11) add_executable(cupdatecursor main.cpp ) target_link_libraries(cupdatecursor - Qt5::Core - Qt5::Gui - Qt5::X11Extras + Qt6::Core + Qt6::Gui ${X11_LIBRARIES} X11::X11 X11::Xi diff --git a/gmenuproxy/CMakeLists.txt b/gmenuproxy/CMakeLists.txt index 63a3804..052ed3d 100644 --- a/gmenuproxy/CMakeLists.txt +++ b/gmenuproxy/CMakeLists.txt @@ -1,6 +1,6 @@ find_package(AppMenuGtkModule) -find_package(KF5WindowSystem) -find_package(KF5CoreAddons) +find_package(KF6WindowSystem) +find_package(KF6CoreAddons) set_package_properties(AppMenuGtkModule PROPERTIES TYPE RUNTIME) add_definitions(-DQT_NO_CAST_TO_ASCII @@ -34,12 +34,12 @@ add_executable(cutefish-gmenuproxy ${GMENU_DBUSMENU_PROXY_SRCS}) set_package_properties(XCB PROPERTIES TYPE REQUIRED) target_link_libraries(cutefish-gmenuproxy - Qt5::Core - Qt5::X11Extras - Qt5::DBus - Qt5::Widgets - KF5::CoreAddons - KF5::WindowSystem + Qt6::Core + Qt6::Gui + Qt6::DBus + Qt6::Widgets + KF6::CoreAddons + KF6::WindowSystem XCB::XCB ) diff --git a/gmenuproxy/actions.h b/gmenuproxy/actions.h index a0de1c4..a558e65 100644 --- a/gmenuproxy/actions.h +++ b/gmenuproxy/actions.h @@ -8,11 +8,10 @@ #include #include +#include #include "gdbusmenutypes_p.h" -class QStringList; - class Actions : public QObject { Q_OBJECT diff --git a/gmenuproxy/dbusmenuadaptor.h b/gmenuproxy/dbusmenuadaptor.h index 3a877c9..60e2e93 100644 --- a/gmenuproxy/dbusmenuadaptor.h +++ b/gmenuproxy/dbusmenuadaptor.h @@ -13,6 +13,7 @@ #define DBUSMENUADAPTOR_H #include +#include #include #include "window.h" QT_BEGIN_NAMESPACE @@ -20,7 +21,6 @@ class QByteArray; template class QList; template class QMap; class QString; -class QStringList; class QVariant; QT_END_NAMESPACE diff --git a/gmenuproxy/menu.cpp b/gmenuproxy/menu.cpp index ab20049..044a1c1 100644 --- a/gmenuproxy/menu.cpp +++ b/gmenuproxy/menu.cpp @@ -107,7 +107,9 @@ void Menu::stop(const QList &ids) // TODO is there a nicer algorithm for that? // TODO remove all m_menus also? m_subscriptions.erase( - std::remove_if(m_subscriptions.begin(), m_subscriptions.end(), std::bind(&QList::contains, m_subscriptions, std::placeholders::_1)), + std::remove_if(m_subscriptions.begin(), m_subscriptions.end(), [ids](uint subscription) { + return ids.contains(subscription); + }), m_subscriptions.end()); if (m_subscriptions.isEmpty()) { diff --git a/gmenuproxy/menuproxy.cpp b/gmenuproxy/menuproxy.cpp index 5ad98f2..24d9dd3 100644 --- a/gmenuproxy/menuproxy.cpp +++ b/gmenuproxy/menuproxy.cpp @@ -20,7 +20,9 @@ // #include #include // #include -#include +#include +#include +#include #include #include @@ -109,10 +111,10 @@ bool MenuProxy::init() enableGtkSettings(true); - connect(KWindowSystem::self(), &KWindowSystem::windowAdded, this, &MenuProxy::onWindowAdded); - connect(KWindowSystem::self(), &KWindowSystem::windowRemoved, this, &MenuProxy::onWindowRemoved); + connect(KX11Extras::self(), &KX11Extras::windowAdded, this, &MenuProxy::onWindowAdded); + connect(KX11Extras::self(), &KX11Extras::windowRemoved, this, &MenuProxy::onWindowRemoved); - const auto windows = KWindowSystem::windows(); + const auto windows = KX11Extras::windows(); for (WId id : windows) { onWindowAdded(id); } @@ -130,8 +132,8 @@ void MenuProxy::teardown() QDBusConnection::sessionBus().unregisterService(s_ourServiceName); - disconnect(KWindowSystem::self(), &KWindowSystem::windowAdded, this, &MenuProxy::onWindowAdded); - disconnect(KWindowSystem::self(), &KWindowSystem::windowRemoved, this, &MenuProxy::onWindowRemoved); + disconnect(KX11Extras::self(), &KX11Extras::windowAdded, this, &MenuProxy::onWindowAdded); + disconnect(KX11Extras::self(), &KX11Extras::windowRemoved, this, &MenuProxy::onWindowRemoved); qDeleteAll(m_windows); m_windows.clear(); diff --git a/gmenuproxy/window.cpp b/gmenuproxy/window.cpp index ca5762e..7989de4 100644 --- a/gmenuproxy/window.cpp +++ b/gmenuproxy/window.cpp @@ -424,7 +424,7 @@ uint Window::GetLayout(int parentId, int recursionDepth, const QStringList &prop if (!m_currentMenu->hasSubscription(subscription)) { // let's serve multiple similar requests in one go once we've processed them - m_pendingGetLayouts.insertMulti(subscription, message()); + m_pendingGetLayouts.insert(subscription, message()); setDelayedReply(true); m_currentMenu->start(subscription); diff --git a/gmenuproxy/window.h b/gmenuproxy/window.h index d4cadca..053b41a 100644 --- a/gmenuproxy/window.h +++ b/gmenuproxy/window.h @@ -7,6 +7,7 @@ #pragma once #include +#include #include #include #include @@ -111,7 +112,7 @@ private: QString m_proxyObjectPath; // our object path on this proxy app - QHash m_pendingGetLayouts; + QMultiHash m_pendingGetLayouts; Menu *m_applicationMenu = nullptr; Menu *m_menuBar = nullptr; diff --git a/notificationd/CMakeLists.txt b/notificationd/CMakeLists.txt index 3762ae0..436eaf6 100644 --- a/notificationd/CMakeLists.txt +++ b/notificationd/CMakeLists.txt @@ -17,19 +17,19 @@ set(SRCS main.cpp # for Ubuntu # qt_add_dbus_adaptor(SRCS org.freedesktop.Notifications.xml notificationserver.h NotificationServer) -qt5_add_dbus_adaptor(DBUS_SOURCES com.cutefish.Notification.xml application.h Application) +qt6_add_dbus_adaptor(DBUS_SOURCES com.cutefish.Notification.xml application.h Application) set_source_files_properties(${DBUS_SOURCES} PROPERTIES SKIP_AUTOGEN ON) -find_package(KF5WindowSystem) +find_package(KF6WindowSystem) add_executable(cutefish-notificationd ${SRCS} ${DBUS_SOURCES}) target_link_libraries(cutefish-notificationd - Qt5::Core - Qt5::DBus - Qt5::Quick - Qt5::Widgets - KF5::WindowSystem + Qt6::Core + Qt6::DBus + Qt6::Quick + Qt6::Widgets + KF6::WindowSystem ) install(TARGETS cutefish-notificationd @@ -38,7 +38,7 @@ install(TARGETS cutefish-notificationd ) file(GLOB TS_FILES translations/*.ts) -qt5_add_translation(QM_FILES ${TS_FILES}) +qt6_add_translation(QM_FILES ${TS_FILES}) add_custom_target(notificationd_translations DEPENDS ${QM_FILES} SOURCES ${TS_FILES}) add_dependencies(cutefish-notificationd notificationd_translations) diff --git a/notificationd/datehelper.cpp b/notificationd/datehelper.cpp index 396fd01..3c04a26 100644 --- a/notificationd/datehelper.cpp +++ b/notificationd/datehelper.cpp @@ -1,5 +1,6 @@ #include "datehelper.h" #include +#include DateHelper::DateHelper(QObject *parent) : QObject(parent) { @@ -30,5 +31,5 @@ QString DateHelper::friendlyTime(const QDateTime &time) else if (days <= 10) return tr("%1 days ago").arg(days); - return time.toString(Qt::DefaultLocaleShortDate); + return QLocale().toString(time, QLocale::ShortFormat); } diff --git a/notificationd/dbus/notificationsadaptor.h b/notificationd/dbus/notificationsadaptor.h index b6d265f..81ae041 100644 --- a/notificationd/dbus/notificationsadaptor.h +++ b/notificationd/dbus/notificationsadaptor.h @@ -13,6 +13,7 @@ #define NOTIFICATIONSADAPTOR_H #include +#include #include #include "notificationserver.h" QT_BEGIN_NAMESPACE @@ -20,7 +21,6 @@ class QByteArray; template class QList; template class QMap; class QString; -class QStringList; class QVariant; QT_END_NAMESPACE diff --git a/notificationd/historymodel.cpp b/notificationd/historymodel.cpp index 8151bfd..4cbcf03 100644 --- a/notificationd/historymodel.cpp +++ b/notificationd/historymodel.cpp @@ -18,6 +18,8 @@ */ #include "historymodel.h" + +#include #include "datehelper.h" #include diff --git a/notificationd/notificationpopup.cpp b/notificationd/notificationpopup.cpp index 05e7c84..8a7eeb8 100644 --- a/notificationd/notificationpopup.cpp +++ b/notificationd/notificationpopup.cpp @@ -21,8 +21,9 @@ #include -#include +#include #include +#include NotificationPopup::NotificationPopup(QQuickView *parent) : QQuickView(parent) @@ -36,7 +37,7 @@ NotificationPopup::NotificationPopup(QQuickView *parent) bool NotificationPopup::eventFilter(QObject *object, QEvent *event) { if (event->type() == QEvent::Show) { - KWindowSystem::setState(winId(), NET::SkipTaskbar | NET::SkipPager | NET::SkipSwitcher); + KX11Extras::setState(winId(), NET::SkipTaskbar | NET::SkipPager | NET::SkipSwitcher); } return QObject::eventFilter(object, event); diff --git a/notificationd/notificationwindow.cpp b/notificationd/notificationwindow.cpp index 08d7bc4..7710e39 100644 --- a/notificationd/notificationwindow.cpp +++ b/notificationd/notificationwindow.cpp @@ -23,8 +23,9 @@ #include -#include +#include #include +#include NotificationWindow::NotificationWindow(QQuickView *parent) : QQuickView(parent) @@ -65,7 +66,7 @@ bool NotificationWindow::eventFilter(QObject *object, QEvent *event) QQuickView::setVisible(false); } } else if (event->type() == QEvent::Show) { - KWindowSystem::setState(winId(), NET::SkipTaskbar | NET::SkipPager | NET::SkipSwitcher); + KX11Extras::setState(winId(), NET::SkipTaskbar | NET::SkipPager | NET::SkipSwitcher); HistoryModel::self()->updateTime(); } else if (event->type() == QEvent::Hide) { setMouseGrabEnabled(false); diff --git a/notificationd/qml/NotificationWindow.qml b/notificationd/qml/NotificationWindow.qml index 0c52731..d409222 100644 --- a/notificationd/qml/NotificationWindow.qml +++ b/notificationd/qml/NotificationWindow.qml @@ -22,7 +22,7 @@ import QtQml 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 import QtQuick.Window 2.12 -import QtGraphicalEffects 1.0 +import Qt5Compat.GraphicalEffects import FishUI 1.0 as FishUI import Cutefish.Notification 1.0 diff --git a/notificationd/qml/QmlNotificationPopup.qml b/notificationd/qml/QmlNotificationPopup.qml index 7f99e96..f7da30a 100644 --- a/notificationd/qml/QmlNotificationPopup.qml +++ b/notificationd/qml/QmlNotificationPopup.qml @@ -21,7 +21,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 import QtQuick.Window 2.12 -import QtGraphicalEffects 1.0 +import Qt5Compat.GraphicalEffects import FishUI 1.0 as FishUI import Cutefish.Notification 1.0 diff --git a/notificationd/qml/main.qml b/notificationd/qml/main.qml index 18fa5cf..0ec5afd 100644 --- a/notificationd/qml/main.qml +++ b/notificationd/qml/main.qml @@ -9,7 +9,7 @@ import QtQml 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 import QtQuick.Window 2.12 -import QtGraphicalEffects 1.0 +import Qt5Compat.GraphicalEffects import FishUI 1.0 as FishUI import Cutefish.Notification 1.0 diff --git a/polkit-agent/CMakeLists.txt b/polkit-agent/CMakeLists.txt index a70f9d7..537aa61 100644 --- a/polkit-agent/CMakeLists.txt +++ b/polkit-agent/CMakeLists.txt @@ -2,7 +2,7 @@ find_package(PkgConfig) pkg_check_modules(POLKIT_AGENT REQUIRED polkit-agent-1) message(STATUS "polkit agent: ${POLKIT_AGENT_INCLUDE_DIRS} ${POLKIT_AGENT_LIBRARIES}") -find_package(PolkitQt5-1 REQUIRED) +find_package(PolkitQt6-1 REQUIRED) include_directories( ${POLKIT_AGENT_INCLUDE_DIRS} @@ -17,10 +17,10 @@ add_executable(cutefish-polkit-agent ) target_link_libraries(cutefish-polkit-agent - Qt5::Core - Qt5::Widgets - Qt5::Quick - Qt5::QuickControls2 + Qt6::Core + Qt6::Widgets + Qt6::Quick + Qt6::QuickControls2 # FishUI @@ -30,7 +30,7 @@ target_link_libraries(cutefish-polkit-agent ) file(GLOB TS_FILES translations/*.ts) -qt5_add_translation(QM_FILES ${TS_FILES}) +qt6_add_translation(QM_FILES ${TS_FILES}) add_custom_target(polkit-agent-translations DEPENDS ${QM_FILES} SOURCES ${TS_FILES}) add_dependencies(cutefish-polkit-agent polkit-agent-translations) diff --git a/polkit-agent/dialog.cpp b/polkit-agent/dialog.cpp index 142f8fd..8cb778b 100644 --- a/polkit-agent/dialog.cpp +++ b/polkit-agent/dialog.cpp @@ -43,7 +43,6 @@ Dialog::Dialog(const QString &action, const QString &message, m_view->rootContext()->setContextProperty("confirmation", this); m_view->rootContext()->setContextProperty("rootWindow", m_view); m_view->setResizeMode(QQuickView::SizeViewToRootObject); - m_view->setClearBeforeRendering(true); m_view->setDefaultAlphaBuffer(true); m_view->setColor(Qt::transparent); m_view->setSource(QUrl(QStringLiteral("qrc:/main.qml"))); diff --git a/powerman/CMakeLists.txt b/powerman/CMakeLists.txt index 826f080..8af828b 100644 --- a/powerman/CMakeLists.txt +++ b/powerman/CMakeLists.txt @@ -1,7 +1,7 @@ project(cutefish-powerman) set(TARGET cutefish-powerman) -find_package(KF5IdleTime) +find_package(KF6IdleTime) find_package(X11) find_package(XCB REQUIRED COMPONENTS @@ -25,10 +25,10 @@ set(SOURCES cpu/cpumanagement.cpp ) -qt5_add_dbus_adaptor(DBUS_SOURCES +qt6_add_dbus_adaptor(DBUS_SOURCES cpu/com.cutefish.CPUManagement.xml cpu/cpumanagement.h CPUManagement) -qt5_add_dbus_adaptor(DBUS_SOURCES +qt6_add_dbus_adaptor(DBUS_SOURCES com.cutefish.PowerManager.xml application.h Application) qt_add_dbus_interface(DBUS_SOURCES org.freedesktop.ScreenSaver.xml screenlocker_interface) @@ -36,14 +36,13 @@ set_source_files_properties(${DBUS_SOURCES} PROPERTIES SKIP_AUTOGEN ON) add_executable(${TARGET} ${SOURCES} ${DBUS_SOURCES}) target_link_libraries(${TARGET} - Qt5::Core - Qt5::Gui - Qt5::Widgets - Qt5::Quick - Qt5::DBus - Qt5::X11Extras + Qt6::Core + Qt6::Gui + Qt6::Widgets + Qt6::Quick + Qt6::DBus - KF5::IdleTime + KF6::IdleTime ${XCB_LIBS} ${X11_LIBRARIES} ) diff --git a/screen-brightness/CMakeLists.txt b/screen-brightness/CMakeLists.txt index 40c99bb..d99c494 100644 --- a/screen-brightness/CMakeLists.txt +++ b/screen-brightness/CMakeLists.txt @@ -12,9 +12,9 @@ add_executable(${PROJECT_NAME} ) target_link_libraries(${PROJECT_NAME} - Qt5::Core - Qt5::Gui - Qt5::Widgets + Qt6::Core + Qt6::Gui + Qt6::Widgets ) configure_file( diff --git a/sddm-helper/CMakeLists.txt b/sddm-helper/CMakeLists.txt index a694795..eedd546 100644 --- a/sddm-helper/CMakeLists.txt +++ b/sddm-helper/CMakeLists.txt @@ -10,8 +10,8 @@ add_executable(${PROJECT_NAME} ) target_link_libraries(${PROJECT_NAME} - Qt5::Core - Qt5::Gui + Qt6::Core + Qt6::Gui ) configure_file( diff --git a/session/CMakeLists.txt b/session/CMakeLists.txt index 9fdfead..159974b 100644 --- a/session/CMakeLists.txt +++ b/session/CMakeLists.txt @@ -12,23 +12,22 @@ set(SOURCES powermanager/powerproviders.cpp ) -qt5_add_dbus_adaptor(DBUS_SOURCES +qt6_add_dbus_adaptor(DBUS_SOURCES com.cutefish.Session.xml application.h Application sessionadaptor SessionAdaptor) set_source_files_properties(${DBUS_SOURCES} PROPERTIES SKIP_AUTOGEN ON) -find_package(KF5WindowSystem) +find_package(KF6WindowSystem) add_executable(${TARGET} ${SOURCES} ${DBUS_SOURCES}) target_link_libraries(${TARGET} - Qt5::Core - Qt5::Gui - Qt5::Widgets - Qt5::Quick - Qt5::DBus - Qt5::X11Extras - KF5::WindowSystem + Qt6::Core + Qt6::Gui + Qt6::Widgets + Qt6::Quick + Qt6::DBus + KF6::WindowSystem ) install(TARGETS ${TARGET} DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/session/processmanager.cpp b/session/processmanager.cpp index 2fba357..67cc012 100644 --- a/session/processmanager.cpp +++ b/session/processmanager.cpp @@ -35,7 +35,7 @@ #include #include -#include +#include ProcessManager::ProcessManager(Application *app, QObject *parent) : QObject(parent) @@ -192,7 +192,6 @@ void ProcessManager::loadAutoStartProcess() const QStringList fileNames = d.entryList(QStringList() << QStringLiteral("*.desktop")); for (const QString &file : fileNames) { QSettings desktop(d.absoluteFilePath(file), QSettings::IniFormat); - desktop.setIniCodec("UTF-8"); desktop.beginGroup("Desktop Entry"); if (desktop.contains("OnlyShowIn")) @@ -224,7 +223,7 @@ void ProcessManager::loadAutoStartProcess() } } -bool ProcessManager::nativeEventFilter(const QByteArray &eventType, void *message, long *result) +bool ProcessManager::nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) { if (eventType != "xcb_generic_event_t") // We only want to handle XCB events return false; diff --git a/session/processmanager.h b/session/processmanager.h index e78974e..1c9eb94 100644 --- a/session/processmanager.h +++ b/session/processmanager.h @@ -43,7 +43,7 @@ public: void startDaemonProcess(); void loadAutoStartProcess(); - bool nativeEventFilter(const QByteArray & eventType, void * message, long * result) override; + bool nativeEventFilter(const QByteArray & eventType, void * message, qintptr * result) override; private: Application *m_app; diff --git a/settings-daemon/CMakeLists.txt b/settings-daemon/CMakeLists.txt index cf415ef..e879e3d 100644 --- a/settings-daemon/CMakeLists.txt +++ b/settings-daemon/CMakeLists.txt @@ -36,37 +36,36 @@ set(HEADERS "") set(FORMS "") set(RESOURCES "") -qt5_add_dbus_adaptor(DBUS_SOURCES +qt6_add_dbus_adaptor(DBUS_SOURCES brightness/com.cutefish.Brightness.xml brightness/brightnessmanager.h BrightnessManager) -qt5_add_dbus_adaptor(DBUS_SOURCES +qt6_add_dbus_adaptor(DBUS_SOURCES theme/com.cutefish.Theme.xml theme/thememanager.h ThemeManager) -qt5_add_dbus_adaptor(DBUS_SOURCES +qt6_add_dbus_adaptor(DBUS_SOURCES battery/com.cutefish.PrimaryBattery.xml battery/battery.h Battery) -qt5_add_dbus_adaptor(DBUS_SOURCES +qt6_add_dbus_adaptor(DBUS_SOURCES language/com.cutefish.Language.xml language/language.h Language) -qt5_add_dbus_adaptor(DBUS_SOURCES +qt6_add_dbus_adaptor(DBUS_SOURCES dock/com.cutefish.Dock.xml dock/dock.h Dock) -qt5_add_dbus_adaptor(DBUS_SOURCES +qt6_add_dbus_adaptor(DBUS_SOURCES mouse/com.cutefish.Mouse.xml mouse/mousemanager.h Mouse) -qt5_add_dbus_adaptor(DBUS_SOURCES +qt6_add_dbus_adaptor(DBUS_SOURCES touchpad/com.cutefish.Touchpad.xml touchpad/touchpadmanager.h TouchpadManager) set_source_files_properties(${DBUS_SOURCES} PROPERTIES SKIP_AUTOGEN ON) add_executable(${TARGET} ${SOURCES} ${DBUS_SOURCES} ${HEADERS} ${FORMS} ${RESOURCES}) target_link_libraries(${TARGET} - Qt5::Core - Qt5::Gui - Qt5::Widgets - Qt5::DBus - Qt5::X11Extras - Qt5::Xml + Qt6::Core + Qt6::Gui + Qt6::Widgets + Qt6::DBus + Qt6::Xml ${X11_LIBRARIES} X11::X11 X11::Xi @@ -79,7 +78,7 @@ target_link_libraries(${TARGET} ) file(GLOB TS_FILES translations/*.ts) -qt5_add_translation(QM_FILES ${TS_FILES}) +qt6_add_translation(QM_FILES ${TS_FILES}) add_custom_target(translations DEPENDS ${QM_FILES} SOURCES ${TS_FILES}) add_dependencies(${TARGET} translations) diff --git a/settings-daemon/theme/thememanager.cpp b/settings-daemon/theme/thememanager.cpp index 96eddd7..947cbbf 100644 --- a/settings-daemon/theme/thememanager.cpp +++ b/settings-daemon/theme/thememanager.cpp @@ -335,7 +335,6 @@ void ThemeManager::updateGtk3Config() { QSettings settings(gtk3SettingsIniPath(), QSettings::IniFormat); settings.clear(); - settings.setIniCodec("UTF-8"); settings.beginGroup("Settings"); // font diff --git a/settings-daemon/touchpad/x11/xlibbackend.cpp b/settings-daemon/touchpad/x11/xlibbackend.cpp index 0824bbe..e558edd 100644 --- a/settings-daemon/touchpad/x11/xlibbackend.cpp +++ b/settings-daemon/touchpad/x11/xlibbackend.cpp @@ -292,7 +292,7 @@ void XlibBackend::setTouchpadOff(XlibBackend::TouchpadOffState state) bool XlibBackend::isTouchpadAvailable() { - return m_device; + return !m_device.isNull(); } bool XlibBackend::isTouchpadEnabled() @@ -337,7 +337,7 @@ void XlibBackend::devicePlugged(int device) if (m_device) { qWarning() << "Touchpad reset"; m_notifications.reset(); - watchForEvents(m_keyboard); + watchForEvents(!m_keyboard.isNull()); Q_EMIT touchpadReset(); } } diff --git a/shutdown-ui/CMakeLists.txt b/shutdown-ui/CMakeLists.txt index 39b7faf..1090d83 100644 --- a/shutdown-ui/CMakeLists.txt +++ b/shutdown-ui/CMakeLists.txt @@ -7,15 +7,15 @@ add_executable(cutefish-shutdown ) target_link_libraries(cutefish-shutdown - Qt5::Core - Qt5::Widgets - Qt5::Quick - Qt5::QuickControls2 - Qt5::DBus + Qt6::Core + Qt6::Widgets + Qt6::Quick + Qt6::QuickControls2 + Qt6::DBus ) file(GLOB TS_FILES translations/*.ts) -qt5_add_translation(QM_FILES ${TS_FILES}) +qt6_add_translation(QM_FILES ${TS_FILES}) add_custom_target(shutdown-translations DEPENDS ${QM_FILES} SOURCES ${TS_FILES}) add_dependencies(cutefish-shutdown shutdown-translations) install(FILES ${QM_FILES} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cutefish-shutdown/translations) diff --git a/shutdown-ui/IconButton.qml b/shutdown-ui/IconButton.qml index 964dbc6..722dbfc 100644 --- a/shutdown-ui/IconButton.qml +++ b/shutdown-ui/IconButton.qml @@ -20,7 +20,7 @@ import QtQuick 2.0 import QtQuick.Controls 2.5 import QtQuick.Layouts 1.3 -import QtGraphicalEffects 1.0 +import Qt5Compat.GraphicalEffects import FishUI 1.0 as FishUI Item { diff --git a/shutdown-ui/main.qml b/shutdown-ui/main.qml index 98df2fe..443311a 100644 --- a/shutdown-ui/main.qml +++ b/shutdown-ui/main.qml @@ -21,7 +21,7 @@ import QtQuick 2.12 import QtQuick.Window 2.3 import QtQuick.Controls 2.5 import QtQuick.Layouts 1.3 -import QtGraphicalEffects 1.0 +import Qt5Compat.GraphicalEffects import Cutefish.Accounts 1.0 as Accounts import Cutefish.System 1.0 as System diff --git a/xembed-sni-proxy/CMakeLists.txt b/xembed-sni-proxy/CMakeLists.txt index 0e72bc1..9018318 100644 --- a/xembed-sni-proxy/CMakeLists.txt +++ b/xembed-sni-proxy/CMakeLists.txt @@ -18,7 +18,7 @@ if(X11_FOUND) message(FATAL_ERROR "\nThe X11 Session Management (SM) development package could not be found.\nPlease install libSM.\n") endif(NOT X11_SM_FOUND) - find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS X11Extras) + find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Gui) endif() if(X11_FOUND AND XCB_XCB_FOUND) @@ -37,7 +37,7 @@ find_package(XCB IMAGE ) -find_package(KF5WindowSystem) +find_package(KF6WindowSystem) set(XCB_LIBS XCB::XCB @@ -59,20 +59,20 @@ set(XEMBED_SNI_PROXY_SOURCES xtestsender.cpp ) -qt5_add_dbus_adaptor(DBUS_SOURCES org.kde.StatusNotifierItem.xml +qt6_add_dbus_adaptor(DBUS_SOURCES org.kde.StatusNotifierItem.xml sniproxy.h SNIProxy) set(statusnotifierwatcher_xml org.kde.StatusNotifierWatcher.xml) -qt5_add_dbus_interface(DBUS_SOURCES ${statusnotifierwatcher_xml} statusnotifierwatcher_interface) +qt6_add_dbus_interface(DBUS_SOURCES ${statusnotifierwatcher_xml} statusnotifierwatcher_interface) set_source_files_properties(${DBUS_SOURCES} PROPERTIES SKIP_AUTOGEN ON) add_executable(cutefish-xembedsniproxy ${XEMBED_SNI_PROXY_SOURCES} ${DBUS_SOURCES}) set_package_properties(XCB PROPERTIES TYPE REQUIRED) target_link_libraries(cutefish-xembedsniproxy - Qt5::Core - Qt5::X11Extras - Qt5::DBus - KF5::WindowSystem + Qt6::Core + Qt6::Gui + Qt6::DBus + KF6::WindowSystem ${XCB_LIBS} ${X11_XTest_LIB} ) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index 495b880..84b8940 100644 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -100,7 +100,7 @@ bool FdoSelectionManager::addDamageWatch(xcb_window_t client) return true; } -bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *message, long int *result) +bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) { Q_UNUSED(result) diff --git a/xembed-sni-proxy/fdoselectionmanager.h b/xembed-sni-proxy/fdoselectionmanager.h index 16695e2..96d5519 100644 --- a/xembed-sni-proxy/fdoselectionmanager.h +++ b/xembed-sni-proxy/fdoselectionmanager.h @@ -25,7 +25,7 @@ public: ~FdoSelectionManager() override; protected: - bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override; + bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) override; private Q_SLOTS: void onClaimedOwnership(); diff --git a/xembed-sni-proxy/sniproxy.cpp b/xembed-sni-proxy/sniproxy.cpp index 6faeb8e..498eb29 100644 --- a/xembed-sni-proxy/sniproxy.cpp +++ b/xembed-sni-proxy/sniproxy.cpp @@ -23,6 +23,7 @@ #include #include +#include #include #include "statusnotifieritemadaptor.h" diff --git a/xembed-sni-proxy/sniproxy.h b/xembed-sni-proxy/sniproxy.h index 1fd69f2..ddb87c2 100644 --- a/xembed-sni-proxy/sniproxy.h +++ b/xembed-sni-proxy/sniproxy.h @@ -18,6 +18,13 @@ #include #include +#ifdef Status +#undef Status +#endif +#ifdef None +#undef None +#endif + #include "snidbus.h" class SNIProxy : public QObject