From b757369de98e13b999847a85b51bd59f84d73ad3 Mon Sep 17 00:00:00 2001 From: luoxueyi Date: Fri, 15 Dec 2023 16:33:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dwayland=E4=B8=8B=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E9=97=AE=E9=A2=98=E4=B8=8D=E6=AD=A3=E7=A1=AE=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/control | 7 ++++-- .../kylin-update-notify-immutable.pro | 2 +- .../src/updatehandle.cpp | 4 ++-- .../src/updatewidget.cpp | 24 +++++++++++++++---- .../src/updatewidget.h | 3 +++ kylin-update-notify/kylin-update-notify.pro | 2 +- kylin-update-notify/src/updatehandle.cpp | 4 ++-- kylin-update-notify/src/updatewidget.cpp | 24 +++++++++++++++---- kylin-update-notify/src/updatewidget.h | 3 +++ 9 files changed, 57 insertions(+), 16 deletions(-) diff --git a/debian/control b/debian/control index ccb0ba5..1c24a3f 100644 --- a/debian/control +++ b/debian/control @@ -19,6 +19,7 @@ Build-Depends: debhelper-compat(=12), libkf5windowsystem5, libkf5windowsystem-doc, libukui-log4qt-dev, + libkysdk-waylandhelper-dev Standards-Version: 4.1.3 Package: kylin-update-notify @@ -26,7 +27,8 @@ Architecture: any Section: universe/admin Priority: optional Depends: ${shlibs:Depends}, - kylin-system-updater ( >= 2.0.5.1 ) + kylin-system-updater ( >= 2.0.5.1 ), + libkysdk-waylandhelper Conflicts: kylin-background-upgrade,kylin-update-tray,kylin-update-notify-immutable Breaks: kylin-background-upgrade,kylin-update-tray Description: kylin update notify @@ -36,7 +38,8 @@ Architecture: any Section: universe/admin Priority: optional Depends: ${shlibs:Depends}, - kylin-system-updater-immutable + kylin-system-updater-immutable, + libkysdk-waylandhelper Conflicts: kylin-background-upgrade,kylin-update-tray,kylin-update-notify Provides:kylin-update-notify Replaces:kylin-update-notify diff --git a/kylin-update-notify-immutable/kylin-update-notify-immutable.pro b/kylin-update-notify-immutable/kylin-update-notify-immutable.pro index fa1a28f..450bff3 100644 --- a/kylin-update-notify-immutable/kylin-update-notify-immutable.pro +++ b/kylin-update-notify-immutable/kylin-update-notify-immutable.pro @@ -30,7 +30,7 @@ HEADERS += \ TRANSLATIONS += translations/kylin-background-upgrade_zh_CN.ts \ translations/kylin-background-upgrade_bo_CN.ts -PKGCONFIG += gsettings-qt +PKGCONFIG += gsettings-qt kysdk-waylandhelper FORMS += \ ./src/updatewidget.ui diff --git a/kylin-update-notify-immutable/src/updatehandle.cpp b/kylin-update-notify-immutable/src/updatehandle.cpp index 473bc55..8e04ed5 100644 --- a/kylin-update-notify-immutable/src/updatehandle.cpp +++ b/kylin-update-notify-immutable/src/updatehandle.cpp @@ -115,7 +115,7 @@ void updatehandle::tray_Show() qDebug()<<"m_getsql 的值为true"; choice_window->update_lab->setText(tr("System update")); if (argnum != "update") { - choice_window->show(); + choice_window->updateWidgetShow(); } } else { qDebug()<<"更新管理器关闭检测更新,托盘程序结束"; @@ -354,7 +354,7 @@ void updatehandle::UpdateDectSlot(bool status,QStringList list,QString errorstri } else { choice_window->update_lab->setText(tr("System update")); if (argnum != "update") { - choice_window->show(); + choice_window->updateWidgetShow(); } } } diff --git a/kylin-update-notify-immutable/src/updatewidget.cpp b/kylin-update-notify-immutable/src/updatewidget.cpp index 318a314..054dd15 100644 --- a/kylin-update-notify-immutable/src/updatewidget.cpp +++ b/kylin-update-notify-immutable/src/updatewidget.cpp @@ -3,6 +3,9 @@ #include #include #include +#include "ukuistylehelper/ukuistylehelper.h" +#include "windowmanager/windowmanager.h" + #define PANEL_DBUS_SERVICE "com.ukui.panel.desktop" #define PANEL_DBUS_PATH "/" #define PANEL_DBUS_INTERFACE "com.ukui.panel.desktop" @@ -24,6 +27,7 @@ updatewidget::updatewidget(bool check_Tips, QWidget *parent) : initPanelDbusGsetting(); GetsAvailableAreaScreen(); qDebug()<<"not wayland"; + bIsWayland = false; } else { //注释掉的是原先的接口,已经废除。采用原本的获取方式 // initset_window_position(); @@ -31,6 +35,7 @@ updatewidget::updatewidget(bool check_Tips, QWidget *parent) : initPanelDbusGsetting(); GetsAvailableAreaScreen(); qDebug()<<"wayland"; + bIsWayland = true; } _check_Tips = check_Tips; //设置任务栏无显示 @@ -153,6 +158,17 @@ updatewidget::~updatewidget() delete ui; } +void updatewidget::updateWidgetShow() +{ + this->show(); + qDebug()<<"should show:"<windowHandle(), updateWidgetRect); + else + this->setGeometry(updateWidgetRect); +} + void updatewidget::onClick_close_btn() { // emit disAgreeBtnSignals(); @@ -281,26 +297,26 @@ void updatewidget::GetsAvailableAreaScreen() { case updatewidget::PanelDown : { - this->setGeometry(m_nScreenWidth - 445,m_nScreenHeight - h - 170,300,150-100); qDebug()<<"Taskbar coordinates: [ '"<setGeometry(m_nScreenWidth - 445,m_nScreenHeight - 170,300,150-100); qDebug()<<"任务栏在上方: 显示坐标为: "<setGeometry(m_nScreenWidth - 445,m_nScreenHeight - 170,300,150-100); qDebug()<<"任务栏在左侧: 显示坐标为: "<setGeometry(m_nScreenWidth - 445 - h,m_nScreenHeight - 170,300,150-100); qDebug()<<"任务栏在右侧: 显示坐标为: "<update_lab->setText(tr("System update")); if (argnum != "update") { - choice_window->show(); + choice_window->updateWidgetShow(); } } else { qDebug()<<"更新管理器关闭检测更新,托盘程序结束"; @@ -354,7 +354,7 @@ void updatehandle::UpdateDectSlot(bool status,QStringList list,QString errorstri } else { choice_window->update_lab->setText(tr("System update")); if (argnum != "update") { - choice_window->show(); + choice_window->updateWidgetShow(); } } } diff --git a/kylin-update-notify/src/updatewidget.cpp b/kylin-update-notify/src/updatewidget.cpp index 318a314..054dd15 100644 --- a/kylin-update-notify/src/updatewidget.cpp +++ b/kylin-update-notify/src/updatewidget.cpp @@ -3,6 +3,9 @@ #include #include #include +#include "ukuistylehelper/ukuistylehelper.h" +#include "windowmanager/windowmanager.h" + #define PANEL_DBUS_SERVICE "com.ukui.panel.desktop" #define PANEL_DBUS_PATH "/" #define PANEL_DBUS_INTERFACE "com.ukui.panel.desktop" @@ -24,6 +27,7 @@ updatewidget::updatewidget(bool check_Tips, QWidget *parent) : initPanelDbusGsetting(); GetsAvailableAreaScreen(); qDebug()<<"not wayland"; + bIsWayland = false; } else { //注释掉的是原先的接口,已经废除。采用原本的获取方式 // initset_window_position(); @@ -31,6 +35,7 @@ updatewidget::updatewidget(bool check_Tips, QWidget *parent) : initPanelDbusGsetting(); GetsAvailableAreaScreen(); qDebug()<<"wayland"; + bIsWayland = true; } _check_Tips = check_Tips; //设置任务栏无显示 @@ -153,6 +158,17 @@ updatewidget::~updatewidget() delete ui; } +void updatewidget::updateWidgetShow() +{ + this->show(); + qDebug()<<"should show:"<windowHandle(), updateWidgetRect); + else + this->setGeometry(updateWidgetRect); +} + void updatewidget::onClick_close_btn() { // emit disAgreeBtnSignals(); @@ -281,26 +297,26 @@ void updatewidget::GetsAvailableAreaScreen() { case updatewidget::PanelDown : { - this->setGeometry(m_nScreenWidth - 445,m_nScreenHeight - h - 170,300,150-100); qDebug()<<"Taskbar coordinates: [ '"<setGeometry(m_nScreenWidth - 445,m_nScreenHeight - 170,300,150-100); qDebug()<<"任务栏在上方: 显示坐标为: "<setGeometry(m_nScreenWidth - 445,m_nScreenHeight - 170,300,150-100); qDebug()<<"任务栏在左侧: 显示坐标为: "<setGeometry(m_nScreenWidth - 445 - h,m_nScreenHeight - 170,300,150-100); qDebug()<<"任务栏在右侧: 显示坐标为: "<