Commit 2f112131 authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Notify the user driver about window extended style changes too.

parent 54d920ae
......@@ -388,7 +388,7 @@ static void nulldrv_SetWindowIcon( HWND hwnd, UINT type, HICON icon )
{
}
static void nulldrv_SetWindowStyle( HWND hwnd, DWORD old_style )
static void nulldrv_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style )
{
}
......@@ -723,9 +723,9 @@ static void loaderdrv_SetWindowIcon( HWND hwnd, UINT type, HICON icon )
load_driver()->pSetWindowIcon( hwnd, type, icon );
}
static void loaderdrv_SetWindowStyle( HWND hwnd, DWORD old_style )
static void loaderdrv_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style )
{
load_driver()->pSetWindowStyle( hwnd, old_style );
load_driver()->pSetWindowStyle( hwnd, offset, style );
}
static void loaderdrv_SetWindowText( HWND hwnd, LPCWSTR text )
......
......@@ -153,7 +153,7 @@ typedef struct tagUSER_DRIVER {
void (*pSetParent)(HWND,HWND,HWND);
int (*pSetWindowRgn)(HWND,HRGN,BOOL);
void (*pSetWindowIcon)(HWND,UINT,HICON);
void (*pSetWindowStyle)(HWND,DWORD);
void (*pSetWindowStyle)(HWND,INT,STYLESTRUCT*);
void (*pSetWindowText)(HWND,LPCWSTR);
UINT (*pShowWindow)(HWND,INT,RECT*,UINT);
LRESULT (*pSysCommand)(HWND,WPARAM,LPARAM);
......
......@@ -536,7 +536,7 @@ HWND WIN_SetOwner( HWND hwnd, HWND owner )
ULONG WIN_SetStyle( HWND hwnd, ULONG set_bits, ULONG clear_bits )
{
BOOL ok;
ULONG new_style, old_style = 0;
STYLESTRUCT style;
WND *win = WIN_GetPtr( hwnd );
if (!win || win == WND_DESKTOP) return 0;
......@@ -547,32 +547,33 @@ ULONG WIN_SetStyle( HWND hwnd, ULONG set_bits, ULONG clear_bits )
set_bits, clear_bits, hwnd );
return 0;
}
new_style = (win->dwStyle | set_bits) & ~clear_bits;
if (new_style == win->dwStyle)
style.styleOld = win->dwStyle;
style.styleNew = (win->dwStyle | set_bits) & ~clear_bits;
if (style.styleNew == style.styleOld)
{
WIN_ReleasePtr( win );
return new_style;
return style.styleNew;
}
SERVER_START_REQ( set_window_info )
{
req->handle = hwnd;
req->flags = SET_WIN_STYLE;
req->style = new_style;
req->style = style.styleNew;
req->extra_offset = -1;
if ((ok = !wine_server_call( req )))
{
old_style = reply->old_style;
win->dwStyle = new_style;
style.styleOld = reply->old_style;
win->dwStyle = style.styleNew;
}
}
SERVER_END_REQ;
WIN_ReleasePtr( win );
if (ok)
{
USER_Driver->pSetWindowStyle( hwnd, old_style );
if ((old_style ^ new_style) & WS_VISIBLE) invalidate_dce( hwnd, NULL );
USER_Driver->pSetWindowStyle( hwnd, GWL_STYLE, &style );
if ((style.styleOld ^ style.styleNew) & WS_VISIBLE) invalidate_dce( hwnd, NULL );
}
return old_style;
return style.styleOld;
}
......@@ -2131,10 +2132,11 @@ LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, UINT size, LONG_PTR newval, B
if (!ok) return 0;
if (offset == GWL_STYLE) USER_Driver->pSetWindowStyle( hwnd, retval );
if (offset == GWL_STYLE || offset == GWL_EXSTYLE)
{
USER_Driver->pSetWindowStyle( hwnd, offset, &style );
SendMessageW( hwnd, WM_STYLECHANGED, offset, (LPARAM)&style );
}
return retval;
}
......
......@@ -1455,16 +1455,15 @@ void X11DRV_SetWindowText( HWND hwnd, LPCWSTR text )
*
* Update the X state of a window to reflect a style change
*/
void X11DRV_SetWindowStyle( HWND hwnd, DWORD old_style )
void X11DRV_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style )
{
struct x11drv_win_data *data;
DWORD new_style, changed;
DWORD changed;
if (hwnd == GetDesktopWindow()) return;
new_style = GetWindowLongW( hwnd, GWL_STYLE );
changed = new_style ^ old_style;
changed = style->styleNew ^ style->styleOld;
if ((changed & WS_VISIBLE) && (new_style & WS_VISIBLE))
if (offset == GWL_STYLE && (changed & WS_VISIBLE) && (style->styleNew & WS_VISIBLE))
{
/* we don't unmap windows, that causes trouble with the window manager */
if (!(data = X11DRV_get_win_data( hwnd )) &&
......@@ -1474,17 +1473,17 @@ void X11DRV_SetWindowStyle( HWND hwnd, DWORD old_style )
{
Display *display = thread_display();
set_wm_hints( display, data );
if (!data->mapped) map_window( display, data, new_style );
if (!data->mapped) map_window( display, data, style->styleNew );
}
}
if (changed & WS_DISABLED)
if (offset == GWL_STYLE && (changed & WS_DISABLED))
{
data = X11DRV_get_win_data( hwnd );
if (data && data->wm_hints)
{
wine_tsx11_lock();
data->wm_hints->input = !(new_style & WS_DISABLED);
data->wm_hints->input = !(style->styleNew & WS_DISABLED);
XSetWMHints( thread_display(), data->whole_window, data->wm_hints );
wine_tsx11_unlock();
}
......
......@@ -109,7 +109,7 @@
@ cdecl SetParent(long long long) X11DRV_SetParent
@ cdecl SetWindowIcon(long long long) X11DRV_SetWindowIcon
@ cdecl SetWindowRgn(long long long) X11DRV_SetWindowRgn
@ cdecl SetWindowStyle(ptr long) X11DRV_SetWindowStyle
@ cdecl SetWindowStyle(ptr long ptr) X11DRV_SetWindowStyle
@ cdecl SetWindowText(long wstr) X11DRV_SetWindowText
@ cdecl ShowWindow(long long ptr long) X11DRV_ShowWindow
@ cdecl SysCommand(long long long) X11DRV_SysCommand
......
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