100 lines
3.6 KiB
Diff
100 lines
3.6 KiB
Diff
From: cckylin-cibot <cckylin-cibot@kylinos.cn>
|
|
Date: Wed, 22 Jun 2022 07:02:54 +0000
|
|
Subject: =?utf-8?b?ITUg5L+u5pS55LqGcGxhdGZvcm1OYW1l6I635Y+W5pe25py677yM6Kej?=
|
|
=?utf-8?b?5Yaz6I635Y+W5Li656m655qE6Zeu6aKY77yb5aKe5Yqg5LqG5YWo5bGP56qX5Y+j?=
|
|
=?utf-8?b?5pi+56S65pe25L2N572u6K6+572uICogdXBkYXRlIGRlYmlhbi9jaGFuZ2Vsb2cu?=
|
|
=?utf-8?b?ICog6Kej5Yaz5Yay56qBICog6LCD5pW0cGxhdGZvcm1OYW1l6I635Y+W5L2N572u?=
|
|
=?utf-8?b?77yM5L+u5pS55YWo5bGP56qX5Y+j5L2N572u6K6+572uICog5re75YqgY29udHJv?=
|
|
=?utf-8?b?bOaWh+S7tuS+nei1liAqIOS/ruaUueWbvuagh+e8uuWksee8luivkeWksei0pQ==?=
|
|
=?utf-8?b?6Zeu6aKYICogdXBkYXRlIHNyYy9VdGlsaXR5RnVuY3Rpb24vYWJzdHJhY3RJbnRl?=
|
|
=?utf-8?b?cmZhY2UuaC4gKiAzLjIwd2F5bGFuZOS9jee9rumXrumimOino+WGsw==?=
|
|
|
|
---
|
|
main.cpp | 2 +-
|
|
src/UserInterface/mainwindow.cpp | 11 +++++++++++
|
|
src/UserInterface/mainwindow.h | 1 +
|
|
3 files changed, 13 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/main.cpp b/main.cpp
|
|
index 68bb94d..4d4c558 100755
|
|
--- a/main.cpp
|
|
+++ b/main.cpp
|
|
@@ -44,7 +44,6 @@ int main(int argc, char *argv[])
|
|
initUkuiLog4qt("ukui-menu");
|
|
g_projectCodeName = KDKGetPrjCodeName().c_str();
|
|
g_subProjectCodeName = KDKGetOSRelease("SUB_PROJECT_CODENAME").c_str();
|
|
- g_platform = QGuiApplication::platformName();
|
|
|
|
qRegisterMetaType<QVector<QStringList>>("QVector<QStringList>");
|
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0))
|
|
@@ -56,6 +55,7 @@ int main(int argc, char *argv[])
|
|
#endif
|
|
QtSingleApplication app("ukui-menu", argc, argv);
|
|
app.setQuitOnLastWindowClosed(false);
|
|
+ g_platform = QGuiApplication::platformName();
|
|
|
|
if (app.isRunning()) {
|
|
app.sendMessage("raise_window_noop");
|
|
diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp
|
|
index ccc8fe1..984d9f0 100755
|
|
--- a/src/UserInterface/mainwindow.cpp
|
|
+++ b/src/UserInterface/mainwindow.cpp
|
|
@@ -355,6 +355,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
|
m_viewWidget->setFocus();
|
|
} else {
|
|
m_fullWindow->show();
|
|
+ setMaxWindowPos();
|
|
// fullWindow->raise();
|
|
m_fullWindow->activateWindow();
|
|
pointDataStruct pointData;
|
|
@@ -693,6 +694,7 @@ void MainWindow::maxAnimationFinished()
|
|
{
|
|
m_fullWindow->raise();
|
|
m_fullWindow->showNormal();
|
|
+ setMaxWindowPos();
|
|
m_fullWindow->activateWindow();
|
|
QEventLoop loop;
|
|
QTimer::singleShot(100, &loop, SLOT(quit()));
|
|
@@ -1217,6 +1219,7 @@ void MainWindow::showWindow()
|
|
if (m_isFullScreen) {
|
|
m_fullWindow->raise();
|
|
m_fullWindow->showNormal();
|
|
+ setMaxWindowPos();
|
|
m_fullWindow->activateWindow();
|
|
pointDataStruct pointData;
|
|
pointData.module = "fullWindow";
|
|
@@ -1238,6 +1241,7 @@ void MainWindow::showWindow()
|
|
BuriedPointDataSend::getInstance()->setPoint(pointData);
|
|
}
|
|
}
|
|
+
|
|
void MainWindow::hideWindow()
|
|
{
|
|
if (m_fullWindow->isVisible()) {
|
|
@@ -1296,6 +1300,13 @@ void MainWindow::setMinWindowPos()
|
|
}
|
|
}
|
|
|
|
+void MainWindow::setMaxWindowPos()
|
|
+{
|
|
+ if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) {
|
|
+ kdk::WindowManager::setGeometry(m_fullWindow->windowHandle(), QRect(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight));
|
|
+ }
|
|
+}
|
|
+
|
|
void MainWindow::repaintWidget()
|
|
{
|
|
Style::initWidStyle();
|
|
diff --git a/src/UserInterface/mainwindow.h b/src/UserInterface/mainwindow.h
|
|
index 9c1bcad..7dede39 100755
|
|
--- a/src/UserInterface/mainwindow.h
|
|
+++ b/src/UserInterface/mainwindow.h
|
|
@@ -107,6 +107,7 @@ protected:
|
|
|
|
void setMinWindowPos();
|
|
|
|
+ void setMaxWindowPos();
|
|
public:
|
|
Q_SIGNALS:
|
|
void sendSearchKeyword(QString arg);
|