Created
November 12, 2017 17:16
-
-
Save khaytsus/5e67b4824eccda3530e26f62aa1b1461 to your computer and use it in GitHub Desktop.
Simple patch for keepassx to minimize to tray on window close rather than exit. For some reason the developer insists that this is a bad pattern, but at least the change is very simple. I'm not claiming this is the best way, some of the conditionals I'm removing should likely stay but this works fine.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- keepassx-2.0.3/src/gui/MainWindow.cpp 2017-11-11 09:36:25.000000000 -0500 | |
+++ keepassx-2.0.3-fixed/src/gui/MainWindow.cpp 2017-11-11 09:51:22.898728108 -0500 | |
@@ -441,19 +441,20 @@ | |
if (accept) { | |
- if ((event->type() == QEvent::WindowStateChange) && isMinimized() | |
- && isTrayIconEnabled() && m_trayIcon && m_trayIcon->isVisible() | |
+ if (isTrayIconEnabled() && m_trayIcon && m_trayIcon->isVisible() | |
&& config()->get("GUI/MinimizeToTray").toBool()) | |
{ | |
event->ignore(); | |
QTimer::singleShot(0, this, SLOT(hide())); | |
} | |
- | |
-/* saveWindowInformation(); | |
+ else | |
+ { | |
+ saveWindowInformation(); | |
- event->accept(); | |
- QApplication::quit(); | |
-*/ } | |
+ event->accept(); | |
+ QApplication::quit(); | |
+ } | |
+ } | |
else { | |
event->ignore(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment