Map (WS_EX_TOOLWINDOW & WS_CAPTION) to _NET_WM_WINDOW_TYPE_UTILITY.

This commit is contained in:
Mike Hearn 2003-12-04 21:54:13 +00:00 committed by Alexandre Julliard
parent c69a522e3e
commit 27d972f22a
2 changed files with 16 additions and 3 deletions

View File

@ -81,6 +81,8 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] =
"_NET_WM_PID", "_NET_WM_PID",
"_NET_WM_PING", "_NET_WM_PING",
"_NET_WM_NAME", "_NET_WM_NAME",
"_NET_WM_WINDOW_TYPE",
"_NET_WM_WINDOW_TYPE_UTILITY",
"XdndAware", "XdndAware",
"XdndEnter", "XdndEnter",
"XdndPosition", "XdndPosition",
@ -119,10 +121,11 @@ inline static BOOL is_window_managed( WND *win )
if (win->dwExStyle & WS_EX_TRAYWINDOW) return TRUE; if (win->dwExStyle & WS_EX_TRAYWINDOW) return TRUE;
/* child windows are not managed */ /* child windows are not managed */
if (win->dwStyle & WS_CHILD) return FALSE; if (win->dwStyle & WS_CHILD) return FALSE;
/* tool windows are not managed */ /* windows with caption are managed */
if (win->dwExStyle & WS_EX_TOOLWINDOW) return FALSE;
/* windows with caption or thick frame are managed */
if ((win->dwStyle & WS_CAPTION) == WS_CAPTION) return TRUE; if ((win->dwStyle & WS_CAPTION) == WS_CAPTION) return TRUE;
/* tool windows are not managed */
if (win->dwExStyle & WS_EX_TOOLWINDOW) return FALSE;
/* windows with thick frame are managed */
if (win->dwStyle & WS_THICKFRAME) return TRUE; if (win->dwStyle & WS_THICKFRAME) return TRUE;
/* default: not managed */ /* default: not managed */
return FALSE; return FALSE;
@ -424,6 +427,14 @@ void X11DRV_set_wm_hints( Display *display, WND *win )
XChangeProperty(display, data->whole_window, x11drv_atom(_NET_WM_PID), XChangeProperty(display, data->whole_window, x11drv_atom(_NET_WM_PID),
XA_CARDINAL, 32, PropModeReplace, (char *)&i, 1); XA_CARDINAL, 32, PropModeReplace, (char *)&i, 1);
/* map WS_EX_TOOLWINDOW to _NET_WM_WINDOW_TYPE_UTILITY */
if (win->dwExStyle & WS_EX_TOOLWINDOW)
{
Atom a = x11drv_atom(_NET_WM_WINDOW_TYPE_UTILITY);
XChangeProperty(display, data->whole_window, x11drv_atom(_NET_WM_WINDOW_TYPE),
XA_ATOM, 32, PropModeReplace, (char*)&a, 1);
}
mwm_hints.flags = MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS; mwm_hints.flags = MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS;
mwm_hints.functions = 0; mwm_hints.functions = 0;
if ((win->dwStyle & WS_CAPTION) == WS_CAPTION) mwm_hints.functions |= MWM_FUNC_MOVE; if ((win->dwStyle & WS_CAPTION) == WS_CAPTION) mwm_hints.functions |= MWM_FUNC_MOVE;

View File

@ -395,6 +395,8 @@ enum x11drv_atoms
XATOM__NET_WM_PID, XATOM__NET_WM_PID,
XATOM__NET_WM_PING, XATOM__NET_WM_PING,
XATOM__NET_WM_NAME, XATOM__NET_WM_NAME,
XATOM__NET_WM_WINDOW_TYPE,
XATOM__NET_WM_WINDOW_TYPE_UTILITY,
XATOM_XdndAware, XATOM_XdndAware,
XATOM_XdndEnter, XATOM_XdndEnter,
XATOM_XdndPosition, XATOM_XdndPosition,