修复wayland下弹窗问题不正确问题
This commit is contained in:
parent
87b6a4a08a
commit
b757369de9
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
#include <QPainterPath>
|
||||
#include <QToolTip>
|
||||
#include <QHoverEvent>
|
||||
#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:"<<updateWidgetRect;
|
||||
|
||||
if (bIsWayland)
|
||||
kdk::WindowManager::setGeometry(this->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: [ '"<<m_nScreenWidth-445<<"','"<< m_nScreenHeight-h-170<<"','"<<300<<"','"<<150 - 100<<"']";
|
||||
updateWidgetRect = QRect(m_nScreenWidth-445, m_nScreenHeight-h-170, 300, 150-100);
|
||||
}
|
||||
break;
|
||||
case updatewidget::PanelUp:
|
||||
{
|
||||
this->setGeometry(m_nScreenWidth - 445,m_nScreenHeight - 170,300,150-100);
|
||||
qDebug()<<"任务栏在上方: 显示坐标为: "<<m_nScreenWidth - 445 << m_nScreenHeight - 170 << 300 << 150 - 100;
|
||||
updateWidgetRect = QRect(m_nScreenWidth-445, m_nScreenHeight-170, 300, 150-100);
|
||||
}
|
||||
break;
|
||||
case updatewidget::PanelLeft:
|
||||
{
|
||||
this->setGeometry(m_nScreenWidth - 445,m_nScreenHeight - 170,300,150-100);
|
||||
qDebug()<<"任务栏在左侧: 显示坐标为: "<<m_nScreenWidth - 445 << m_nScreenHeight - 170 << 300 << 150 - 100;
|
||||
updateWidgetRect = QRect(m_nScreenWidth-445, m_nScreenHeight-170, 300, 150-100);
|
||||
}
|
||||
break;
|
||||
case updatewidget::PanelRight:
|
||||
{
|
||||
this->setGeometry(m_nScreenWidth - 445 - h,m_nScreenHeight - 170,300,150-100);
|
||||
qDebug()<<"任务栏在右侧: 显示坐标为: "<<m_nScreenWidth - 445 - h << m_nScreenHeight - 170 << 300 << 150 - 100;
|
||||
updateWidgetRect = QRect(m_nScreenWidth-445, m_nScreenHeight-170, 300, 150-100);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -72,6 +72,8 @@ public:
|
|||
int m_nScreenHeight; // 屏幕分辨率的高
|
||||
int m_pPeonySite; // 任务栏位置
|
||||
QSettings *timersettings; //读取timer配置文件
|
||||
QRect updateWidgetRect;
|
||||
bool bIsWayland = false;
|
||||
|
||||
int connectTaskBarDbus();
|
||||
int getPanelSite();
|
||||
|
@ -86,6 +88,7 @@ public:
|
|||
void initPanelDbusGsetting(); // 初始化与任务栏gsetting和dbus
|
||||
bool eventFilter(QObject *, QEvent *); // 添加事件过滤器声明
|
||||
bool _is_openkylin();
|
||||
void updateWidgetShow();
|
||||
|
||||
private:
|
||||
Ui::Form *ui;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
#include <QPainterPath>
|
||||
#include <QToolTip>
|
||||
#include <QHoverEvent>
|
||||
#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:"<<updateWidgetRect;
|
||||
|
||||
if (bIsWayland)
|
||||
kdk::WindowManager::setGeometry(this->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: [ '"<<m_nScreenWidth-445<<"','"<< m_nScreenHeight-h-170<<"','"<<300<<"','"<<150 - 100<<"']";
|
||||
updateWidgetRect = QRect(m_nScreenWidth-445, m_nScreenHeight-h-170, 300, 150-100);
|
||||
}
|
||||
break;
|
||||
case updatewidget::PanelUp:
|
||||
{
|
||||
this->setGeometry(m_nScreenWidth - 445,m_nScreenHeight - 170,300,150-100);
|
||||
qDebug()<<"任务栏在上方: 显示坐标为: "<<m_nScreenWidth - 445 << m_nScreenHeight - 170 << 300 << 150 - 100;
|
||||
updateWidgetRect = QRect(m_nScreenWidth-445, m_nScreenHeight-170, 300, 150-100);
|
||||
}
|
||||
break;
|
||||
case updatewidget::PanelLeft:
|
||||
{
|
||||
this->setGeometry(m_nScreenWidth - 445,m_nScreenHeight - 170,300,150-100);
|
||||
qDebug()<<"任务栏在左侧: 显示坐标为: "<<m_nScreenWidth - 445 << m_nScreenHeight - 170 << 300 << 150 - 100;
|
||||
updateWidgetRect = QRect(m_nScreenWidth-445, m_nScreenHeight-170, 300, 150-100);
|
||||
}
|
||||
break;
|
||||
case updatewidget::PanelRight:
|
||||
{
|
||||
this->setGeometry(m_nScreenWidth - 445 - h,m_nScreenHeight - 170,300,150-100);
|
||||
qDebug()<<"任务栏在右侧: 显示坐标为: "<<m_nScreenWidth - 445 - h << m_nScreenHeight - 170 << 300 << 150 - 100;
|
||||
updateWidgetRect = QRect(m_nScreenWidth-445, m_nScreenHeight-170, 300, 150-100);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -72,6 +72,8 @@ public:
|
|||
int m_nScreenHeight; // 屏幕分辨率的高
|
||||
int m_pPeonySite; // 任务栏位置
|
||||
QSettings *timersettings; //读取timer配置文件
|
||||
QRect updateWidgetRect;
|
||||
bool bIsWayland = false;
|
||||
|
||||
int connectTaskBarDbus();
|
||||
int getPanelSite();
|
||||
|
@ -86,6 +88,7 @@ public:
|
|||
void initPanelDbusGsetting(); // 初始化与任务栏gsetting和dbus
|
||||
bool eventFilter(QObject *, QEvent *); // 添加事件过滤器声明
|
||||
bool _is_openkylin();
|
||||
void updateWidgetShow();
|
||||
|
||||
private:
|
||||
Ui::Form *ui;
|
||||
|
|
Loading…
Reference in New Issue