Browse Source

Using maximize and full screen at the same time on OS X would misbehave

as we would first create a full screen window, then resize it to a
maximized site. Reorganise things a bit so that we get sensible
behaviour.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5001 3789f03b-4d11-0410-bbf8-ca57d06f2519
tags/v1.2.90
Pierre Ossman 11 years ago
parent
commit
002cc5d129
1 changed files with 21 additions and 4 deletions
  1. 21
    4
      vncviewer/DesktopWindow.cxx

+ 21
- 4
vncviewer/DesktopWindow.cxx View File

@@ -106,6 +106,15 @@ DesktopWindow::DesktopWindow(int w, int h, const char *name,
}
}

#ifdef __APPLE__
// On OS X we can do the maximize thing properly before the
// window is showned. Other platforms handled further down...
if (maximize) {
int dummy;
Fl::screen_work_area(dummy, dummy, w, h, geom_x, geom_y);
}
#endif

if (force_position()) {
resize(geom_x, geom_y, w, h);
} else {
@@ -128,11 +137,13 @@ DesktopWindow::DesktopWindow(int w, int h, const char *name,
show();

// Unfortunately, current FLTK does not allow us to set the
// maximized property before showing the window. See STR #2083 and
// STR #2178
// maximized property on Windows and X11 before showing the window.
// See STR #2083 and STR #2178
#ifndef __APPLE__
if (maximize) {
maximizeWindow();
}
#endif

// The window manager might give us an initial window size that is different
// than the one we requested, and in those cases we need to manually adjust
@@ -567,8 +578,14 @@ void DesktopWindow::maximizeWindow()
wp.showCmd = SW_MAXIMIZE;
SetWindowPlacement(fl_xid(this), &wp);
#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 */
// 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.
// Note that we shouldn't do this whilst in full screen as that will
// incorrectly adjust things.
#ifdef HAVE_FLTK_FULLSCREEN
if (fullscreen_active())
return;
#endif
int X, Y, W, H;
Fl::screen_work_area(X, Y, W, H, this->x(), this->y());
size(W, H);

Loading…
Cancel
Save