!78 控制面板多次点击未连接的WiFi,高概率出现密码输入框不显示输入光标

Merge pull request !78 from 李享/openkylin/nile
This commit is contained in:
邓托 2024-08-29 12:35:41 +00:00 committed by openkylin-cibot
parent 960115f980
commit 96a6657b3b
3 changed files with 94 additions and 0 deletions

9
debian/changelog vendored
View File

@ -1,3 +1,12 @@
kylin-nm (4.10.0.0-ok0.9) nile; urgency=medium
* BUG#240566 【兆芯KX6000】【冒烟1级】【WiFi】控制面板多次点击未连接的WiFi高概率出现密码输入框不显示输入光标
* 需求:无
* 其他改动说明:更新翻译
* 其他改动影响域:无
-- lixiang1 <lixiang1@kylinos.cn> Thu, 25 Jul 2024 09:31:57 +0800
kylin-nm (4.10.0.0-ok0.8) nile; urgency=medium
* BUG

84
debian/patches/0060-78-WiFi.patch vendored Normal file
View File

@ -0,0 +1,84 @@
From: =?utf-8?b?6YKT5omY?= <dengtuo@kylinos.cn>
Date: Thu, 29 Aug 2024 12:35:41 +0000
Subject: =?utf-8?b?ITc4IOaOp+WItumdouadv+WkmuasoeeCueWHu+acqui/nuaOpeeahFdp?=
=?utf-8?b?RmnvvIzpq5jmpoLnjoflh7rnjrDlr4bnoIHovpPlhaXmoYbkuI3mmL7npLrovpM=?=
=?utf-8?b?5YWl5YWJ5qCHIE1lcmdlIHB1bGwgcmVxdWVzdCAhNzggZnJvbSDmnY7kuqsvb3Bl?=
=?utf-8?b?bmt5bGluL25pbGU=?=
---
src/frontend/mainwindow.cpp | 49 +++++++++++++++++++++++++++------------------
1 file changed, 30 insertions(+), 19 deletions(-)
diff --git a/src/frontend/mainwindow.cpp b/src/frontend/mainwindow.cpp
index a72ea88..be72f8d 100644
--- a/src/frontend/mainwindow.cpp
+++ b/src/frontend/mainwindow.cpp
@@ -537,31 +537,41 @@ void MainWindow::resetWindowPosition()
#define PANEL_LEFT 2
#define PANEL_RIGHT 3
//#define PANEL_BOTTOM 4
- QRect availableGeo = QGuiApplication::screenAt(QCursor::pos())->geometry();
- int x, y;
- switch(m_panelPosition){
- //任务栏位于上方
- case PANEL_TOP:
- x = availableGeo.x() + availableGeo.width() - this->width() - MARGIN;
- y = availableGeo.y() + m_panelSize + MARGIN;
+#define MARGIN 8
+ QDBusInterface iface("org.ukui.panel",
+ "/panel/position",
+ "org.ukui.panel",
+ QDBusConnection::sessionBus());
+ QDBusReply<QVariantList> reply=iface.call("GetPrimaryScreenGeometry");
+ QVariantList position_list=reply.value();
+
+ /*
+ * 通过这个dbus接口获取到的6个参数分别为 可用屏幕大小的x坐标、y坐标、宽度、高度任务栏位置
+ */
+ QRect rect;
+ switch(reply.value().at(4).toInt()){
+ case 1:
+ rect = QRect(position_list.at(0).toInt()+position_list.at(2).toInt()-this->width()-MARGIN,
+ position_list.at(1).toInt()+MARGIN,
+ this->width(),this->height());
break;
- //任务栏位于左边
- case PANEL_LEFT:
- x = availableGeo.x() + m_panelSize + MARGIN;
- y = availableGeo.y() + availableGeo.height() - this->height() - MARGIN;
+ case 2:
+ rect = QRect(position_list.at(0).toInt()+MARGIN,
+ position_list.at(1).toInt()+reply.value().at(3).toInt()-this->height()-MARGIN,
+ this->width(),this->height());
break;
- //任务栏位于右边
- case PANEL_RIGHT:
- x = availableGeo.x() + availableGeo.width() - m_panelSize - this->width() - MARGIN;
- y = availableGeo.y() + availableGeo.height() - this->height() - MARGIN;
+ case 3:
+ rect = QRect(position_list.at(0).toInt()+position_list.at(2).toInt()-this->width()-MARGIN,
+ position_list.at(1).toInt()+reply.value().at(3).toInt()-this->height()-MARGIN,
+ this->width(),this->height());
break;
- //任务栏位于下方
default:
- x = availableGeo.x() + availableGeo.width() - this->width() - MARGIN;
- y = availableGeo.y() + availableGeo.height() - m_panelSize - this->height() - MARGIN;
+ rect = QRect(position_list.at(0).toInt()+position_list.at(2).toInt()-this->width()-MARGIN,
+ position_list.at(1).toInt()+reply.value().at(3).toInt()-this->height()-MARGIN,
+ this->width(),this->height());
break;
}
- kdk::WindowManager::setGeometry(this->windowHandle(), QRect(x, y, this->width(), this->height()));
+ kdk::WindowManager::setGeometry(this->windowHandle(), rect);
qDebug() << " Position of ukui-panel is " << m_panelPosition << "; Position of mainwindow is " << this->geometry() << "." << Q_FUNC_INFO << __LINE__;
}
@@ -643,6 +653,7 @@ void MainWindow::showByWaylandHelper()
//去除窗管标题栏传入参数为QWidget*
kdk::UkuiStyleHelper::self()->removeHeader(this);
this->show();
+ this->setFocus();
QWindow* window = this->windowHandle();
if (window) {
//跳过任务栏和分页器的属性

View File

@ -57,3 +57,4 @@
0057-Translated-using-Weblate-Kyrgyz.patch
0058-Translated-using-Weblate-Kyrgyz.patch
0059-Translated-using-Weblate-Kyrgyz.patch
0060-78-WiFi.patch