comparison src/video/windib/SDL_dibvideo.c @ 1290:c4a5a772c5d9

The event code was fine, and calculated the SDL_windowX/Y correctly. What we really needed to do was avoid doing client rect adjustment on zoomed windows. :)
author Sam Lantinga <slouken@libsdl.org>
date Sun, 29 Jan 2006 18:17:35 +0000
parents ea3888b472bf
children 31331c444ea2
comparison
equal deleted inserted replaced
1289:c07c6ef7c93e 1290:c4a5a772c5d9
663 video->flags |= SDL_HWPALETTE; 663 video->flags |= SDL_HWPALETTE;
664 } 664 }
665 } 665 }
666 666
667 /* Resize the window */ 667 /* Resize the window */
668 if ( !SDL_windowid ) { 668 if ( !SDL_windowid && !IsZoomed(SDL_Window) ) {
669 HWND top; 669 HWND top;
670 UINT swp_flags; 670 UINT swp_flags;
671 const char *window = getenv("SDL_VIDEO_WINDOW_POS"); 671 const char *window = NULL;
672 const char *center = getenv("SDL_VIDEO_CENTERED"); 672 const char *center = NULL;
673 673
674 if ( !SDL_windowX && !SDL_windowY ) { 674 if ( !SDL_windowX && !SDL_windowY ) {
675 window = getenv("SDL_VIDEO_WINDOW_POS");
676 center = getenv("SDL_VIDEO_CENTERED");
675 if ( window ) { 677 if ( window ) {
676 if ( sscanf(window, "%d,%d", &x, &y) == 2 ) { 678 if ( sscanf(window, "%d,%d", &x, &y) == 2 ) {
677 SDL_windowX = x; 679 SDL_windowX = x;
678 SDL_windowY = y; 680 SDL_windowY = y;
679 } 681 }
680 if ( strcmp(window, "center") == 0 ) { 682 if ( strcmp(window, "center") == 0 ) {
681 center = window; 683 center = window;
682 window = NULL;
683 } 684 }
684 } 685 }
685 } 686 }
686 swp_flags = (SWP_NOCOPYBITS | SWP_SHOWWINDOW); 687 swp_flags = (SWP_NOCOPYBITS | SWP_SHOWWINDOW);
687 688
704 y = bounds.top; 705 y = bounds.top;
705 } else { 706 } else {
706 x = y = -1; 707 x = y = -1;
707 swp_flags |= SWP_NOMOVE; 708 swp_flags |= SWP_NOMOVE;
708 } 709 }
709 if ( y < 0 ) { /* Cover up title bar for more client area */
710 y -= GetSystemMetrics(SM_CYCAPTION)/2;
711 }
712 if ( flags & SDL_FULLSCREEN ) { 710 if ( flags & SDL_FULLSCREEN ) {
713 top = HWND_TOPMOST; 711 top = HWND_TOPMOST;
714 } else { 712 } else {
715 top = HWND_NOTOPMOST; 713 top = HWND_NOTOPMOST;
716 } 714 }