]> Dogcows Code - chaz/openbox/commitdiff
add support for the kde-override hint, making the windows get no decorations.
authorDana Jansens <danakj@orodu.net>
Wed, 21 Aug 2002 06:09:31 +0000 (06:09 +0000)
committerDana Jansens <danakj@orodu.net>
Wed, 21 Aug 2002 06:09:31 +0000 (06:09 +0000)
also, read the window type as an array, as it is supposed to be read.

src/Window.cc
src/XAtom.cc
src/XAtom.hh

index d71f4508b888ce4a7333a4d35c8b6a90f798659c..7271ad0888800f7e9d5085851a1d190ad655bcba 100644 (file)
@@ -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;
 }
 
 
index b2a7c4efae9369820c81526c974b4e79c1da6468..abd68f183c4224dbdc5670d0ae2db62ee32a9a69 100644 (file)
@@ -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");
 }
 
 
index 8c790bf654df54cb348d691de8e36aa90c9a1f5d..f2dae637f798f5d60671f4ecb38b3c99941419ea 100644 (file)
@@ -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
This page took 0.028108 seconds and 4 git commands to generate.