Commit 74cd76c9 authored by Alexandre Julliard's avatar Alexandre Julliard

winex11: Tool windows should not have WM decorations.

parent 8765a0da
......@@ -560,23 +560,26 @@ void X11DRV_set_wm_hints( Display *display, struct x11drv_win_data *data )
mwm_hints.flags = MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS;
mwm_hints.functions = MWM_FUNC_MOVE;
if (style & WS_THICKFRAME) mwm_hints.functions |= MWM_FUNC_RESIZE;
if (style & WS_THICKFRAME) mwm_hints.functions |= MWM_FUNC_RESIZE;
if (style & WS_MINIMIZEBOX) mwm_hints.functions |= MWM_FUNC_MINIMIZE;
if (style & WS_MAXIMIZEBOX) mwm_hints.functions |= MWM_FUNC_MAXIMIZE;
if (style & WS_SYSMENU) mwm_hints.functions |= MWM_FUNC_CLOSE;
if (style & WS_SYSMENU) mwm_hints.functions |= MWM_FUNC_CLOSE;
mwm_hints.decorations = 0;
if ((style & WS_CAPTION) == WS_CAPTION)
if (!(ex_style & WS_EX_TOOLWINDOW))
{
mwm_hints.decorations |= MWM_DECOR_TITLE;
if (style & WS_SYSMENU) mwm_hints.decorations |= MWM_DECOR_MENU;
if (style & WS_MINIMIZEBOX) mwm_hints.decorations |= MWM_DECOR_MINIMIZE;
if (style & WS_MAXIMIZEBOX) mwm_hints.decorations |= MWM_DECOR_MAXIMIZE;
if ((style & WS_CAPTION) == WS_CAPTION)
{
mwm_hints.decorations |= MWM_DECOR_TITLE;
if (style & WS_SYSMENU) mwm_hints.decorations |= MWM_DECOR_MENU;
if (style & WS_MINIMIZEBOX) mwm_hints.decorations |= MWM_DECOR_MINIMIZE;
if (style & WS_MAXIMIZEBOX) mwm_hints.decorations |= MWM_DECOR_MAXIMIZE;
}
if (ex_style & WS_EX_DLGMODALFRAME) mwm_hints.decorations |= MWM_DECOR_BORDER;
else if (style & WS_THICKFRAME) mwm_hints.decorations |= MWM_DECOR_BORDER | MWM_DECOR_RESIZEH;
else if ((style & (WS_DLGFRAME|WS_BORDER)) == WS_DLGFRAME) mwm_hints.decorations |= MWM_DECOR_BORDER;
else if (style & WS_BORDER) mwm_hints.decorations |= MWM_DECOR_BORDER;
else if (!(style & (WS_CHILD|WS_POPUP))) mwm_hints.decorations |= MWM_DECOR_BORDER;
}
if (ex_style & WS_EX_DLGMODALFRAME) mwm_hints.decorations |= MWM_DECOR_BORDER;
else if (style & WS_THICKFRAME) mwm_hints.decorations |= MWM_DECOR_BORDER | MWM_DECOR_RESIZEH;
else if ((style & (WS_DLGFRAME|WS_BORDER)) == WS_DLGFRAME) mwm_hints.decorations |= MWM_DECOR_BORDER;
else if (style & WS_BORDER) mwm_hints.decorations |= MWM_DECOR_BORDER;
else if (!(style & (WS_CHILD|WS_POPUP))) mwm_hints.decorations |= MWM_DECOR_BORDER;
XChangeProperty( display, data->whole_window, x11drv_atom(_MOTIF_WM_HINTS),
x11drv_atom(_MOTIF_WM_HINTS), 32, PropModeReplace,
......@@ -650,14 +653,17 @@ void X11DRV_set_iconic_state( HWND hwnd )
void X11DRV_window_to_X_rect( struct x11drv_win_data *data, RECT *rect )
{
RECT rc;
DWORD ex_style;
if (!data->managed) return;
if (IsRectEmpty( rect )) return;
ex_style = GetWindowLongW( data->hwnd, GWL_EXSTYLE );
if (ex_style & WS_EX_TOOLWINDOW) return;
rc.top = rc.bottom = rc.left = rc.right = 0;
AdjustWindowRectEx( &rc, GetWindowLongW( data->hwnd, GWL_STYLE ) & ~(WS_HSCROLL|WS_VSCROLL),
FALSE, GetWindowLongW( data->hwnd, GWL_EXSTYLE ) );
FALSE, ex_style );
rect->left -= rc.left;
rect->right -= rc.right;
......@@ -675,11 +681,15 @@ void X11DRV_window_to_X_rect( struct x11drv_win_data *data, RECT *rect )
*/
void X11DRV_X_to_window_rect( struct x11drv_win_data *data, RECT *rect )
{
DWORD ex_style;
if (!data->managed) return;
if (IsRectEmpty( rect )) return;
ex_style = GetWindowLongW( data->hwnd, GWL_EXSTYLE );
if (ex_style & WS_EX_TOOLWINDOW) return;
AdjustWindowRectEx( rect, GetWindowLongW( data->hwnd, GWL_STYLE ) & ~(WS_HSCROLL|WS_VSCROLL),
FALSE, GetWindowLongW( data->hwnd, GWL_EXSTYLE ));
FALSE, ex_style );
if (rect->top >= rect->bottom) rect->bottom = rect->top + 1;
if (rect->left >= rect->right) rect->right = rect->left + 1;
......
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