[Bf-committers] X11 Fullscreen Above-Panels patch.

Daniel Fairhead bf-committers@blender.org
Tue, 20 Jan 2004 01:09:57 +0200


This is a multi-part message in MIME format.

--Multipart=_Tue__20_Jan_2004_01_09_57_+0200_FYlU+s3K22YAD/+g
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Hi all,
I've been testing out a new enviroment recently (openbox+fspanel+rox), and
come across a problem whereby blender in fullscreen mode (run without -w) opens
fullscreen, but the panel remains on top of it, obscuring the bottom part of the
window. Here is a small patch to GHOST_WindowX11.cpp which solves it. It isn't
a perfect patch, as it may well be doing some of the same work as elsewhere, 
however the whole of GHOST_WindowX11.cpp is messy, with bits of code copied
from all over the place. I may have a look at it later.

(If you are on an X11 box, and noticed this problem, please test)

Comments?

cheers,

Dan

--Multipart=_Tue__20_Jan_2004_01_09_57_+0200_FYlU+s3K22YAD/+g
Content-Type: text/x-diff;
 name="above-panels.patch"
Content-Disposition: attachment;
 filename="above-panels.patch"
Content-Transfer-Encoding: 7bit

Index: GHOST_WindowX11.cpp
===================================================================
RCS file: /cvsroot/bf-blender/blender/intern/ghost/intern/GHOST_WindowX11.cpp,v
retrieving revision 1.9
diff -u -B -r1.9 GHOST_WindowX11.cpp
--- GHOST_WindowX11.cpp	26 Dec 2003 20:12:40 -0000	1.9
+++ GHOST_WindowX11.cpp	19 Jan 2004 23:07:15 -0000
@@ -41,8 +41,12 @@
 // For standard X11 cursors
 #include <X11/cursorfont.h>
 
-// For obscure full screen mode stuuf
-// lifted verbatim from blut.
+// For XAtom stuff (duh)
+
+#include <X11/Xatom.h>
+
+// For obscure full screen mode stuff
+// lifted verbatim from blut. 
 
 typedef struct {
   long flags;
@@ -153,6 +157,7 @@
 
 		MotifWmHints hints;
 		Atom atom;
+		/*Atom btom;*/
 					
 		atom = XInternAtom(m_display, "_MOTIF_WM_HINTS", False);
 		
@@ -167,7 +172,47 @@
 			XChangeProperty(m_display, m_window,
 				atom, atom, 32,
 				PropModeReplace, (unsigned char *) &hints, 4);
-		}		
+		}
+		
+		// Code here copied from oxine (GPL):
+
+		// layer above most other things, like gnome panel
+		// WIN_LAYER_ABOVE_DOCK  = 10
+		
+		{
+			static Atom           XA_WIN_LAYER = None;
+			long                  propvalue[1];
+			
+			if (XA_WIN_LAYER == None)
+				XA_WIN_LAYER = XInternAtom(m_display, "_WIN_LAYER", False);
+				
+			propvalue[0] = 10;
+			XChangeProperty(m_display, m_window, XA_WIN_LAYER,
+			XA_CARDINAL, 32, PropModeReplace, 
+			(unsigned char *)propvalue, 1);
+		}
+
+		// fullscreen the modern (e.g. metacity) way
+	    
+	    {
+    		static Atom           XA_WIN_STATE = None;
+			long                  propvalue[2];
+			if (XA_WIN_STATE == None)
+				XA_WIN_STATE = XInternAtom (m_display, "_NET_WM_STATE", False);
+			propvalue[0] = XInternAtom (m_display, "_NET_WM_STATE_FULLSCREEN", 
+			False);
+			propvalue[1] = 0;
+			XChangeProperty (m_display, m_window, 
+				XA_WIN_STATE, XA_ATOM, 
+				32, PropModeReplace, 
+				(unsigned char *)propvalue, 1);
+			XFlush(m_display);
+
+	    }
+
+		// End of code from oxine
+
+		
 	}
 
 	// Create some hints for the window manager on how

--Multipart=_Tue__20_Jan_2004_01_09_57_+0200_FYlU+s3K22YAD/+g--