summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2012-10-11 09:17:19 +0000
committerPierre Ossman <ossman@cendio.se>2012-10-11 09:17:19 +0000
commit897067bd8409821e10ac2a1a57648fbc19432347 (patch)
tree8d4ec2dd3a2236cc00e6747c101d08b1cbc1255c
parent9e0e7543072fc579f7a1a0cd075487e88712a500 (diff)
downloadtigervnc-897067bd8409821e10ac2a1a57648fbc19432347.tar.gz
tigervnc-897067bd8409821e10ac2a1a57648fbc19432347.zip
We need to be more careful about activating maximized mode when in
full screen, otherwise we'll mess things up. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5003 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r--vncviewer/DesktopWindow.cxx17
1 files changed, 12 insertions, 5 deletions
diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx
index fad5ad3e..486daf1d 100644
--- a/vncviewer/DesktopWindow.cxx
+++ b/vncviewer/DesktopWindow.cxx
@@ -581,11 +581,18 @@ void DesktopWindow::handleGrab(void *data)
void DesktopWindow::maximizeWindow()
{
#if defined(WIN32)
- WINDOWPLACEMENT wp;
- wp.length = sizeof(WINDOWPLACEMENT);
- GetWindowPlacement(fl_xid(this), &wp);
- wp.showCmd = SW_MAXIMIZE;
- SetWindowPlacement(fl_xid(this), &wp);
+ // We cannot use ShowWindow() in full screen mode as it will
+ // resize things implicitly. Fortunately modifying the style
+ // directly results in a maximized state once we leave full screen.
+#ifdef HAVE_FLTK_FULLSCREEN
+ if (fullscreen_active()) {
+ WINDOWINFO wi;
+ wi.cbSize = sizeof(WINDOWINFO);
+ GetWindowInfo(fl_xid(this), &wi);
+ SetWindowLongPtr(fl_xid(this), GWL_STYLE, wi.dwStyle | WS_MAXIMIZE);
+ } else
+#endif
+ ShowWindow(fl_xid(this), SW_MAXIMIZE);
#elif defined(__APPLE__)
// OS X is somewhat strange and does not really have a concept of a
// maximized window, so we can simply resize the window to the workarea.