- Timestamp:
- Nov 23, 2010 4:12:35 PM (14 years ago)
- Location:
- trunk/src/VBox/Additions/common/crOpenGL
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/crOpenGL/context.c
r34284 r34295 501 501 { 502 502 RECT rect; 503 HWND hwnd; 504 505 if (!window->drawable) { 503 504 if (!window->drawable || !window->hWnd) { 506 505 *w = *h = 0; 507 506 return; 508 507 } 509 508 510 hwnd = WindowFromDC( window->drawable ); 511 512 if (!hwnd) { 513 *w = 0; 514 *h = 0; 515 } 516 else { 517 if (!GetClientRect(hwnd, &rect)) 518 { 519 crWarning("GetClientRect failed for %p", hwnd); 520 *w = *h = 0; 521 return; 522 } 523 *w = rect.right - rect.left; 524 *h = rect.bottom - rect.top; 525 if (!ClientToScreen( hwnd, (LPPOINT) &rect )) 526 { 527 crWarning("ClientToScreen failed for %p", hwnd); 528 *w = *h = 0; 529 return; 530 } 531 *x = rect.left; 532 *y = rect.top; 533 } 509 if (window->hWnd!=WindowFromDC(window->drawable)) 510 { 511 crWarning("Window(%i) DC is no longer valid", window->spuWindow); 512 return; 513 } 514 515 if (!GetClientRect(window->hWnd, &rect)) 516 { 517 crWarning("GetClientRect failed for %p", window->hWnd); 518 *w = *h = 0; 519 return; 520 } 521 *w = rect.right - rect.left; 522 *h = rect.bottom - rect.top; 523 524 if (!ClientToScreen( window->hWnd, (LPPOINT) &rect )) 525 { 526 crWarning("ClientToScreen failed for %p", window->hWnd); 527 *w = *h = 0; 528 return; 529 } 530 *x = rect.left; 531 *y = rect.top; 534 532 } 535 533 … … 537 535 GetWindowTitle( const WindowInfo *window, char *title ) 538 536 { 539 HWND hwnd;540 537 /* XXX - we don't handle recurseUp */ 541 hwnd = WindowFromDC( window->drawable ); 542 if (hwnd) 543 GetWindowText(hwnd, title, 100); 538 if (window->hWnd) 539 GetWindowText(window->hWnd, title, 100); 544 540 else 545 541 title[0] = 0; … … 558 554 // apparently the "window" parameter passed to this 559 555 // function contains the native window information 560 HWND NATIVEhwnd = WindowFromDC( window->drawable ); 556 HWND NATIVEhwnd = window->hWnd; 557 558 if (NATIVEhwnd!=WindowFromDC(window->drawable)) 559 { 560 crWarning("Window(%i) DC is no longer valid", window->spuWindow); 561 return; 562 } 561 563 562 564 // get the native window's height and width … … 1028 1030 { 1029 1031 #ifdef WINDOWS 1030 if ( !WindowFromDC(context->currentDrawable->drawable))1032 if (context->currentDrawable->hWnd!=WindowFromDC(context->currentDrawable->drawable)) 1031 1033 { 1032 1034 crWindowDestroy((GLint)context->currentDrawable->hWnd); -
trunk/src/VBox/Additions/common/crOpenGL/load.c
r33988 r34295 142 142 { 143 143 #ifdef WINDOWS 144 if ( !WindowFromDC(pWindow->drawable))144 if (pWindow->hWnd!=WindowFromDC(pWindow->drawable)) 145 145 { 146 146 return false; … … 197 197 if (!stub.currentContext) 198 198 return; 199 200 #if defined(WINDOWS) && defined(VBOX_WITH_WDDM) 201 if (stub.bRunningUnderWDDM) 202 return; 203 #endif 199 204 200 205 #if defined(CR_NEWWINTRACK) && !defined(WINDOWS) … … 657 662 int i; 658 663 664 # ifdef VBOX_WITH_WDDM 665 stub.bRunningUnderWDDM = false; 666 # endif 659 667 /* Apply viewport hack only if we're running under wine */ 660 668 if (NULL!=GetModuleHandle("wined3d.dll") || NULL != GetModuleHandle("wined3dwddm.dll")) … … 726 734 } 727 735 736 if (!stubSystemWindowExist(pWindow)) 737 { 738 crWindowDestroy((GLint)pWindow->hWnd); 739 return; 740 } 741 742 stub.spu->dispatch_table.VBoxPackSetInjectID(pWindow->u32ClientID); 743 728 744 if (!pWindow->mapped) 729 745 { … … 841 857 } 842 858 859 #if defined(WINDOWS) && defined(VBOX_WITH_WDDM) 860 if (stub.bRunningUnderWDDM) 861 return; 862 #endif 843 863 stubCheckWindowState(pWindow, GL_TRUE); 844 864 } … … 884 904 crDebug("running with VBoxDispD3D"); 885 905 stub.trackWindowVisibleRgn = 0; 906 stub.bRunningUnderWDDM = true; 886 907 } 887 908 } … … 932 953 crWarning("VBoxDispMpTstCallbacks.pfnGetRegions failed with 0x%x", hr); 933 954 } 955 crHashtableWalk(stub.windowTable, stubSyncTrCheckWindowsCB, NULL); 934 956 } 935 957 } -
trunk/src/VBox/Additions/common/crOpenGL/stub.c
r33540 r34295 268 268 269 269 if (!pWindow) return GL_FALSE; 270 hwnd = WindowFromDC(pWindow->drawable);270 hwnd = pWindow->hWnd; 271 271 if (!hwnd) return GL_FALSE; 272 272 273 if (hwnd!=WindowFromDC(pWindow->drawable)) 274 { 275 crWarning("Window(%i) DC is no longer valid", pWindow->spuWindow); 276 return GL_FALSE; 277 } 273 278 274 279 hVisRgn = CreateRectRgn(0,0,0,0); -
trunk/src/VBox/Additions/common/crOpenGL/stub.h
r33540 r34295 246 246 HHOOK hMessageHook; 247 247 # endif 248 # ifdef VBOX_WITH_WDDM 249 bool bRunningUnderWDDM; 250 # endif 248 251 #endif 249 252
Note:
See TracChangeset
for help on using the changeset viewer.