Commit b650372b authored by Alexandre Julliard's avatar Alexandre Julliard

Don't bother sending WM_NCCREATE to the desktop window, this doesn't

work anyway (spotted by Uwe Bonnes).
parent 5abc0654
......@@ -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 )
{
LRESULT retvalue = 0;
if (message == WM_NCCREATE)
{
hbrushPattern = 0;
hbitmapWallPaper = 0;
SetDeskPattern();
SetDeskWallPaper( (LPSTR)-1 );
retvalue = 1;
}
/* all other messages are ignored */
return retvalue;
/* all messages are ignored */
return 0;
}
/***********************************************************************
......@@ -192,9 +182,7 @@ BOOL WINAPI PaintDesktop(HDC hdc)
*/
BOOL16 WINAPI SetDeskPattern(void)
{
char buffer[100];
GetProfileStringA( "desktop", "Pattern", "(None)", buffer, 100 );
return DESKTOP_SetPattern( buffer );
return SystemParametersInfoA( SPI_SETDESKPATTERN, -1, NULL, FALSE );
}
......
......@@ -44,42 +44,43 @@ BOOL TTYDRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode )
BOOL ret;
HWND hwndLinkAfter;
CBT_CREATEWNDA cbtc;
#ifdef WINE_CURSES
WND *wndPtr = WIN_GetPtr( hwnd );
WINDOW *window;
INT cellWidth=8, cellHeight=8; /* FIXME: Hardcoded */
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 */
if (!(wndPtr->dwStyle & WS_CHILD))
{
if (!wndPtr->parent) /* desktop */
window = root_window;
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,
y/cellHeight, x/cellWidth);
werase(window);
wrefresh(window);
}
WINDOW *window;
const INT cellWidth=8, cellHeight=8; /* FIXME: Hardcoded */
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,
y/cellHeight, x/cellWidth);
werase(window);
wrefresh(window);
wndPtr->pDriverData = window;
}
WIN_ReleasePtr( wndPtr );
#else /* defined(WINE_CURSES) */
FIXME("(%x): stub\n", hwnd);
#endif /* defined(WINE_CURSES) */
WIN_ReleasePtr( wndPtr );
/* Call the WH_CBT hook */
hwndLinkAfter = ((cs->style & (WS_CHILD|WS_MAXIMIZE)) == WS_CHILD)
? HWND_BOTTOM : HWND_TOP;
hwndLinkAfter = ((cs->style & (WS_CHILD|WS_MAXIMIZE)) == WS_CHILD) ? HWND_BOTTOM : HWND_TOP;
cbtc.lpcs = cs;
cbtc.hwndInsertAfter = hwndLinkAfter;
......
......@@ -36,6 +36,11 @@ static LRESULT WINAPI desktop_winproc( HWND hwnd, UINT message, WPARAM wParam, L
{
switch(message)
{
case WM_NCCREATE:
SystemParametersInfoA( SPI_SETDESKPATTERN, -1, NULL, FALSE );
SetDeskWallPaper( (LPSTR)-1 );
return TRUE;
case WM_ERASEBKGND:
PaintDesktop( (HDC)wParam );
ValidateRect( hwnd, NULL );
......@@ -79,6 +84,8 @@ static DWORD CALLBACK desktop_thread( LPVOID driver_data )
XMapWindow( display, root_window );
wine_tsx11_unlock();
SendMessageW( hwnd, WM_NCCREATE, 0, 0 /* should be CREATESTRUCT */ );
while (GetMessageW( &msg, hwnd, 0, 0 )) DispatchMessageW( &msg );
return 0;
}
......
......@@ -612,7 +612,7 @@ void X11DRV_register_window( Display *display, HWND hwnd, struct x11drv_win_data
/**********************************************************************
* 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;
......@@ -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, "__wine_x11_visual_id", (HANDLE)XVisualIDFromVisual(visual) );
SendMessageW( wndPtr->hwndSelf, WM_NCCREATE, 0, (LPARAM)cs );
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)
{
create_desktop( display, wndPtr, cs );
create_desktop( display, wndPtr );
WIN_ReleasePtr( wndPtr );
return TRUE;
}
......
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