user32: Get rid of icon titles.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
c45f60450a
commit
8dade1bc86
|
@ -155,9 +155,6 @@ extern HBRUSH DEFWND_ControlColor( HDC hDC, UINT ctlType ) DECLSPEC_HIDDEN;
|
||||||
/* desktop */
|
/* desktop */
|
||||||
extern BOOL update_wallpaper( const WCHAR *wallpaper, const WCHAR *pattern ) DECLSPEC_HIDDEN;
|
extern BOOL update_wallpaper( const WCHAR *wallpaper, const WCHAR *pattern ) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
/* icon title */
|
|
||||||
extern HWND ICONTITLE_Create( HWND hwnd ) DECLSPEC_HIDDEN;
|
|
||||||
|
|
||||||
/* menu controls */
|
/* menu controls */
|
||||||
extern HWND MENU_IsMenuActive(void) DECLSPEC_HIDDEN;
|
extern HWND MENU_IsMenuActive(void) DECLSPEC_HIDDEN;
|
||||||
extern UINT MENU_GetMenuBarHeight( HWND hwnd, UINT menubarWidth,
|
extern UINT MENU_GetMenuBarHeight( HWND hwnd, UINT menubarWidth,
|
||||||
|
|
|
@ -51,32 +51,6 @@ const struct builtin_class_descr ICONTITLE_builtin_class =
|
||||||
0 /* brush */
|
0 /* brush */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* ICONTITLE_Create
|
|
||||||
*/
|
|
||||||
HWND ICONTITLE_Create( HWND owner )
|
|
||||||
{
|
|
||||||
HWND hWnd;
|
|
||||||
HINSTANCE instance = (HINSTANCE)GetWindowLongPtrA( owner, GWLP_HINSTANCE );
|
|
||||||
LONG style = WS_CLIPSIBLINGS;
|
|
||||||
|
|
||||||
if (!IsWindowEnabled(owner)) style |= WS_DISABLED;
|
|
||||||
if( GetWindowLongA( owner, GWL_STYLE ) & WS_CHILD )
|
|
||||||
hWnd = CreateWindowExA( 0, (LPCSTR)ICONTITLE_CLASS_ATOM, NULL,
|
|
||||||
style | WS_CHILD, 0, 0, 1, 1,
|
|
||||||
GetParent(owner), 0, instance, NULL );
|
|
||||||
else
|
|
||||||
hWnd = CreateWindowExA( 0, (LPCSTR)ICONTITLE_CLASS_ATOM, NULL,
|
|
||||||
style, 0, 0, 1, 1,
|
|
||||||
owner, 0, instance, NULL );
|
|
||||||
WIN_SetOwner( hWnd, owner ); /* MDI depends on this */
|
|
||||||
SetWindowLongW( hWnd, GWL_STYLE,
|
|
||||||
GetWindowLongW( hWnd, GWL_STYLE ) & ~(WS_CAPTION | WS_BORDER) );
|
|
||||||
return hWnd;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* ICONTITLE_SetTitlePos
|
* ICONTITLE_SetTitlePos
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -3984,7 +3984,7 @@ static void test_mdi_messages(void)
|
||||||
ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
|
ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
|
||||||
|
|
||||||
ShowWindow(mdi_child2, SW_MINIMIZE);
|
ShowWindow(mdi_child2, SW_MINIMIZE);
|
||||||
ok_sequence(WmMinimizeMDIchildVisibleSeq, "ShowWindow(SW_MINIMIZE):MDI child", TRUE);
|
ok_sequence(WmMinimizeMDIchildVisibleSeq, "ShowWindow(SW_MINIMIZE):MDI child", FALSE);
|
||||||
|
|
||||||
ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
|
ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
|
||||||
ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
|
ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
|
||||||
|
|
|
@ -970,7 +970,6 @@ LRESULT WIN_DestroyWindow( HWND hwnd )
|
||||||
WND *wndPtr;
|
WND *wndPtr;
|
||||||
HWND *list;
|
HWND *list;
|
||||||
HMENU menu = 0, sys_menu;
|
HMENU menu = 0, sys_menu;
|
||||||
HWND icon_title;
|
|
||||||
struct window_surface *surface;
|
struct window_surface *surface;
|
||||||
|
|
||||||
TRACE("%p\n", hwnd );
|
TRACE("%p\n", hwnd );
|
||||||
|
@ -1018,7 +1017,6 @@ LRESULT WIN_DestroyWindow( HWND hwnd )
|
||||||
sys_menu = wndPtr->hSysMenu;
|
sys_menu = wndPtr->hSysMenu;
|
||||||
free_dce( wndPtr->dce, hwnd );
|
free_dce( wndPtr->dce, hwnd );
|
||||||
wndPtr->dce = NULL;
|
wndPtr->dce = NULL;
|
||||||
icon_title = wndPtr->icon_title;
|
|
||||||
HeapFree( GetProcessHeap(), 0, wndPtr->text );
|
HeapFree( GetProcessHeap(), 0, wndPtr->text );
|
||||||
wndPtr->text = NULL;
|
wndPtr->text = NULL;
|
||||||
HeapFree( GetProcessHeap(), 0, wndPtr->pScroll );
|
HeapFree( GetProcessHeap(), 0, wndPtr->pScroll );
|
||||||
|
@ -1028,7 +1026,6 @@ LRESULT WIN_DestroyWindow( HWND hwnd )
|
||||||
wndPtr->surface = NULL;
|
wndPtr->surface = NULL;
|
||||||
WIN_ReleasePtr( wndPtr );
|
WIN_ReleasePtr( wndPtr );
|
||||||
|
|
||||||
if (icon_title) DestroyWindow( icon_title );
|
|
||||||
if (menu) DestroyMenu( menu );
|
if (menu) DestroyMenu( menu );
|
||||||
if (sys_menu) DestroyMenu( sys_menu );
|
if (sys_menu) DestroyMenu( sys_menu );
|
||||||
if (surface)
|
if (surface)
|
||||||
|
|
|
@ -49,7 +49,6 @@ typedef struct tagWND
|
||||||
RECT normal_rect; /* Normal window rect saved when maximized/minimized */
|
RECT normal_rect; /* Normal window rect saved when maximized/minimized */
|
||||||
POINT min_pos; /* Position for minimized window */
|
POINT min_pos; /* Position for minimized window */
|
||||||
POINT max_pos; /* Position for maximized window */
|
POINT max_pos; /* Position for maximized window */
|
||||||
HWND icon_title; /* Icon title window */
|
|
||||||
LPWSTR text; /* Window text */
|
LPWSTR text; /* Window text */
|
||||||
void *pScroll; /* Scroll-bar info */
|
void *pScroll; /* Scroll-bar info */
|
||||||
DWORD dwStyle; /* Window style (from CreateWindow) */
|
DWORD dwStyle; /* Window style (from CreateWindow) */
|
||||||
|
@ -120,7 +119,6 @@ static inline void WIN_ReleasePtr( WND *ptr )
|
||||||
|
|
||||||
extern LRESULT HOOK_CallHooks( INT id, INT code, WPARAM wparam, LPARAM lparam, BOOL unicode ) DECLSPEC_HIDDEN;
|
extern LRESULT HOOK_CallHooks( INT id, INT code, WPARAM wparam, LPARAM lparam, BOOL unicode ) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
extern BOOL WINPOS_RedrawIconTitle( HWND hWnd ) DECLSPEC_HIDDEN;
|
|
||||||
extern MINMAXINFO WINPOS_GetMinMaxInfo( HWND hwnd ) DECLSPEC_HIDDEN;
|
extern MINMAXINFO WINPOS_GetMinMaxInfo( HWND hwnd ) DECLSPEC_HIDDEN;
|
||||||
extern LONG WINPOS_HandleWindowPosChanging(HWND hwnd, WINDOWPOS *winpos) DECLSPEC_HIDDEN;
|
extern LONG WINPOS_HandleWindowPosChanging(HWND hwnd, WINDOWPOS *winpos) DECLSPEC_HIDDEN;
|
||||||
extern HWND WINPOS_WindowFromPoint( HWND hwndScope, POINT pt, INT *hittest ) DECLSPEC_HIDDEN;
|
extern HWND WINPOS_WindowFromPoint( HWND hwndScope, POINT pt, INT *hittest ) DECLSPEC_HIDDEN;
|
||||||
|
|
|
@ -678,67 +678,6 @@ BOOL WINAPI MoveWindow( HWND hwnd, INT x, INT y, INT cx, INT cy,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* WINPOS_RedrawIconTitle
|
|
||||||
*/
|
|
||||||
BOOL WINPOS_RedrawIconTitle( HWND hWnd )
|
|
||||||
{
|
|
||||||
HWND icon_title = 0;
|
|
||||||
WND *win = WIN_GetPtr( hWnd );
|
|
||||||
|
|
||||||
if (win && win != WND_OTHER_PROCESS && win != WND_DESKTOP)
|
|
||||||
{
|
|
||||||
icon_title = win->icon_title;
|
|
||||||
WIN_ReleasePtr( win );
|
|
||||||
}
|
|
||||||
if (!icon_title) return FALSE;
|
|
||||||
SendMessageW( icon_title, WM_SHOWWINDOW, TRUE, 0 );
|
|
||||||
InvalidateRect( icon_title, NULL, TRUE );
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* WINPOS_ShowIconTitle
|
|
||||||
*/
|
|
||||||
static void WINPOS_ShowIconTitle( HWND hwnd, BOOL bShow )
|
|
||||||
{
|
|
||||||
WND *win = WIN_GetPtr( hwnd );
|
|
||||||
HWND title = 0;
|
|
||||||
|
|
||||||
TRACE("%p %i\n", hwnd, (bShow != 0) );
|
|
||||||
|
|
||||||
if (!win || win == WND_OTHER_PROCESS || win == WND_DESKTOP) return;
|
|
||||||
if (win->window_rect.left == -32000 || win->window_rect.top == -32000)
|
|
||||||
{
|
|
||||||
TRACE( "not showing title for hidden icon %p\n", hwnd );
|
|
||||||
bShow = FALSE;
|
|
||||||
}
|
|
||||||
else title = win->icon_title;
|
|
||||||
WIN_ReleasePtr( win );
|
|
||||||
|
|
||||||
if (bShow)
|
|
||||||
{
|
|
||||||
if (!title)
|
|
||||||
{
|
|
||||||
title = ICONTITLE_Create( hwnd );
|
|
||||||
if (!(win = WIN_GetPtr( hwnd )) || win == WND_OTHER_PROCESS)
|
|
||||||
{
|
|
||||||
DestroyWindow( title );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
win->icon_title = title;
|
|
||||||
WIN_ReleasePtr( win );
|
|
||||||
}
|
|
||||||
if (!IsWindowVisible(title))
|
|
||||||
{
|
|
||||||
SendMessageW( title, WM_SHOWWINDOW, TRUE, 0 );
|
|
||||||
SetWindowPos( title, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
|
|
||||||
SWP_NOACTIVATE | SWP_NOZORDER | SWP_SHOWWINDOW );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (title) ShowWindow( title, SW_HIDE );
|
|
||||||
}
|
|
||||||
|
|
||||||
/*******************************************************************
|
/*******************************************************************
|
||||||
* WINPOS_GetMinMaxInfo
|
* WINPOS_GetMinMaxInfo
|
||||||
*
|
*
|
||||||
|
@ -1053,10 +992,7 @@ UINT WINPOS_MinMaximize( HWND hwnd, UINT cmd, LPRECT rect )
|
||||||
|
|
||||||
old_style = WIN_SetStyle( hwnd, WS_MAXIMIZE, WS_MINIMIZE );
|
old_style = WIN_SetStyle( hwnd, WS_MAXIMIZE, WS_MINIMIZE );
|
||||||
if (old_style & WS_MINIMIZE)
|
if (old_style & WS_MINIMIZE)
|
||||||
{
|
|
||||||
win_set_flags( hwnd, WIN_RESTORE_MAX, 0 );
|
win_set_flags( hwnd, WIN_RESTORE_MAX, 0 );
|
||||||
WINPOS_ShowIconTitle( hwnd, FALSE );
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(old_style & WS_MAXIMIZE)) swpFlags |= SWP_STATECHANGED;
|
if (!(old_style & WS_MAXIMIZE)) swpFlags |= SWP_STATECHANGED;
|
||||||
SetRect( rect, minmax.ptMaxPosition.x, minmax.ptMaxPosition.y,
|
SetRect( rect, minmax.ptMaxPosition.x, minmax.ptMaxPosition.y,
|
||||||
|
@ -1072,7 +1008,6 @@ UINT WINPOS_MinMaximize( HWND hwnd, UINT cmd, LPRECT rect )
|
||||||
old_style = WIN_SetStyle( hwnd, 0, WS_MINIMIZE | WS_MAXIMIZE );
|
old_style = WIN_SetStyle( hwnd, 0, WS_MINIMIZE | WS_MAXIMIZE );
|
||||||
if (old_style & WS_MINIMIZE)
|
if (old_style & WS_MINIMIZE)
|
||||||
{
|
{
|
||||||
WINPOS_ShowIconTitle( hwnd, FALSE );
|
|
||||||
if (win_get_flags( hwnd ) & WIN_RESTORE_MAX)
|
if (win_get_flags( hwnd ) & WIN_RESTORE_MAX)
|
||||||
{
|
{
|
||||||
/* Restore to maximized position */
|
/* Restore to maximized position */
|
||||||
|
@ -1202,8 +1137,6 @@ static BOOL show_window( HWND hwnd, INT cmd )
|
||||||
{
|
{
|
||||||
HWND hFocus;
|
HWND hFocus;
|
||||||
|
|
||||||
WINPOS_ShowIconTitle( hwnd, FALSE );
|
|
||||||
|
|
||||||
/* FIXME: This will cause the window to be activated irrespective
|
/* FIXME: This will cause the window to be activated irrespective
|
||||||
* of whether it is owned by the same thread. Has to be done
|
* of whether it is owned by the same thread. Has to be done
|
||||||
* asynchronously.
|
* asynchronously.
|
||||||
|
@ -1223,8 +1156,6 @@ static BOOL show_window( HWND hwnd, INT cmd )
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsIconic(hwnd)) WINPOS_ShowIconTitle( hwnd, TRUE );
|
|
||||||
|
|
||||||
if (!(wndPtr = WIN_GetPtr( hwnd )) || wndPtr == WND_OTHER_PROCESS) goto done;
|
if (!(wndPtr = WIN_GetPtr( hwnd )) || wndPtr == WND_OTHER_PROCESS) goto done;
|
||||||
|
|
||||||
if (wndPtr->flags & WIN_NEED_SIZE)
|
if (wndPtr->flags & WIN_NEED_SIZE)
|
||||||
|
@ -1477,7 +1408,6 @@ static BOOL WINPOS_SetPlacement( HWND hwnd, const WINDOWPLACEMENT *wndpl, UINT f
|
||||||
{
|
{
|
||||||
if (flags & PLACE_MIN)
|
if (flags & PLACE_MIN)
|
||||||
{
|
{
|
||||||
WINPOS_ShowIconTitle( hwnd, FALSE );
|
|
||||||
SetWindowPos( hwnd, 0, wp.ptMinPosition.x, wp.ptMinPosition.y, 0, 0,
|
SetWindowPos( hwnd, 0, wp.ptMinPosition.x, wp.ptMinPosition.y, 0, 0,
|
||||||
SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE );
|
SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE );
|
||||||
}
|
}
|
||||||
|
@ -1498,8 +1428,6 @@ static BOOL WINPOS_SetPlacement( HWND hwnd, const WINDOWPLACEMENT *wndpl, UINT f
|
||||||
|
|
||||||
if (IsIconic( hwnd ))
|
if (IsIconic( hwnd ))
|
||||||
{
|
{
|
||||||
if (GetWindowLongW( hwnd, GWL_STYLE ) & WS_VISIBLE) WINPOS_ShowIconTitle( hwnd, TRUE );
|
|
||||||
|
|
||||||
/* SDK: ...valid only the next time... */
|
/* SDK: ...valid only the next time... */
|
||||||
if( wndpl->flags & WPF_RESTORETOMAXIMIZED )
|
if( wndpl->flags & WPF_RESTORETOMAXIMIZED )
|
||||||
win_set_flags( hwnd, WIN_RESTORE_MAX, 0 );
|
win_set_flags( hwnd, WIN_RESTORE_MAX, 0 );
|
||||||
|
@ -2947,7 +2875,6 @@ void WINPOS_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
|
||||||
{
|
{
|
||||||
hOldCursor = SetCursor(hDragCursor);
|
hOldCursor = SetCursor(hDragCursor);
|
||||||
ShowCursor( TRUE );
|
ShowCursor( TRUE );
|
||||||
WINPOS_ShowIconTitle( hwnd, FALSE );
|
|
||||||
}
|
}
|
||||||
else if(!DragFullWindows)
|
else if(!DragFullWindows)
|
||||||
draw_moving_frame( parent, hdc, &sizingRect, thickframe );
|
draw_moving_frame( parent, hdc, &sizingRect, thickframe );
|
||||||
|
@ -3051,6 +2978,5 @@ void WINPOS_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
|
||||||
SendMessageW( hwnd, WM_SYSCOMMAND,
|
SendMessageW( hwnd, WM_SYSCOMMAND,
|
||||||
SC_MOUSEMENU + HTSYSMENU, MAKELONG(pt.x,pt.y));
|
SC_MOUSEMENU + HTSYSMENU, MAKELONG(pt.x,pt.y));
|
||||||
}
|
}
|
||||||
else WINPOS_ShowIconTitle( hwnd, TRUE );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue