Changeset View
Changeset View
Standalone View
Standalone View
intern/ghost/intern/GHOST_SystemWin32.cpp
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| // Process all the events waiting for us | // Process all the events waiting for us | ||||
| while (::PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE) != 0) { | while (::PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE) != 0) { | ||||
| // TranslateMessage doesn't alter the message, and doesn't change our raw keyboard data. | // TranslateMessage doesn't alter the message, and doesn't change our raw keyboard data. | ||||
| // Needed for MapVirtualKey or if we ever need to get chars from wm_ime_char or similar. | // Needed for MapVirtualKey or if we ever need to get chars from wm_ime_char or similar. | ||||
| ::TranslateMessage(&msg); | ::TranslateMessage(&msg); | ||||
| ::DispatchMessageW(&msg); | ::DispatchMessageW(&msg); | ||||
| hasEventHandled = true; | hasEventHandled = true; | ||||
| } | } | ||||
| hasEventHandled |= this->m_eventManager->getNumEvents() > 0; | |||||
brecht: This should have a comment explaining why it's here.
Also, wrong indentation. | |||||
| } while (waitForEvent && !hasEventHandled); | } while (waitForEvent && !hasEventHandled); | ||||
| return hasEventHandled; | return hasEventHandled; | ||||
| } | } | ||||
| GHOST_TSuccess GHOST_SystemWin32::getCursorPosition(GHOST_TInt32 &x, GHOST_TInt32 &y) const | GHOST_TSuccess GHOST_SystemWin32::getCursorPosition(GHOST_TInt32 &x, GHOST_TInt32 &y) const | ||||
| { | { | ||||
| POINT point; | POINT point; | ||||
| ▲ Show 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | |||||
| */ | */ | ||||
| break; | break; | ||||
| //////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////// | ||||
| // Window events, processed | // Window events, processed | ||||
| //////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////// | ||||
| case WM_CLOSE: | case WM_CLOSE: | ||||
| /* The WM_CLOSE message is sent as a signal that a window | /* The WM_CLOSE message is sent as a signal that a window | ||||
| * or an application should terminate. */ | * or an application should terminate. Restore if minimized. */ | ||||
| if (IsIconic(hwnd)) { | |||||
| ShowWindow(hwnd, SW_RESTORE); | |||||
| } | |||||
| event = processWindowEvent(GHOST_kEventWindowClose, window); | event = processWindowEvent(GHOST_kEventWindowClose, window); | ||||
| break; | break; | ||||
| case WM_ACTIVATE: | case WM_ACTIVATE: | ||||
| /* The WM_ACTIVATE message is sent to both the window being activated and the window | /* The WM_ACTIVATE message is sent to both the window being activated and the window | ||||
| * being deactivated. If the windows use the same input queue, the message is sent | * being deactivated. If the windows use the same input queue, the message is sent | ||||
| * synchronously, first to the window procedure of the top-level window being | * synchronously, first to the window procedure of the top-level window being | ||||
| * deactivated, then to the window procedure of the top-level window being activated. | * deactivated, then to the window procedure of the top-level window being activated. | ||||
| * If the windows use different input queues, the message is sent asynchronously, | * If the windows use different input queues, the message is sent asynchronously, | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||
This should have a comment explaining why it's here.
Also, wrong indentation.