From: liucong321 <liucong1@kylinos.cn>
Date: Mon, 29 May 2023 16:51:49 +0800
Subject: =?utf-8?b?5L+u5aSN57yW6K+R5LiN6YCa6L+H6Zeu6aKY?=

---
 src/mainwindow.cpp | 19 +++++--------------
 src/src.pro        |  6 ------
 2 files changed, 5 insertions(+), 20 deletions(-)

diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index c803446..0412896 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -319,17 +319,6 @@ void MainWindow::initDBus()
         KyInfo("init dbus error");
     }
 
-    QDBusMessage m = QDBusMessage::createMethodCall(QString("com.kylin.statusmanager.interface"),
-                                                    QString("/"),
-                                                    QString("com.kylin.statusmanager.interface"),
-                                                    QString("get_current_tabletmode"));
-
-    QDBusMessage res = sessionBus.call(m);
-    if (res.type() == 1 || res.type() == 2)
-        m_is_tablet_mode = res.arguments().first().toBool();
-    else
-        m_is_tablet_mode = false;
-
     //S3 S4策略
     QDBusConnection::systemBus().connect(QString("org.freedesktop.login1"),
                                          QString("/org/freedesktop/login1"),
@@ -463,7 +452,7 @@ void MainWindow::initTitleWidget()
     connect(m_title_menu, &TitleMenu::sigQuit, this, &MainWindow::slotQuit);
 
     m_title_widget = new TitleWidget(this);
-    m_title_widget->setUIMode(m_is_tablet_mode);
+    m_title_widget->setUIMode(isTablet);
     m_title_widget->raise();
     m_title_widget->move(0, 0);
     m_title_widget->setTitle(tr("Video Player"));
@@ -533,7 +522,7 @@ void MainWindow::initMiniModeShade()
 void MainWindow::initContralBar()
 {
     m_contral_bar = new ContralBar(this);
-    m_contral_bar->setUIMode(m_is_tablet_mode);
+    m_contral_bar->setUIMode(isTablet);
     m_contral_bar->hide();
     m_contral_bar->raise();
 
@@ -670,6 +659,7 @@ void MainWindow::Single(QStringList filelist)
 
 void MainWindow::windowStateChange()
 {
+#if 0
     long compositor = (windowState() & Qt::WindowMaximized || windowState() & Qt::WindowFullScreen) ? 1 : 2;
     QTimer::singleShot(500, this, [&, compositor](){
         if (isWayland)
@@ -678,6 +668,7 @@ void MainWindow::windowStateChange()
         XChangeProperty(QX11Info::display(), this->winId(), _NET_WM_BYPASS_COMPOSITOR, XA_CARDINAL,
                         32, XCB_PROP_MODE_REPLACE, (const unsigned char*)&compositor, 1);
     });
+#endif
 
     if (windowState() & Qt::WindowMaximized)
         m_title_widget->updateMaxButtonStatus(true);
@@ -812,7 +803,7 @@ void MainWindow::slotChangeMaxState()
         m_is_maximized = false;
     }
     else {
-        showMaximized();
+        kdk::WindowManager::maximizeWindow(m_window_id);
         m_is_maximized = true;
     }
 }
diff --git a/src/src.pro b/src/src.pro
index ad30a5e..699ee3f 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -46,12 +46,6 @@ include(widget/widget.pri)
 
 LIBS += -lX11 \
         -lKF5WindowSystem \
-        -lavformat \
-        -lavdevice \
-        -lavcodec \
-        -lavutil \
-        -lswscale \
-        -lswresample \
         -lzen \
         -lmediainfo \
         -lukui-log4qt \
