[PATCH v2 8/9] user32: Get rid of icon titles.
Zebediah Figura
z.figura12 at gmail.com
Tue Feb 19 11:27:43 CST 2019
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
dlls/user32/controls.h | 3 --
dlls/user32/icontitle.c | 26 ---------------
dlls/user32/tests/msg.c | 2 +-
dlls/user32/win.c | 3 --
dlls/user32/win.h | 2 --
dlls/user32/winpos.c | 74 -----------------------------------------
6 files changed, 1 insertion(+), 109 deletions(-)
diff --git a/dlls/user32/controls.h b/dlls/user32/controls.h
index 164164506e..d372bafcef 100644
--- a/dlls/user32/controls.h
+++ b/dlls/user32/controls.h
@@ -155,9 +155,6 @@ extern HBRUSH DEFWND_ControlColor( HDC hDC, UINT ctlType ) DECLSPEC_HIDDEN;
/* desktop */
extern BOOL update_wallpaper( const WCHAR *wallpaper, const WCHAR *pattern ) DECLSPEC_HIDDEN;
-/* icon title */
-extern HWND ICONTITLE_Create( HWND hwnd ) DECLSPEC_HIDDEN;
-
/* menu controls */
extern HWND MENU_IsMenuActive(void) DECLSPEC_HIDDEN;
extern UINT MENU_GetMenuBarHeight( HWND hwnd, UINT menubarWidth,
diff --git a/dlls/user32/icontitle.c b/dlls/user32/icontitle.c
index 77e286ebc1..e10717de41 100644
--- a/dlls/user32/icontitle.c
+++ b/dlls/user32/icontitle.c
@@ -51,32 +51,6 @@ const struct builtin_class_descr ICONTITLE_builtin_class =
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
*/
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index d79d1004d1..53cecd72f1 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -3984,7 +3984,7 @@ static void test_mdi_messages(void)
ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
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(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
diff --git a/dlls/user32/win.c b/dlls/user32/win.c
index dd6142d16c..24b2a2ffd5 100644
--- a/dlls/user32/win.c
+++ b/dlls/user32/win.c
@@ -970,7 +970,6 @@ LRESULT WIN_DestroyWindow( HWND hwnd )
WND *wndPtr;
HWND *list;
HMENU menu = 0, sys_menu;
- HWND icon_title;
struct window_surface *surface;
TRACE("%p\n", hwnd );
@@ -1018,7 +1017,6 @@ LRESULT WIN_DestroyWindow( HWND hwnd )
sys_menu = wndPtr->hSysMenu;
free_dce( wndPtr->dce, hwnd );
wndPtr->dce = NULL;
- icon_title = wndPtr->icon_title;
HeapFree( GetProcessHeap(), 0, wndPtr->text );
wndPtr->text = NULL;
HeapFree( GetProcessHeap(), 0, wndPtr->pScroll );
@@ -1028,7 +1026,6 @@ LRESULT WIN_DestroyWindow( HWND hwnd )
wndPtr->surface = NULL;
WIN_ReleasePtr( wndPtr );
- if (icon_title) DestroyWindow( icon_title );
if (menu) DestroyMenu( menu );
if (sys_menu) DestroyMenu( sys_menu );
if (surface)
diff --git a/dlls/user32/win.h b/dlls/user32/win.h
index f3bdfd38d9..81b08fc95e 100644
--- a/dlls/user32/win.h
+++ b/dlls/user32/win.h
@@ -49,7 +49,6 @@ typedef struct tagWND
RECT normal_rect; /* Normal window rect saved when maximized/minimized */
POINT min_pos; /* Position for minimized window */
POINT max_pos; /* Position for maximized window */
- HWND icon_title; /* Icon title window */
LPWSTR text; /* Window text */
void *pScroll; /* Scroll-bar info */
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 BOOL WINPOS_RedrawIconTitle( HWND hWnd ) DECLSPEC_HIDDEN;
extern MINMAXINFO WINPOS_GetMinMaxInfo( HWND hwnd ) DECLSPEC_HIDDEN;
extern LONG WINPOS_HandleWindowPosChanging(HWND hwnd, WINDOWPOS *winpos) DECLSPEC_HIDDEN;
extern HWND WINPOS_WindowFromPoint( HWND hwndScope, POINT pt, INT *hittest ) DECLSPEC_HIDDEN;
diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c
index acd748f13c..a938fa9314 100644
--- a/dlls/user32/winpos.c
+++ b/dlls/user32/winpos.c
@@ -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
*
@@ -1053,10 +992,7 @@ UINT WINPOS_MinMaximize( HWND hwnd, UINT cmd, LPRECT rect )
old_style = WIN_SetStyle( hwnd, WS_MAXIMIZE, WS_MINIMIZE );
if (old_style & WS_MINIMIZE)
- {
win_set_flags( hwnd, WIN_RESTORE_MAX, 0 );
- WINPOS_ShowIconTitle( hwnd, FALSE );
- }
if (!(old_style & WS_MAXIMIZE)) swpFlags |= SWP_STATECHANGED;
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 );
if (old_style & WS_MINIMIZE)
{
- WINPOS_ShowIconTitle( hwnd, FALSE );
if (win_get_flags( hwnd ) & WIN_RESTORE_MAX)
{
/* Restore to maximized position */
@@ -1202,8 +1137,6 @@ static BOOL show_window( HWND hwnd, INT cmd )
{
HWND hFocus;
- WINPOS_ShowIconTitle( hwnd, FALSE );
-
/* FIXME: This will cause the window to be activated irrespective
* of whether it is owned by the same thread. Has to be done
* asynchronously.
@@ -1223,8 +1156,6 @@ static BOOL show_window( HWND hwnd, INT cmd )
goto done;
}
- if (IsIconic(hwnd)) WINPOS_ShowIconTitle( hwnd, TRUE );
-
if (!(wndPtr = WIN_GetPtr( hwnd )) || wndPtr == WND_OTHER_PROCESS) goto done;
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)
{
- WINPOS_ShowIconTitle( hwnd, FALSE );
SetWindowPos( hwnd, 0, wp.ptMinPosition.x, wp.ptMinPosition.y, 0, 0,
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 (GetWindowLongW( hwnd, GWL_STYLE ) & WS_VISIBLE) WINPOS_ShowIconTitle( hwnd, TRUE );
-
/* SDK: ...valid only the next time... */
if( wndpl->flags & WPF_RESTORETOMAXIMIZED )
win_set_flags( hwnd, WIN_RESTORE_MAX, 0 );
@@ -2947,7 +2875,6 @@ void WINPOS_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
{
hOldCursor = SetCursor(hDragCursor);
ShowCursor( TRUE );
- WINPOS_ShowIconTitle( hwnd, FALSE );
}
else if(!DragFullWindows)
draw_moving_frame( parent, hdc, &sizingRect, thickframe );
@@ -3051,6 +2978,5 @@ void WINPOS_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
SendMessageW( hwnd, WM_SYSCOMMAND,
SC_MOUSEMENU + HTSYSMENU, MAKELONG(pt.x,pt.y));
}
- else WINPOS_ShowIconTitle( hwnd, TRUE );
}
}
--
2.20.1
More information about the wine-devel
mailing list