From aeee5118595255104fee54afb4637c0d6b512517 Mon Sep 17 00:00:00 2001 From: xiaoyifang Date: Fri, 25 Feb 2022 22:51:39 +0800 Subject: [PATCH] fix:Win+Up Win+Down to restore and save geometry the above shortkey can not restore geometry after resize the window --- mainwindow.cc | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/mainwindow.cc b/mainwindow.cc index ee475d1b..a616d485 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -2474,23 +2474,23 @@ 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() == 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; - } +// 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 ) @@ -2527,11 +2527,11 @@ bool MainWindow::eventFilter( QObject * obj, QEvent * ev ) if ( obj == this && ( ev->type() == QEvent::Move || ev->type() == QEvent::Resize ) ) { #ifdef Q_OS_WIN - if( !isMaximized() && !isMinimized() && !isFullScreen() && gdAskMessage != 0xFFFFFFFF ) - { - QEvent *ev = new QEvent( gdStoreNormalGeometryEvent ); - qApp->postEvent( this, ev ); - } +// if( !isMaximized() && !isMinimized() && !isFullScreen() && gdAskMessage != 0xFFFFFFFF ) +// { +// QEvent *ev = new QEvent( gdStoreNormalGeometryEvent ); +// qApp->postEvent( this, ev ); +// } #endif if ( !cfg.preferences.searchInDock ) {