From: Dana Jansens Date: Wed, 21 Aug 2002 06:09:31 +0000 (+0000) Subject: add support for the kde-override hint, making the windows get no decorations. X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=aa9ade7a902a3482fd68d05393fe53dac47a4df5;p=chaz%2Fopenbox add support for the kde-override hint, making the windows get no decorations. also, read the window type as an array, as it is supposed to be read. --- diff --git a/src/Window.cc b/src/Window.cc index d71f4508..7271ad08 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -1005,39 +1005,50 @@ void BlackboxWindow::updateStrut(void) { bool BlackboxWindow::getWindowType(void) { - unsigned long val; + window_type = (WindowType) -1; + + unsigned long *val; + unsigned long num = (unsigned) -1; if (xatom->getValue(client.window, XAtom::net_wm_window_type, XAtom::atom, - val)) { - if (val == xatom->getAtom(XAtom::net_wm_window_type_desktop)) - window_type = Type_Desktop; - else if (val == xatom->getAtom(XAtom::net_wm_window_type_dock)) - window_type = Type_Dock; - else if (val == xatom->getAtom(XAtom::net_wm_window_type_toolbar)) - window_type = Type_Toolbar; - else if (val == xatom->getAtom(XAtom::net_wm_window_type_menu)) - window_type = Type_Menu; - else if (val == xatom->getAtom(XAtom::net_wm_window_type_utility)) - window_type = Type_Utility; - else if (val == xatom->getAtom(XAtom::net_wm_window_type_splash)) - window_type = Type_Splash; - else if (val == xatom->getAtom(XAtom::net_wm_window_type_dialog)) + num, &val)) { + for (unsigned long i = 0; i < num; ++i) { + if (val[i] == xatom->getAtom(XAtom::net_wm_window_type_desktop)) + window_type = Type_Desktop; + else if (val[i] == xatom->getAtom(XAtom::net_wm_window_type_dock)) + window_type = Type_Dock; + else if (val[i] == xatom->getAtom(XAtom::net_wm_window_type_toolbar)) + window_type = Type_Toolbar; + else if (val[i] == xatom->getAtom(XAtom::net_wm_window_type_menu)) + window_type = Type_Menu; + else if (val[i] == xatom->getAtom(XAtom::net_wm_window_type_utility)) + window_type = Type_Utility; + else if (val[i] == xatom->getAtom(XAtom::net_wm_window_type_splash)) + window_type = Type_Splash; + else if (val[i] == xatom->getAtom(XAtom::net_wm_window_type_dialog)) + window_type = Type_Dialog; + else if (val[i] == xatom->getAtom(XAtom::net_wm_window_type_normal)) + window_type = Type_Normal; + else if (val[i] == + xatom->getAtom(XAtom::kde_net_wm_window_type_override)) + mwm_decorations = 0; // prevent this window from getting any decor + } + delete val; + } + + if (window_type == (WindowType) -1) { + /* + * the window type hint was not set, which means we either classify ourself + * as a normal window or a dialog, depending on if we are a transient. + */ + if (isTransient()) window_type = Type_Dialog; - else //if (val[0] == xatom->getAtom(XAtom::net_wm_window_type_normal)) + else window_type = Type_Normal; - return True; + return False; } - /* - * the window type hint was not set, which means we either classify ourself - * as a normal window or a dialog, depending on if we are a transient. - */ - if (isTransient()) - window_type = Type_Dialog; - - window_type = Type_Normal; - - return False; + return True; } diff --git a/src/XAtom.cc b/src/XAtom.cc index b2a7c4ef..abd68f18 100644 --- a/src/XAtom.cc +++ b/src/XAtom.cc @@ -151,6 +151,8 @@ XAtom::XAtom(Display *d) { _atoms[kde_net_system_tray_windows] = create("_KDE_NET_SYSTEM_TRAY_WINDOWS"); _atoms[kde_net_wm_system_tray_window_for] = create("_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR"); + _atoms[kde_net_wm_window_type_override] = + create("_KDE_NET_WM_WINDOW_TYPE_OVERRIDE"); } diff --git a/src/XAtom.hh b/src/XAtom.hh index 8c790bf6..f2dae637 100644 --- a/src/XAtom.hh +++ b/src/XAtom.hh @@ -147,6 +147,7 @@ public: kde_net_system_tray_windows, kde_net_wm_system_tray_window_for, + kde_net_wm_window_type_override, // constant for how many atoms exist in the enumerator NUM_ATOMS