From 795038844408a3fa4c8eddb6d9ee57ffbf2d416f Mon Sep 17 00:00:00 2001 From: iaom Date: Wed, 24 Jul 2024 16:25:27 +0800 Subject: [PATCH] =?UTF-8?q?fix(frontend):wlcom=E7=8E=AF=E5=A2=83=E9=80=82?= =?UTF-8?q?=E9=85=8D=E5=A4=9A=E5=B1=8F=E6=98=BE=E7=A4=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/CMakeLists.txt | 2 ++ frontend/mainwindow.cpp | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) 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();