diff --git a/frontend/CMakeLists.txt b/frontend/CMakeLists.txt index 75ba0d7..3af72c1 100644 --- a/frontend/CMakeLists.txt +++ b/frontend/CMakeLists.txt @@ -15,6 +15,7 @@ find_package(QT NAMES Qt6 Qt5 COMPONENTS Core DBus Widgets Xml Concurrent Sql Li find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core DBus Widgets Xml Concurrent Sql LinguistTools X11Extras REQUIRED) find_package(PkgConfig REQUIRED) find_package(KF5WindowSystem) +find_package(ukui-quick COMPONENTS platform REQUIRED) set(UKUI_SEARCH_EXTERNAL_LIBS "") set(UKUI_SEARCH_PC_PKGS gio-2.0 glib-2.0 gio-unix-2.0 kysdk-waylandhelper xapian-core gsettings-qt) @@ -97,6 +98,7 @@ target_link_libraries(frontend PRIVATE kysdk-waylandhelper qtsingleapplication tcmalloc_minimal + ukui-quick::platform ) target_include_directories(frontend PRIVATE diff --git a/frontend/mainwindow.cpp b/frontend/mainwindow.cpp index 8a6227a..e380ba2 100644 --- a/frontend/mainwindow.cpp +++ b/frontend/mainwindow.cpp @@ -33,8 +33,9 @@ #include #include #include -#include "ukuistylehelper/ukuistylehelper.h" -#include "windowmanager/windowmanager.h" +#include +#include +#include #include "global-settings.h" #include "action-transmiter.h" #include "icon-loader.h" @@ -268,7 +269,7 @@ void MainWindow::centerToScreen(QWidget* widget) { if(!widget) return; KWindowSystem::setState(this->winId(),NET::SkipTaskbar | NET::SkipPager | NET::SkipSwitcher); - QRect desk_rect = qApp->screenAt(QCursor::pos())->geometry(); + QRect desk_rect = UkuiQuick::WindowProxy::currentScreen()->geometry(); int desk_x = desk_rect.width(); int desk_y = desk_rect.height(); int x = widget->width();