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
156 bool nativeEventFilter(const QByteArray &eventType, void* msg, long* result) Q_DECL_OVERRIDE {156 bool nativeEventFilter(const QByteArray &eventType, void* msg, long* result) Q_DECL_OVERRIDE {
157 if (eventType == "windows_generic_MSG") {157 if (eventType == "windows_generic_MSG") {
158 MSG* message = (MSG*)msg;158 MSG* message = (MSG*)msg;
159
159 if (message->message == UWM_IDENTIFY_INSTANCES) {160 if (message->message == UWM_IDENTIFY_INSTANCES) {
160 *result = UWM_IDENTIFY_INSTANCES;161 *result = UWM_IDENTIFY_INSTANCES;
161 return true;162 return true;
162 }163 }
163 if (message->message == WM_SHOWWINDOW) {164
164 Application::getInstance()->getWindow()->showNormal();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;
165 }172 }
173
166 if (message->message == WM_COPYDATA) {174 if (message->message == WM_COPYDATA) {
167 COPYDATASTRUCT* pcds = (COPYDATASTRUCT*)(message->lParam);175 COPYDATASTRUCT* pcds = (COPYDATASTRUCT*)(message->lParam);
168 QUrl url = QUrl((const char*)(pcds->lpData));176 QUrl url = QUrl((const char*)(pcds->lpData));
169 if (url.isValid() && url.scheme() == HIFI_URL_SCHEME) {177 if (url.isValid() && url.scheme() == HIFI_URL_SCHEME) {
170 DependencyManager::get<AddressManager>()->handleLookupString(url.toString());178 DependencyManager::get<AddressManager>()->handleLookupString(url.toString());
179 return true;
171 }180 }
172 }181 }
173 }182 }

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