static void stubCBCheckWindowsInfo(unsigned long key, void *data1, void *data2) { WindowInfo *winInfo = (WindowInfo *) data1; CWPRETSTRUCT *pMsgInfo = (PCWPRETSTRUCT) data2; (void) key; if (winInfo && pMsgInfo && winInfo->type == CHROMIUM) { switch (pMsgInfo->message) { case WM_MOVING: case WM_SIZING: case WM_MOVE: case WM_CREATE: case WM_SIZE: { GLboolean changed = stub.trackWindowVisibleRgn && stubUpdateWindowVisibileRegions(winInfo); if (stubUpdateWindowGeometry(winInfo, GL_FALSE) || changed) { crForcedFlush(); } break; } case WM_SHOWWINDOW: case WM_ACTIVATEAPP: case WM_PAINT: case WM_NCPAINT: case WM_NCACTIVATE: case WM_ERASEBKGND: { if (stub.trackWindowVisibleRgn && stubUpdateWindowVisibileRegions(winInfo)) { crForcedFlush(); } break; } default: { if (stub.trackWindowVisibleRgn && stubUpdateWindowVisibileRegions(winInfo)) { crDebug("Visibility info updated due to unknown hooked message (%d)", pMsgInfo->message); crForcedFlush(); } break; } } } }
static void stubCheckWindowState(WindowInfo *window, GLboolean bFlushOnChange) { bool bForceUpdate = false; bool bChanged = false; #ifdef WINDOWS /* @todo install hook and track for WM_DISPLAYCHANGE */ { DEVMODE devMode; devMode.dmSize = sizeof(DEVMODE); EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &devMode); if (devMode.dmPelsWidth!=window->dmPelsWidth || devMode.dmPelsHeight!=window->dmPelsHeight) { crDebug("Resolution changed(%d,%d), forcing window Pos/Size update", devMode.dmPelsWidth, devMode.dmPelsHeight); window->dmPelsWidth = devMode.dmPelsWidth; window->dmPelsHeight = devMode.dmPelsHeight; bForceUpdate = true; } } #endif bChanged = stubUpdateWindowGeometry(window, bForceUpdate) || bForceUpdate; #if defined(GLX) || defined (WINDOWS) if (stub.trackWindowVisibleRgn) { bChanged = stubUpdateWindowVisibileRegions(window) || bChanged; } #endif if (stub.trackWindowVisibility && window->type == CHROMIUM && window->drawable) { const int mapped = stubIsWindowVisible(window); if (mapped != window->mapped) { crDebug("Dispatched: WindowShow(%i, %i)", window->spuWindow, mapped); stub.spu->dispatch_table.WindowShow(window->spuWindow, mapped); window->mapped = mapped; bChanged = true; } } if (bFlushOnChange && bChanged) { stub.spu->dispatch_table.Flush(); } }