Lines 857-862
Link Here
|
857 |
} |
857 |
} |
858 |
|
858 |
|
859 |
// ----------------------------------------------------------------------- |
859 |
// ----------------------------------------------------------------------- |
|
|
860 |
static BOOL CALLBACK CalcFullScreenSizeMonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData) |
861 |
{ |
862 |
MONITORINFOEX **lpmicallback; |
863 |
MONITORINFOEX *lpmithis; |
864 |
lpmicallback = (MONITORINFOEX **)dwData; |
865 |
lpmithis = *lpmicallback; |
866 |
lpmithis->cbSize = sizeof(MONITORINFOEX); |
867 |
if (GetMonitorInfo(hMonitor, lpmithis)) |
868 |
{ |
869 |
*lpmicallback = lpmithis + sizeof(MONITORINFOEX); |
870 |
} |
871 |
return TRUE; |
872 |
}; |
860 |
|
873 |
|
861 |
static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame, |
874 |
static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame, |
862 |
int& rX, int& rY, int& rDX, int& rDY ) |
875 |
int& rX, int& rY, int& rDX, int& rDY ) |
Lines 867-872
Link Here
|
867 |
int nCaptionY; |
880 |
int nCaptionY; |
868 |
int nScreenDX; |
881 |
int nScreenDX; |
869 |
int nScreenDY; |
882 |
int nScreenDY; |
|
|
883 |
int nScreenX; |
884 |
int nScreenY; |
885 |
int nMonitor; |
886 |
int nMonitors; |
870 |
|
887 |
|
871 |
if ( pFrame->mbSizeBorder ) |
888 |
if ( pFrame->mbSizeBorder ) |
872 |
{ |
889 |
{ |
Lines 893-903
Link Here
|
893 |
else |
910 |
else |
894 |
nCaptionY = 0; |
911 |
nCaptionY = 0; |
895 |
|
912 |
|
896 |
nScreenDX = GetSystemMetrics( SM_CXSCREEN ); |
913 |
// TODO: replace this FALSE with a check about whether to display on the primary screen |
897 |
nScreenDY = GetSystemMetrics( SM_CYSCREEN ); |
914 |
if ( FALSE ) |
|
|
915 |
{ |
916 |
nScreenX = 0; |
917 |
nScreenY = 0; |
918 |
nScreenDX = GetSystemMetrics( SM_CXSCREEN ); |
919 |
nScreenDY = GetSystemMetrics( SM_CYSCREEN ); |
920 |
} |
921 |
else |
922 |
{ |
923 |
nMonitors = GetSystemMetrics(SM_CMONITORS); |
924 |
BOOL bFoundMonitor; |
925 |
MONITORINFOEX *lpmiarray = (MONITORINFOEX *)malloc(sizeof(MONITORINFOEX) * nMonitors); |
926 |
if (lpmiarray != NULL) |
927 |
{ |
928 |
MONITORINFOEX *lpmicurrent = lpmiarray; |
929 |
POINT ptCunning; |
930 |
// TODO: find a way to find the monitor number or check the monitor display name required |
931 |
nMonitor = 1 ; // pFrame->mbFullScreen - 1; |
932 |
bFoundMonitor = FALSE; |
933 |
if (EnumDisplayMonitors(NULL, NULL, &CalcFullScreenSizeMonitorEnumProc, (LPARAM)(&lpmicurrent))) |
934 |
{ |
935 |
nMonitors = (lpmicurrent - lpmiarray) / sizeof(MONITORINFOEX); |
936 |
if (nMonitor < nMonitors) |
937 |
{ |
938 |
MONITORINFOEX *mInfo = lpmiarray + nMonitor * sizeof(MONITORINFOEX); |
939 |
nScreenX = mInfo->rcMonitor.left; |
940 |
nScreenY = mInfo->rcMonitor.top; |
941 |
nScreenDX = mInfo->rcMonitor.right - nScreenX; |
942 |
nScreenDY = mInfo->rcMonitor.bottom - nScreenY; |
943 |
bFoundMonitor = TRUE; |
944 |
} |
945 |
} |
946 |
free(lpmiarray); |
947 |
} |
948 |
if (!bFoundMonitor) |
949 |
{ |
950 |
nScreenX = 0; |
951 |
nScreenY = 0; |
952 |
nScreenDX = GetSystemMetrics( SM_CXSCREEN ); |
953 |
nScreenDY = GetSystemMetrics( SM_CYSCREEN ); |
954 |
} |
955 |
} |
898 |
|
956 |
|
899 |
rX = -nFrameX; |
957 |
rX = nScreenX-nFrameX; |
900 |
rY = -(nFrameY+nCaptionY); |
958 |
rY = nScreenY-(nFrameY+nCaptionY); |
901 |
rDX = nScreenDX+(nFrameX*2); |
959 |
rDX = nScreenDX+(nFrameX*2); |
902 |
rDY = nScreenDY+(nFrameY*2)+nCaptionY; |
960 |
rDY = nScreenDY+(nFrameY*2)+nCaptionY; |
903 |
} |
961 |
} |