]> source.dussan.org Git - tigervnc.git/commitdiff
We need to be more careful about activating maximized mode when in
authorPierre Ossman <ossman@cendio.se>
Thu, 11 Oct 2012 09:17:19 +0000 (09:17 +0000)
committerPierre Ossman <ossman@cendio.se>
Thu, 11 Oct 2012 09:17:19 +0000 (09:17 +0000)
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

vncviewer/DesktopWindow.cxx

index fad5ad3e61035fb4182e219281cff41d017810ff..486daf1deda75981184fb39c202ced0ac547783e 100644 (file)
@@ -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.