From 434dbd6e45dcdb79ff6192b2c6ab24e4d7ed0aed Mon Sep 17 00:00:00 2001 From: xiaoyifang Date: Fri, 25 Feb 2022 22:54:34 +0800 Subject: [PATCH] fix:Win+Up Win+Down to restore and save geometry the above shortkey can not restore geometry after resize the window clean code . --- mainwindow.cc | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/mainwindow.cc b/mainwindow.cc index a616d485..6e8dcf38 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -59,10 +59,6 @@ #include #include "wstring.hh" #include "wstring_qt.hh" - -#define gdStoreNormalGeometryEvent ( ( QEvent::Type )( QEvent::User + 1 ) ) -#define gdApplyNormalGeometryEvent ( ( QEvent::Type )( QEvent::User + 2 ) ) - #endif #ifdef HAVE_X11 @@ -2473,25 +2469,6 @@ bool MainWindow::handleBackForwardMouseButtons ( QMouseEvent * event) { bool MainWindow::eventFilter( QObject * obj, QEvent * ev ) { -#ifdef Q_OS_WIN -// if( obj == this && ev->type() == gdStoreNormalGeometryEvent ) -// { -// if( !isMaximized() && !isMinimized() && !isFullScreen() ) -// cfg.normalMainWindowGeometry = normalGeometry(); -// ev->accept(); -// return true; -// } - -// if( obj == this && ev->type() == gdApplyNormalGeometryEvent ) -// { -// if( !isMaximized() && !isMinimized() && !isFullScreen() ) -// { -// setGeometry( cfg.normalMainWindowGeometry ); -// } -// ev->accept(); -// return true; -// } -#endif if ( ev->type() == QEvent::ShortcutOverride || ev->type() == QEvent::KeyPress ) { @@ -2544,14 +2521,6 @@ bool MainWindow::eventFilter( QObject * obj, QEvent * ev ) { QWindowStateChangeEvent *stev = static_cast< QWindowStateChangeEvent *>( ev ); wasMaximized = ( stev->oldState() == Qt::WindowMaximized && isMinimized() ); - -#ifdef Q_OS_WIN - if( stev->oldState() == Qt::WindowMaximized && !isMinimized() && cfg.normalMainWindowGeometry.width() > 0 ) - { - QEvent *ev = new QEvent( gdApplyNormalGeometryEvent ); - qApp->postEvent( this, ev ); - } -#endif } if ( ev->type() == QEvent::MouseButtonPress ) {