Commit 936ab3a6 authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Moved the ShowWindow implementation from winex11 back to user32.

parent 63dd1a02
...@@ -119,7 +119,6 @@ static const USER_DRIVER *load_driver(void) ...@@ -119,7 +119,6 @@ static const USER_DRIVER *load_driver(void)
GET_USER_FUNC(SetWindowIcon); GET_USER_FUNC(SetWindowIcon);
GET_USER_FUNC(SetWindowStyle); GET_USER_FUNC(SetWindowStyle);
GET_USER_FUNC(SetWindowText); GET_USER_FUNC(SetWindowText);
GET_USER_FUNC(ShowWindow);
GET_USER_FUNC(SysCommandSizeMove); GET_USER_FUNC(SysCommandSizeMove);
GET_USER_FUNC(WindowMessage); GET_USER_FUNC(WindowMessage);
#undef GET_USER_FUNC #undef GET_USER_FUNC
...@@ -396,11 +395,6 @@ static void nulldrv_SetWindowText( HWND hwnd, LPCWSTR text ) ...@@ -396,11 +395,6 @@ static void nulldrv_SetWindowText( HWND hwnd, LPCWSTR text )
{ {
} }
static BOOL nulldrv_ShowWindow( HWND hwnd, INT cmd )
{
return FALSE;
}
static void nulldrv_SysCommandSizeMove( HWND hwnd, WPARAM wparam ) static void nulldrv_SysCommandSizeMove( HWND hwnd, WPARAM wparam )
{ {
} }
...@@ -465,7 +459,6 @@ static const USER_DRIVER null_driver = ...@@ -465,7 +459,6 @@ static const USER_DRIVER null_driver =
nulldrv_SetWindowIcon, nulldrv_SetWindowIcon,
nulldrv_SetWindowStyle, nulldrv_SetWindowStyle,
nulldrv_SetWindowText, nulldrv_SetWindowText,
nulldrv_ShowWindow,
nulldrv_SysCommandSizeMove, nulldrv_SysCommandSizeMove,
nulldrv_WindowMessage nulldrv_WindowMessage
}; };
...@@ -721,11 +714,6 @@ static void loaderdrv_SetWindowText( HWND hwnd, LPCWSTR text ) ...@@ -721,11 +714,6 @@ static void loaderdrv_SetWindowText( HWND hwnd, LPCWSTR text )
load_driver()->pSetWindowText( hwnd, text ); load_driver()->pSetWindowText( hwnd, text );
} }
static BOOL loaderdrv_ShowWindow( HWND hwnd, INT cmd )
{
return load_driver()->pShowWindow( hwnd, cmd );
}
static void loaderdrv_SysCommandSizeMove( HWND hwnd, WPARAM wparam ) static void loaderdrv_SysCommandSizeMove( HWND hwnd, WPARAM wparam )
{ {
load_driver()->pSysCommandSizeMove( hwnd, wparam ); load_driver()->pSysCommandSizeMove( hwnd, wparam );
...@@ -791,7 +779,6 @@ static const USER_DRIVER lazy_load_driver = ...@@ -791,7 +779,6 @@ static const USER_DRIVER lazy_load_driver =
loaderdrv_SetWindowIcon, loaderdrv_SetWindowIcon,
loaderdrv_SetWindowStyle, loaderdrv_SetWindowStyle,
loaderdrv_SetWindowText, loaderdrv_SetWindowText,
loaderdrv_ShowWindow,
loaderdrv_SysCommandSizeMove, loaderdrv_SysCommandSizeMove,
loaderdrv_WindowMessage loaderdrv_WindowMessage
}; };
...@@ -789,7 +789,6 @@ ...@@ -789,7 +789,6 @@
# #
@ cdecl HOOK_CallHooks(long long long long long) @ cdecl HOOK_CallHooks(long long long long long)
@ cdecl USER_Unlock() @ cdecl USER_Unlock()
@ cdecl WINPOS_ActivateOtherWindow(long)
@ cdecl WINPOS_GetMinMaxInfo(long ptr ptr ptr ptr) @ cdecl WINPOS_GetMinMaxInfo(long ptr ptr ptr ptr)
@ cdecl WINPOS_ShowIconTitle(long long) @ cdecl WINPOS_ShowIconTitle(long long)
@ cdecl WIN_GetPtr(long) @ cdecl WIN_GetPtr(long)
......
...@@ -155,7 +155,6 @@ typedef struct tagUSER_DRIVER { ...@@ -155,7 +155,6 @@ typedef struct tagUSER_DRIVER {
void (*pSetWindowIcon)(HWND,UINT,HICON); void (*pSetWindowIcon)(HWND,UINT,HICON);
void (*pSetWindowStyle)(HWND,DWORD); void (*pSetWindowStyle)(HWND,DWORD);
void (*pSetWindowText)(HWND,LPCWSTR); void (*pSetWindowText)(HWND,LPCWSTR);
BOOL (*pShowWindow)(HWND,INT);
void (*pSysCommandSizeMove)(HWND,WPARAM); void (*pSysCommandSizeMove)(HWND,WPARAM);
LRESULT (*pWindowMessage)(HWND,UINT,WPARAM,LPARAM); LRESULT (*pWindowMessage)(HWND,UINT,WPARAM,LPARAM);
} USER_DRIVER; } USER_DRIVER;
......
...@@ -868,7 +868,7 @@ static void dump_window_styles( DWORD style, DWORD exstyle ) ...@@ -868,7 +868,7 @@ static void dump_window_styles( DWORD style, DWORD exstyle )
*/ */
static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, LPCWSTR className, UINT flags ) static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, LPCWSTR className, UINT flags )
{ {
INT cx, cy, sw = SW_SHOW; INT cx, cy, style, sw = SW_SHOW;
LRESULT result; LRESULT result;
RECT rect; RECT rect;
WND *wndPtr; WND *wndPtr;
...@@ -1153,6 +1153,10 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, LPCWSTR className, UINT flags ...@@ -1153,6 +1153,10 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, LPCWSTR className, UINT flags
result = SendMessageA( hwnd, WM_CREATE, 0, (LPARAM)cs ); result = SendMessageA( hwnd, WM_CREATE, 0, (LPARAM)cs );
if (result == -1) goto failed; if (result == -1) goto failed;
/* call the driver */
if (!USER_Driver->pCreateWindow( hwnd )) goto failed;
NotifyWinEvent(EVENT_OBJECT_CREATE, hwnd, OBJID_WINDOW, 0); NotifyWinEvent(EVENT_OBJECT_CREATE, hwnd, OBJID_WINDOW, 0);
/* send the size messages */ /* send the size messages */
...@@ -1168,9 +1172,19 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, LPCWSTR className, UINT flags ...@@ -1168,9 +1172,19 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, LPCWSTR className, UINT flags
} }
else WIN_ReleasePtr( wndPtr ); else WIN_ReleasePtr( wndPtr );
/* call the driver */ /* Show the window, maximizing or minimizing if needed */
if (!USER_Driver->pCreateWindow( hwnd )) goto failed; style = WIN_SetStyle( hwnd, 0, WS_MAXIMIZE | WS_MINIMIZE );
if (style & (WS_MINIMIZE | WS_MAXIMIZE))
{
RECT newPos;
UINT swFlag = (style & WS_MINIMIZE) ? SW_MINIMIZE : SW_MAXIMIZE;
swFlag = WINPOS_MinMaximize( hwnd, swFlag, &newPos );
swFlag |= SWP_FRAMECHANGED; /* Frame always gets changed */
if (!(style & WS_VISIBLE) || (style & WS_CHILD) || GetActiveWindow()) swFlag |= SWP_NOACTIVATE;
SetWindowPos( hwnd, 0, newPos.left, newPos.top, newPos.right, newPos.bottom, swFlag );
}
/* Notify the parent window only */ /* Notify the parent window only */
......
...@@ -1376,33 +1376,12 @@ BOOL X11DRV_CreateDesktopWindow( HWND hwnd ) ...@@ -1376,33 +1376,12 @@ BOOL X11DRV_CreateDesktopWindow( HWND hwnd )
BOOL X11DRV_CreateWindow( HWND hwnd ) BOOL X11DRV_CreateWindow( HWND hwnd )
{ {
Display *display = thread_display(); Display *display = thread_display();
DWORD style;
if (hwnd == GetDesktopWindow() && root_window != DefaultRootWindow( display )) if (hwnd == GetDesktopWindow() && root_window != DefaultRootWindow( display ))
{ {
/* the desktop win data can't be created lazily */ /* the desktop win data can't be created lazily */
if (!create_desktop_win_data( display, hwnd )) return FALSE; if (!create_desktop_win_data( display, hwnd )) return FALSE;
} }
/* Show the window, maximizing or minimizing if needed */
style = GetWindowLongW( hwnd, GWL_STYLE );
if (style & (WS_MINIMIZE | WS_MAXIMIZE))
{
extern UINT WINPOS_MinMaximize( HWND hwnd, UINT cmd, LPRECT rect ); /*FIXME*/
RECT newPos;
UINT swFlag = (style & WS_MINIMIZE) ? SW_MINIMIZE : SW_MAXIMIZE;
WIN_SetStyle( hwnd, 0, WS_MAXIMIZE | WS_MINIMIZE );
swFlag = WINPOS_MinMaximize( hwnd, swFlag, &newPos );
swFlag |= SWP_FRAMECHANGED; /* Frame always gets changed */
if (!(style & WS_VISIBLE) || (style & WS_CHILD) || GetActiveWindow()) swFlag |= SWP_NOACTIVATE;
SetWindowPos( hwnd, 0, newPos.left, newPos.top,
newPos.right, newPos.bottom, swFlag );
}
return TRUE; return TRUE;
} }
......
...@@ -110,7 +110,6 @@ ...@@ -110,7 +110,6 @@
@ cdecl SetWindowRgn(long long long) X11DRV_SetWindowRgn @ cdecl SetWindowRgn(long long long) X11DRV_SetWindowRgn
@ cdecl SetWindowStyle(ptr long) X11DRV_SetWindowStyle @ cdecl SetWindowStyle(ptr long) X11DRV_SetWindowStyle
@ cdecl SetWindowText(long wstr) X11DRV_SetWindowText @ cdecl SetWindowText(long wstr) X11DRV_SetWindowText
@ cdecl ShowWindow(long long) X11DRV_ShowWindow
@ cdecl SysCommandSizeMove(long long) X11DRV_SysCommandSizeMove @ cdecl SysCommandSizeMove(long long) X11DRV_SysCommandSizeMove
@ cdecl WindowMessage(long long long long) X11DRV_WindowMessage @ cdecl WindowMessage(long long long long) X11DRV_WindowMessage
......
...@@ -115,8 +115,10 @@ extern LONG WINPOS_HandleWindowPosChanging(HWND hwnd, WINDOWPOS *winpos) DECLSPE ...@@ -115,8 +115,10 @@ extern LONG WINPOS_HandleWindowPosChanging(HWND hwnd, WINDOWPOS *winpos) DECLSPE
extern HWND WINPOS_WindowFromPoint( HWND hwndScope, POINT pt, INT *hittest ) DECLSPEC_HIDDEN; extern HWND WINPOS_WindowFromPoint( HWND hwndScope, POINT pt, INT *hittest ) DECLSPEC_HIDDEN;
extern void WINPOS_CheckInternalPos( HWND hwnd ) DECLSPEC_HIDDEN; extern void WINPOS_CheckInternalPos( HWND hwnd ) DECLSPEC_HIDDEN;
extern void WINPOS_ActivateOtherWindow( HWND hwnd ) DECLSPEC_HIDDEN; extern void WINPOS_ActivateOtherWindow( HWND hwnd ) DECLSPEC_HIDDEN;
extern UINT WINPOS_MinMaximize( HWND hwnd, UINT cmd, LPRECT rect ) DECLSPEC_HIDDEN;
extern BOOL set_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, extern BOOL set_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags,
const RECT *window_rect, const RECT *client_rect, const RECT *valid_rects ); const RECT *window_rect, const RECT *client_rect,
const RECT *valid_rects ) DECLSPEC_HIDDEN;
#endif /* __WINE_WIN_H */ #endif /* __WINE_WIN_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment