Tolerate all standard _NET_WM_WINDOW_TYPE types for managed windows

Although the spec designates some window types as typically used for
override redirect windows, it does not prohibit the use of these with
managed windows, so we should not abort if we encounter one of these.

http://bugzilla.gnome.org/show_bug.cgi?id=583870
This commit is contained in:
Tomas Frydrych 2009-07-31 19:11:54 +01:00
parent 239b39cf52
commit a576f7a1ea

View File

@ -6413,24 +6413,7 @@ recalc_window_type (MetaWindow *window)
old_type = window->type; old_type = window->type;
if (window->override_redirect) if (window->type_atom != None)
{
if (window->type_atom == window->display->atom__NET_WM_WINDOW_TYPE_DROPDOWN_MENU)
window->type = META_WINDOW_DROPDOWN_MENU;
else if (window->type_atom == window->display->atom__NET_WM_WINDOW_TYPE_POPUP_MENU)
window->type = META_WINDOW_POPUP_MENU;
else if (window->type_atom == window->display->atom__NET_WM_WINDOW_TYPE_TOOLTIP)
window->type = META_WINDOW_TOOLTIP;
else if (window->type_atom == window->display->atom__NET_WM_WINDOW_TYPE_NOTIFICATION)
window->type = META_WINDOW_NOTIFICATION;
else if (window->type_atom == window->display->atom__NET_WM_WINDOW_TYPE_COMBO)
window->type = META_WINDOW_COMBO;
else if (window->type_atom == window->display->atom__NET_WM_WINDOW_TYPE_DND)
window->type = META_WINDOW_DND;
else
window->type = META_WINDOW_OVERRIDE_OTHER;
}
else if (window->type_atom != None)
{ {
if (window->type_atom == window->display->atom__NET_WM_WINDOW_TYPE_DESKTOP) if (window->type_atom == window->display->atom__NET_WM_WINDOW_TYPE_DESKTOP)
window->type = META_WINDOW_DESKTOP; window->type = META_WINDOW_DESKTOP;
@ -6448,9 +6431,44 @@ recalc_window_type (MetaWindow *window)
window->type = META_WINDOW_DIALOG; window->type = META_WINDOW_DIALOG;
else if (window->type_atom == window->display->atom__NET_WM_WINDOW_TYPE_NORMAL) else if (window->type_atom == window->display->atom__NET_WM_WINDOW_TYPE_NORMAL)
window->type = META_WINDOW_NORMAL; window->type = META_WINDOW_NORMAL;
/* The below are *typically* override-redirect windows, but the spec does
* not disallow using them for managed windows.
*/
else if (window->type_atom == window->display->atom__NET_WM_WINDOW_TYPE_DROPDOWN_MENU)
window->type = META_WINDOW_DROPDOWN_MENU;
else if (window->type_atom == window->display->atom__NET_WM_WINDOW_TYPE_POPUP_MENU)
window->type = META_WINDOW_POPUP_MENU;
else if (window->type_atom == window->display->atom__NET_WM_WINDOW_TYPE_TOOLTIP)
window->type = META_WINDOW_TOOLTIP;
else if (window->type_atom == window->display->atom__NET_WM_WINDOW_TYPE_NOTIFICATION)
window->type = META_WINDOW_NOTIFICATION;
else if (window->type_atom == window->display->atom__NET_WM_WINDOW_TYPE_COMBO)
window->type = META_WINDOW_COMBO;
else if (window->type_atom == window->display->atom__NET_WM_WINDOW_TYPE_DND)
window->type = META_WINDOW_DND;
else if (window->override_redirect)
window->type = META_WINDOW_OVERRIDE_OTHER;
else else
meta_bug ("Set a type atom for %s that wasn't handled in recalc_window_type\n", {
window->desc); char *atom_name;
/*
* Fallback on a normal type, and print warning. Don't abort.
*/
window->type = META_WINDOW_NORMAL;
meta_error_trap_push (window->display);
atom_name = XGetAtomName (window->display->xdisplay,
window->type_atom);
meta_error_trap_pop (window->display, TRUE);
meta_warning ("Unrecognized type atom [%s] set for %s \n",
atom_name ? atom_name : "unknown",
window->desc);
if (atom_name)
XFree (atom_name);
}
} }
else if (window->xtransient_for != None) else if (window->xtransient_for != None)
{ {