Don't bother sending WM_NCCREATE to the desktop window, this doesn't
work anyway (spotted by Uwe Bonnes).
This commit is contained in:
parent
5abc0654b5
commit
b650372b86
|
@ -116,18 +116,8 @@ static HBITMAP DESKTOP_LoadBitmap( HDC hdc, const char *filename )
|
||||||
*/
|
*/
|
||||||
static LRESULT WINAPI DesktopWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
|
static LRESULT WINAPI DesktopWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
|
||||||
{
|
{
|
||||||
LRESULT retvalue = 0;
|
/* all messages are ignored */
|
||||||
|
return 0;
|
||||||
if (message == WM_NCCREATE)
|
|
||||||
{
|
|
||||||
hbrushPattern = 0;
|
|
||||||
hbitmapWallPaper = 0;
|
|
||||||
SetDeskPattern();
|
|
||||||
SetDeskWallPaper( (LPSTR)-1 );
|
|
||||||
retvalue = 1;
|
|
||||||
}
|
|
||||||
/* all other messages are ignored */
|
|
||||||
return retvalue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -192,9 +182,7 @@ BOOL WINAPI PaintDesktop(HDC hdc)
|
||||||
*/
|
*/
|
||||||
BOOL16 WINAPI SetDeskPattern(void)
|
BOOL16 WINAPI SetDeskPattern(void)
|
||||||
{
|
{
|
||||||
char buffer[100];
|
return SystemParametersInfoA( SPI_SETDESKPATTERN, -1, NULL, FALSE );
|
||||||
GetProfileStringA( "desktop", "Pattern", "(None)", buffer, 100 );
|
|
||||||
return DESKTOP_SetPattern( buffer );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -44,42 +44,43 @@ BOOL TTYDRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode )
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
HWND hwndLinkAfter;
|
HWND hwndLinkAfter;
|
||||||
CBT_CREATEWNDA cbtc;
|
CBT_CREATEWNDA cbtc;
|
||||||
|
|
||||||
#ifdef WINE_CURSES
|
|
||||||
WND *wndPtr = WIN_GetPtr( hwnd );
|
WND *wndPtr = WIN_GetPtr( hwnd );
|
||||||
WINDOW *window;
|
|
||||||
INT cellWidth=8, cellHeight=8; /* FIXME: Hardcoded */
|
|
||||||
|
|
||||||
TRACE("(%p)\n", hwnd);
|
TRACE("(%p)\n", hwnd);
|
||||||
|
|
||||||
|
if (!wndPtr->parent) /* desktop window */
|
||||||
|
{
|
||||||
|
wndPtr->pDriverData = root_window;
|
||||||
|
WIN_ReleasePtr( wndPtr );
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef WINE_CURSES
|
||||||
/* Only create top-level windows */
|
/* Only create top-level windows */
|
||||||
if (!(wndPtr->dwStyle & WS_CHILD))
|
if (!(wndPtr->dwStyle & WS_CHILD))
|
||||||
{
|
{
|
||||||
if (!wndPtr->parent) /* desktop */
|
WINDOW *window;
|
||||||
window = root_window;
|
const INT cellWidth=8, cellHeight=8; /* FIXME: Hardcoded */
|
||||||
else
|
|
||||||
{
|
|
||||||
int x = wndPtr->rectWindow.left;
|
|
||||||
int y = wndPtr->rectWindow.top;
|
|
||||||
int cx = wndPtr->rectWindow.right - wndPtr->rectWindow.left;
|
|
||||||
int cy = wndPtr->rectWindow.bottom - wndPtr->rectWindow.top;
|
|
||||||
|
|
||||||
window = subwin( root_window, cy/cellHeight, cx/cellWidth,
|
int x = wndPtr->rectWindow.left;
|
||||||
y/cellHeight, x/cellWidth);
|
int y = wndPtr->rectWindow.top;
|
||||||
werase(window);
|
int cx = wndPtr->rectWindow.right - wndPtr->rectWindow.left;
|
||||||
wrefresh(window);
|
int cy = wndPtr->rectWindow.bottom - wndPtr->rectWindow.top;
|
||||||
}
|
|
||||||
|
window = subwin( root_window, cy/cellHeight, cx/cellWidth,
|
||||||
|
y/cellHeight, x/cellWidth);
|
||||||
|
werase(window);
|
||||||
|
wrefresh(window);
|
||||||
wndPtr->pDriverData = window;
|
wndPtr->pDriverData = window;
|
||||||
}
|
}
|
||||||
WIN_ReleasePtr( wndPtr );
|
|
||||||
#else /* defined(WINE_CURSES) */
|
#else /* defined(WINE_CURSES) */
|
||||||
FIXME("(%x): stub\n", hwnd);
|
FIXME("(%x): stub\n", hwnd);
|
||||||
#endif /* defined(WINE_CURSES) */
|
#endif /* defined(WINE_CURSES) */
|
||||||
|
WIN_ReleasePtr( wndPtr );
|
||||||
|
|
||||||
/* Call the WH_CBT hook */
|
/* Call the WH_CBT hook */
|
||||||
|
|
||||||
hwndLinkAfter = ((cs->style & (WS_CHILD|WS_MAXIMIZE)) == WS_CHILD)
|
hwndLinkAfter = ((cs->style & (WS_CHILD|WS_MAXIMIZE)) == WS_CHILD) ? HWND_BOTTOM : HWND_TOP;
|
||||||
? HWND_BOTTOM : HWND_TOP;
|
|
||||||
|
|
||||||
cbtc.lpcs = cs;
|
cbtc.lpcs = cs;
|
||||||
cbtc.hwndInsertAfter = hwndLinkAfter;
|
cbtc.hwndInsertAfter = hwndLinkAfter;
|
||||||
|
|
|
@ -36,6 +36,11 @@ static LRESULT WINAPI desktop_winproc( HWND hwnd, UINT message, WPARAM wParam, L
|
||||||
{
|
{
|
||||||
switch(message)
|
switch(message)
|
||||||
{
|
{
|
||||||
|
case WM_NCCREATE:
|
||||||
|
SystemParametersInfoA( SPI_SETDESKPATTERN, -1, NULL, FALSE );
|
||||||
|
SetDeskWallPaper( (LPSTR)-1 );
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
case WM_ERASEBKGND:
|
case WM_ERASEBKGND:
|
||||||
PaintDesktop( (HDC)wParam );
|
PaintDesktop( (HDC)wParam );
|
||||||
ValidateRect( hwnd, NULL );
|
ValidateRect( hwnd, NULL );
|
||||||
|
@ -79,6 +84,8 @@ static DWORD CALLBACK desktop_thread( LPVOID driver_data )
|
||||||
XMapWindow( display, root_window );
|
XMapWindow( display, root_window );
|
||||||
wine_tsx11_unlock();
|
wine_tsx11_unlock();
|
||||||
|
|
||||||
|
SendMessageW( hwnd, WM_NCCREATE, 0, 0 /* should be CREATESTRUCT */ );
|
||||||
|
|
||||||
while (GetMessageW( &msg, hwnd, 0, 0 )) DispatchMessageW( &msg );
|
while (GetMessageW( &msg, hwnd, 0, 0 )) DispatchMessageW( &msg );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -612,7 +612,7 @@ void X11DRV_register_window( Display *display, HWND hwnd, struct x11drv_win_data
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* create_desktop
|
* create_desktop
|
||||||
*/
|
*/
|
||||||
static void create_desktop( Display *display, WND *wndPtr, CREATESTRUCTA *cs )
|
static void create_desktop( Display *display, WND *wndPtr )
|
||||||
{
|
{
|
||||||
X11DRV_WND_DATA *data = wndPtr->pDriverData;
|
X11DRV_WND_DATA *data = wndPtr->pDriverData;
|
||||||
|
|
||||||
|
@ -640,7 +640,6 @@ static void create_desktop( Display *display, WND *wndPtr, CREATESTRUCTA *cs )
|
||||||
SetPropA( wndPtr->hwndSelf, client_window_atom, (HANDLE)root_window );
|
SetPropA( wndPtr->hwndSelf, client_window_atom, (HANDLE)root_window );
|
||||||
SetPropA( wndPtr->hwndSelf, "__wine_x11_visual_id", (HANDLE)XVisualIDFromVisual(visual) );
|
SetPropA( wndPtr->hwndSelf, "__wine_x11_visual_id", (HANDLE)XVisualIDFromVisual(visual) );
|
||||||
|
|
||||||
SendMessageW( wndPtr->hwndSelf, WM_NCCREATE, 0, (LPARAM)cs );
|
|
||||||
if (root_window != DefaultRootWindow(display)) X11DRV_create_desktop_thread();
|
if (root_window != DefaultRootWindow(display)) X11DRV_create_desktop_thread();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -899,7 +898,7 @@ BOOL X11DRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode )
|
||||||
|
|
||||||
if (!wndPtr->parent)
|
if (!wndPtr->parent)
|
||||||
{
|
{
|
||||||
create_desktop( display, wndPtr, cs );
|
create_desktop( display, wndPtr );
|
||||||
WIN_ReleasePtr( wndPtr );
|
WIN_ReleasePtr( wndPtr );
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue