user32: Move iconic windows as their border instead of their icon.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
94e76b1b3c
commit
50bc18201d
|
@ -2709,12 +2709,10 @@ void WINPOS_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
|
||||||
HWND parent;
|
HWND parent;
|
||||||
LONG hittest = (LONG)(wParam & 0x0f);
|
LONG hittest = (LONG)(wParam & 0x0f);
|
||||||
WPARAM syscommand = wParam & 0xfff0;
|
WPARAM syscommand = wParam & 0xfff0;
|
||||||
HCURSOR hDragCursor = 0, hOldCursor = 0;
|
|
||||||
MINMAXINFO minmax;
|
MINMAXINFO minmax;
|
||||||
POINT capturePoint, pt;
|
POINT capturePoint, pt;
|
||||||
LONG style = GetWindowLongW( hwnd, GWL_STYLE );
|
LONG style = GetWindowLongW( hwnd, GWL_STYLE );
|
||||||
BOOL thickframe = HAS_THICKFRAME( style );
|
BOOL thickframe = HAS_THICKFRAME( style );
|
||||||
BOOL iconic = style & WS_MINIMIZE;
|
|
||||||
BOOL moved = FALSE;
|
BOOL moved = FALSE;
|
||||||
DWORD dwPoint = GetMessagePos ();
|
DWORD dwPoint = GetMessagePos ();
|
||||||
BOOL DragFullWindows = TRUE;
|
BOOL DragFullWindows = TRUE;
|
||||||
|
@ -2794,13 +2792,6 @@ void WINPOS_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
|
||||||
/* Retrieve a default cache DC (without using the window style) */
|
/* Retrieve a default cache DC (without using the window style) */
|
||||||
hdc = GetDCEx( parent, 0, DCX_CACHE );
|
hdc = GetDCEx( parent, 0, DCX_CACHE );
|
||||||
|
|
||||||
if( iconic ) /* create a cursor for dragging */
|
|
||||||
{
|
|
||||||
hDragCursor = (HCURSOR)GetClassLongPtrW( hwnd, GCLP_HICON);
|
|
||||||
if( !hDragCursor ) hDragCursor = (HCURSOR)SendMessageW( hwnd, WM_QUERYDRAGICON, 0, 0L);
|
|
||||||
if( !hDragCursor ) iconic = FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* we only allow disabling the full window drag for child windows */
|
/* we only allow disabling the full window drag for child windows */
|
||||||
if (parent) SystemParametersInfoW( SPI_GETDRAGFULLWINDOWS, 0, &DragFullWindows, 0 );
|
if (parent) SystemParametersInfoW( SPI_GETDRAGFULLWINDOWS, 0, &DragFullWindows, 0 );
|
||||||
|
|
||||||
|
@ -2870,20 +2861,14 @@ void WINPOS_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
|
||||||
if( !moved )
|
if( !moved )
|
||||||
{
|
{
|
||||||
moved = TRUE;
|
moved = TRUE;
|
||||||
|
if (!DragFullWindows)
|
||||||
if( iconic ) /* ok, no system popup tracking */
|
|
||||||
{
|
|
||||||
hOldCursor = SetCursor(hDragCursor);
|
|
||||||
ShowCursor( TRUE );
|
|
||||||
}
|
|
||||||
else if(!DragFullWindows)
|
|
||||||
draw_moving_frame( parent, hdc, &sizingRect, thickframe );
|
draw_moving_frame( parent, hdc, &sizingRect, thickframe );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg.message == WM_KEYDOWN) SetCursorPos( pt.x, pt.y );
|
if (msg.message == WM_KEYDOWN) SetCursorPos( pt.x, pt.y );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(!iconic && !DragFullWindows) draw_moving_frame( parent, hdc, &sizingRect, thickframe );
|
if (!DragFullWindows) draw_moving_frame( parent, hdc, &sizingRect, thickframe );
|
||||||
if (hittest == HTCAPTION) OffsetRect( &sizingRect, dx, dy );
|
if (hittest == HTCAPTION) OffsetRect( &sizingRect, dx, dy );
|
||||||
if (ON_LEFT_BORDER(hittest)) sizingRect.left += dx;
|
if (ON_LEFT_BORDER(hittest)) sizingRect.left += dx;
|
||||||
else if (ON_RIGHT_BORDER(hittest)) sizingRect.right += dx;
|
else if (ON_RIGHT_BORDER(hittest)) sizingRect.right += dx;
|
||||||
|
@ -2903,8 +2888,6 @@ void WINPOS_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
|
||||||
else
|
else
|
||||||
SendMessageW( hwnd, WM_MOVING, 0, (LPARAM)&sizingRect );
|
SendMessageW( hwnd, WM_MOVING, 0, (LPARAM)&sizingRect );
|
||||||
|
|
||||||
if (!iconic)
|
|
||||||
{
|
|
||||||
if (!DragFullWindows)
|
if (!DragFullWindows)
|
||||||
draw_moving_frame( parent, hdc, &sizingRect, thickframe );
|
draw_moving_frame( parent, hdc, &sizingRect, thickframe );
|
||||||
else
|
else
|
||||||
|
@ -2918,17 +2901,8 @@ void WINPOS_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if( iconic )
|
if (moved && !DragFullWindows)
|
||||||
{
|
|
||||||
if( moved ) /* restore cursors, show icon title later on */
|
|
||||||
{
|
|
||||||
ShowCursor( FALSE );
|
|
||||||
SetCursor( hOldCursor );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (moved && !DragFullWindows)
|
|
||||||
{
|
{
|
||||||
draw_moving_frame( parent, hdc, &sizingRect, thickframe );
|
draw_moving_frame( parent, hdc, &sizingRect, thickframe );
|
||||||
}
|
}
|
||||||
|
@ -2952,7 +2926,7 @@ void WINPOS_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
|
||||||
if (!((msg.message == WM_KEYDOWN) && (msg.wParam == VK_ESCAPE)) )
|
if (!((msg.message == WM_KEYDOWN) && (msg.wParam == VK_ESCAPE)) )
|
||||||
{
|
{
|
||||||
/* NOTE: SWP_NOACTIVATE prevents document window activation in Word 6 */
|
/* NOTE: SWP_NOACTIVATE prevents document window activation in Word 6 */
|
||||||
if(!DragFullWindows || iconic)
|
if (!DragFullWindows)
|
||||||
SetWindowPos( hwnd, 0, sizingRect.left, sizingRect.top,
|
SetWindowPos( hwnd, 0, sizingRect.left, sizingRect.top,
|
||||||
sizingRect.right - sizingRect.left,
|
sizingRect.right - sizingRect.left,
|
||||||
sizingRect.bottom - sizingRect.top,
|
sizingRect.bottom - sizingRect.top,
|
||||||
|
|
Loading…
Reference in New Issue