Made X11 use _NET_WM_STATE_MAXIMIZED_HORZ and _NET_WM_STATE_MAXIMIZED_VERT when openi...
authorCampbell Barton <ideasman42@gmail.com>
Sun, 15 Apr 2007 05:01:34 +0000 (05:01 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 15 Apr 2007 05:01:34 +0000 (05:01 +0000)
gsr and myself both wrote a patch for this, using gsr's.

import_obj - another error in splitting fixed.

intern/ghost/intern/GHOST_WindowX11.cpp
release/scripts/import_obj.py

index cb356e0796e04dcbbc012571acffc47b8f854a3e..ecba86f9468815fa970a1f0a33311f4f7a73a74e 100755 (executable)
@@ -36,6 +36,7 @@
 
 // For standard X11 cursors
 #include <X11/cursorfont.h>
+#include <X11/Xatom.h>
 
 // For obscure full screen mode stuuf
 // lifted verbatim from blut.
@@ -163,9 +164,28 @@ GHOST_WindowX11(
                        XChangeProperty(m_display, m_window,
                                atom, atom, 32,
                                PropModeReplace, (unsigned char *) &hints, 4);
-               }               
-       }
-
+               }
+       } else if (state == GHOST_kWindowStateMaximized) {
+               // With this, xprop should report the following just after launch
+               // _NET_WM_STATE(ATOM) = _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MAXIMIZED_HORZ
+               // After demaximization the right side is empty, though (maybe not the most correct then?)
+               Atom state, atomh, atomv;
+
+               state = XInternAtom(m_display, "_NET_WM_STATE", False);
+               atomh = XInternAtom(m_display, "_NET_WM_STATE_MAXIMIZED_HORZ", False);
+               atomv = XInternAtom(m_display, "_NET_WM_STATE_MAXIMIZED_VERT", False);
+               if (state == None ) {
+                       GHOST_PRINT("Atom _NET_WM_STATE requested but not avaliable nor created.\n");
+               } else {
+                       XChangeProperty(m_display, m_window,
+                               state, XA_ATOM, 32,
+                               PropModeAppend, (unsigned char *) &atomh, 1);
+                       XChangeProperty(m_display, m_window,
+                               state, XA_ATOM, 32,
+                               PropModeAppend, (unsigned char *) &atomv, 1);
+               }
+       }
+       
        // Create some hints for the window manager on how
        // we want this window treated. 
 
index 92c795235d12ac19025c9a25608c0a98bcdc543f..04b8bd425929ba1dd58c8d9428bce3d1edfcef62 100644 (file)
@@ -265,7 +265,7 @@ def split_mesh(verts_loc, faces, unique_materials, filepath, SPLIT_OB_OR_GROUP,
                def face_key(face):
                        return face[4] # object
        
-       if not SPLIT_OB_OR_GROUP and SPLIT_MATERIALS:
+       elif not SPLIT_OB_OR_GROUP and SPLIT_MATERIALS:
                def face_key(face):
                        return face[2] # material
        
@@ -293,7 +293,7 @@ def split_mesh(verts_loc, faces, unique_materials, filepath, SPLIT_OB_OR_GROUP,
                                vert_remap= [-1]*len(verts_loc)
                                
                                face_split_dict[key]= (verts_split, faces_split, unique_materials_split, vert_remap)
-                       print key
+                       
                        oldkey= key
                        
                face_vert_loc_indicies= face[0]