History

Fix maximized Windows window unintentionally changing to windowed

This stops a maximized Windows window changing to being windowed when you click on a menu item.

David Rowe committed 11 years ago

Commit 4fa2b3a1 parent 9aa9dac3 files · +14 −4Browse files

Showing the changes to interface/src/Application.cpp (1 of 3 files). Show all

Unified · Split

interface/src/Application.cpp+11−2
@@ -156,18 +156,27 @@ public: · 155 unmodified lines
156156 bool nativeEventFilter(const QByteArray &eventType, void* msg, long* result) Q_DECL_OVERRIDE {
157157 if (eventType == "windows_generic_MSG") {
158158 MSG* message = (MSG*)msg;
159+
159160 if (message->message == UWM_IDENTIFY_INSTANCES) {
160161 *result = UWM_IDENTIFY_INSTANCES;
161162 return true;
162163 }
163− if (message->message == WM_SHOWWINDOW) {
164− Application::getInstance()->getWindow()->showNormal();
164+
165+ if (message->message == UWM_SHOW_APPLICATION) {
166+ MainWindow* applicationWindow = Application::getInstance()->getWindow();
167+ if (applicationWindow->isMinimized()) {
168+ applicationWindow->showNormal(); // Restores to windowed or maximized state appropriately.
169+ }
170+ Application::getInstance()->setActiveWindow(applicationWindow); // Flashes the taskbar icon if not focus.
171+ return true;
165172 }
173+
166174 if (message->message == WM_COPYDATA) {
167175 COPYDATASTRUCT* pcds = (COPYDATASTRUCT*)(message->lParam);
168176 QUrl url = QUrl((const char*)(pcds->lpData));
169177 if (url.isValid() && url.scheme() == HIFI_URL_SCHEME) {
170178 DependencyManager::get<AddressManager>()->handleLookupString(url.toString());
179+ return true;
171180 }
172181 }
173182 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t