Page MenuHome

ghost_fullscreen_fix.patch

Authored By
Elia Sarti (vekoon)
Nov 13 2013, 2:36 PM
Size
3 KB
Subscribers
None

ghost_fullscreen_fix.patch

Index: intern/ghost/intern/GHOST_WindowWin32.cpp
===================================================================
--- intern/ghost/intern/GHOST_WindowWin32.cpp (revision 27825)
+++ intern/ghost/intern/GHOST_WindowWin32.cpp (working copy)
@@ -138,6 +138,7 @@
m_top(top),
m_width(width),
m_height(height),
+ m_normal_state(GHOST_kWindowStateNormal),
m_stereo(stereoVisual),
m_nextWindow(NULL)
{
@@ -481,9 +482,14 @@
GHOST_TSuccess GHOST_WindowWin32::setState(GHOST_TWindowState state)
{
+ GHOST_TWindowState cur_state = getState();
WINDOWPLACEMENT wp;
wp.length = sizeof(WINDOWPLACEMENT);
::GetWindowPlacement(m_hWnd, &wp);
+
+ if (state == GHOST_kWindowStateNormal)
+ state = m_normal_state;
+
switch (state) {
case GHOST_kWindowStateMinimized:
wp.showCmd = SW_SHOWMINIMIZED;
@@ -494,6 +500,8 @@
SetWindowLongPtr(m_hWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW);
break;
case GHOST_kWindowStateFullScreen:
+ if (cur_state != state && cur_state != GHOST_kWindowStateMinimized)
+ m_normal_state = cur_state;
wp.showCmd = SW_SHOWMAXIMIZED;
wp.ptMaxPosition.x = 0;
wp.ptMaxPosition.y = 0;
@@ -506,6 +514,7 @@
SetWindowLongPtr(m_hWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW);
break;
}
+
return ::SetWindowPlacement(m_hWnd, &wp) == TRUE ? GHOST_kSuccess : GHOST_kFailure;
}
Index: intern/ghost/intern/GHOST_WindowWin32.h
===================================================================
--- intern/ghost/intern/GHOST_WindowWin32.h (revision 27825)
+++ intern/ghost/intern/GHOST_WindowWin32.h (working copy)
@@ -351,6 +351,7 @@
GHOST_TInt32 m_top;
GHOST_TUns32 m_width;
GHOST_TUns32 m_height;
+ GHOST_TWindowState m_normal_state;
bool m_stereo;
/** The GHOST_System passes this to wm if this window is being replaced */
Index: intern/ghost/intern/GHOST_WindowX11.cpp
===================================================================
--- intern/ghost/intern/GHOST_WindowX11.cpp (revision 27825)
+++ intern/ghost/intern/GHOST_WindowX11.cpp (working copy)
@@ -159,6 +159,7 @@
GHOST_Window(title,left,top,width,height,state,type,stereoVisual,numOfAASamples),
m_context(NULL),
m_display(display),
+ m_normal_state(GHOST_kWindowStateNormal),
m_system (system),
m_valid_setup (false),
m_invalid_window(false),
@@ -1036,6 +1037,9 @@
is_motif_full = motifIsFullScreen();
+ if (state == GHOST_kWindowStateNormal)
+ state = m_normal_state;
+
if (state == GHOST_kWindowStateNormal) {
if (is_max == True)
netwmMaximized(False);
@@ -1055,6 +1059,8 @@
if (cur_state == GHOST_kWindowStateMinimized)
return (GHOST_kFailure);
+ m_normal_state = cur_state;
+
if (is_max == True)
netwmMaximized(False);
if (is_full == False)
Index: intern/ghost/intern/GHOST_WindowX11.h
===================================================================
--- intern/ghost/intern/GHOST_WindowX11.h (revision 27825)
+++ intern/ghost/intern/GHOST_WindowX11.h (working copy)
@@ -327,6 +327,7 @@
Window m_window;
Display *m_display;
XVisualInfo *m_visual;
+ GHOST_TWindowState m_normal_state;
/** The first created OpenGL context (for sharing display lists) */
static GLXContext s_firstContext;

File Metadata

Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
9d/d0/ced64046708f6d1e55d97f2d7665

Event Timeline