summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Window.cc65
-rw-r--r--src/XAtom.cc2
-rw-r--r--src/XAtom.hh1
3 files changed, 41 insertions, 27 deletions
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