linuxdcpp-team team mailing list archive
-
linuxdcpp-team team
-
Mailing list archive
-
Message #04175
[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2535: simplify restoration of maximized windows
------------------------------------------------------------
revno: 2535
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Fri 2011-05-27 19:44:05 +0200
message:
simplify restoration of maximized windows
modified:
win32/MainWindow.cpp
win32/MainWindow.h
--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk
Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'win32/MainWindow.cpp'
--- win32/MainWindow.cpp 2011-05-27 11:03:29 +0000
+++ win32/MainWindow.cpp 2011-05-27 17:44:05 +0000
@@ -95,7 +95,6 @@
toolbar(0),
tabs(0),
slotsSpin(0),
-maximized(false),
tray_pm(false),
c(0),
stopperThread(NULL),
@@ -809,7 +808,7 @@
void MainWindow::handleSized(const dwt::SizedEvent& sz) {
if(sz.isMinimized) {
handleMinimized();
- } else if( sz.isMaximized || sz.isRestored ) {
+ } else if(sz.isMaximized || sz.isRestored) {
if(BOOLSETTING(AUTO_AWAY) && !Util::getManualAway()) {
Util::setAway(false);
}
@@ -830,7 +829,6 @@
}
setVisible(false);
}
- maximized = isZoomed();
}
LRESULT MainWindow::handleActivateApp(WPARAM wParam) {
@@ -1442,12 +1440,11 @@
}
void MainWindow::handleRestore() {
- setVisible(true);
- if(maximized) {
- maximize();
- } else {
+ ::SetForegroundWindow(handle());
+ if(isIconic())
restore();
- }
+ else
+ setVisible(true);
}
bool MainWindow::handleMessage(const MSG& msg, LRESULT& retVal) {
=== modified file 'win32/MainWindow.h'
--- win32/MainWindow.h 2011-05-27 11:03:29 +0000
+++ win32/MainWindow.h 2011-05-27 17:44:05 +0000
@@ -117,8 +117,6 @@
typedef unordered_map<string, unsigned> ViewIndexes;
ViewIndexes viewIndexes; /// indexes of menu commands of the "View" menu that open static windows
- /** Was the window maximized when minimizing it? */
- bool maximized;
bool tray_pm;
HttpConnection* c;