[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54221] trunk/blender/intern/ghost/intern/ GHOST_WindowX11.cpp: initializing maximized/ fullscreen windows in x11 would start normal, then maximize - causing noticeable flicker.

Campbell Barton ideasman42 at gmail.com
Thu Jan 31 06:56:05 CET 2013


Revision: 54221
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54221
Author:   campbellbarton
Date:     2013-01-31 05:55:57 +0000 (Thu, 31 Jan 2013)
Log Message:
-----------
initializing maximized/fullscreen windows in x11 would start normal, then maximize - causing noticeable flicker.

Modified Paths:
--------------
    trunk/blender/intern/ghost/intern/GHOST_WindowX11.cpp

Modified: trunk/blender/intern/ghost/intern/GHOST_WindowX11.cpp
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_WindowX11.cpp	2013-01-31 05:37:52 UTC (rev 54220)
+++ trunk/blender/intern/ghost/intern/GHOST_WindowX11.cpp	2013-01-31 05:55:57 UTC (rev 54221)
@@ -328,6 +328,26 @@
 	GHOST_PRINT("Set drop target\n");
 #endif
 
+	if (state == GHOST_kWindowStateMaximized || state == GHOST_kWindowStateFullScreen) {
+		Atom _NET_WM_STATE = XInternAtom(m_display, "_NET_WM_STATE", False);
+		Atom _NET_WM_STATE_MAXIMIZED_VERT = XInternAtom(m_display, "_NET_WM_STATE_MAXIMIZED_VERT", False);
+		Atom _NET_WM_STATE_MAXIMIZED_HORZ = XInternAtom(m_display, "_NET_WM_STATE_MAXIMIZED_HORZ", False);
+		Atom _NET_WM_STATE_FULLSCREEN     = XInternAtom(m_display, "_NET_WM_STATE_FULLSCREEN", False);
+		Atom atoms[2];
+		int count = 0;
+
+		if (state == GHOST_kWindowStateMaximized) {
+			atoms[count++] = _NET_WM_STATE_MAXIMIZED_VERT;
+			atoms[count++] = _NET_WM_STATE_MAXIMIZED_HORZ;
+		}
+		else {
+			atoms[count++] = _NET_WM_STATE_FULLSCREEN;
+		}
+
+		XChangeProperty(m_display, m_window, _NET_WM_STATE, XA_ATOM, 32,
+		                PropModeReplace, (unsigned char *)atoms, count);
+		m_post_init = False;
+	}
 	/*
 	 * One of the problem with WM-spec is that can't set a property
 	 * to a window that isn't mapped. That is why we can't "just
@@ -339,7 +359,7 @@
 	 * So, m_post_init indicate that we need wait for the MapNotify
 	 * event and then set the Window state to the m_post_state.
 	 */
-	if ((state != GHOST_kWindowStateNormal) && (state != GHOST_kWindowStateMinimized)) {
+	else if ((state != GHOST_kWindowStateNormal) && (state != GHOST_kWindowStateMinimized)) {
 		m_post_init = True;
 		m_post_state = state;
 	}




More information about the Bf-blender-cvs mailing list