comctl32: Position the tooltip window correctly on multi-monitor setups.
This commit is contained in:
parent
280defcfcf
commit
9d6d54f5e6
|
@ -496,7 +496,9 @@ static void
|
||||||
TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr)
|
TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr)
|
||||||
{
|
{
|
||||||
TTTOOL_INFO *toolPtr;
|
TTTOOL_INFO *toolPtr;
|
||||||
RECT rect, wndrect;
|
HMONITOR monitor;
|
||||||
|
MONITORINFO mon_info;
|
||||||
|
RECT rect;
|
||||||
SIZE size;
|
SIZE size;
|
||||||
NMHDR hdr;
|
NMHDR hdr;
|
||||||
int ptfx = 0;
|
int ptfx = 0;
|
||||||
|
@ -593,13 +595,18 @@ TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr)
|
||||||
rect.bottom = rect.top + size.cy;
|
rect.bottom = rect.top + size.cy;
|
||||||
|
|
||||||
/* check position */
|
/* check position */
|
||||||
wndrect.right = GetSystemMetrics( SM_CXSCREEN );
|
|
||||||
if( rect.right > wndrect.right ) {
|
monitor = MonitorFromRect( &rect, MONITOR_DEFAULTTOPRIMARY );
|
||||||
rect.left -= rect.right - wndrect.right + 2;
|
mon_info.cbSize = sizeof(mon_info);
|
||||||
rect.right = wndrect.right - 2;
|
GetMonitorInfoW( monitor, &mon_info );
|
||||||
|
|
||||||
|
if( rect.right > mon_info.rcWork.right ) {
|
||||||
|
rect.left -= rect.right - mon_info.rcWork.right + 2;
|
||||||
|
rect.right = mon_info.rcWork.right - 2;
|
||||||
}
|
}
|
||||||
wndrect.bottom = GetSystemMetrics( SM_CYSCREEN );
|
if (rect.left < mon_info.rcWork.left) rect.left = mon_info.rcWork.left;
|
||||||
if( rect.bottom > wndrect.bottom ) {
|
|
||||||
|
if( rect.bottom > mon_info.rcWork.bottom ) {
|
||||||
RECT rc;
|
RECT rc;
|
||||||
|
|
||||||
if (toolPtr->uFlags & TTF_IDISHWND)
|
if (toolPtr->uFlags & TTF_IDISHWND)
|
||||||
|
|
Loading…
Reference in New Issue