Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-01-31 09:55:57 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-01-31 09:55:57 +0400
commitc2ee59b7771898677e348308d62fb27cbce28589 (patch)
tree9c429459927aa98502d359e2ab59d0767d5d745e /intern
parent29456505f3749dd00fc53351faef0306836361f3 (diff)
initializing maximized/fullscreen windows in x11 would start normal, then maximize - causing noticeable flicker.
Diffstat (limited to 'intern')
-rw-r--r--intern/ghost/intern/GHOST_WindowX11.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp
index f53b5d9dd77..934dec8e047 100644
--- a/intern/ghost/intern/GHOST_WindowX11.cpp
+++ b/intern/ghost/intern/GHOST_WindowX11.cpp
@@ -328,6 +328,26 @@ GHOST_WindowX11(
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 @@ GHOST_WindowX11(
* 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;
}