From 29e4a1652eb635cc27b0d0f2fbcc75a116e995ee Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Mon, 21 Nov 2011 14:03:31 +0000 Subject: [PATCH] Reindent some code that had grown a bit unstructured. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4812 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- vncviewer/DesktopWindow.cxx | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx index 41abf6be..d2975dc0 100644 --- a/vncviewer/DesktopWindow.cxx +++ b/vncviewer/DesktopWindow.cxx @@ -167,13 +167,15 @@ void DesktopWindow::resizeFramebuffer(int new_w, int new_h) #ifdef HAVE_FLTK_FULLSCREEN if (!fullscreen_active()) { #endif - if ((w() == viewport->w()) && (h() == viewport->h())) - size(new_w, new_h); - else { - // Make sure the window isn't too big + if ((w() == viewport->w()) && (h() == viewport->h())) + size(new_w, new_h); + else { + // Make sure the window isn't too big. We do this manually because + // we have to disable the window size restriction (and it isn't + // entirely trustworthy to begin with). if ((w() > new_w) || (h() > new_h)) size(__rfbmin(w(), new_w), __rfbmin(h(), new_h)); - } + } #ifdef HAVE_FLTK_FULLSCREEN } #endif @@ -218,19 +220,18 @@ int DesktopWindow::handle(int event) switch (event) { #ifdef HAVE_FLTK_FULLSCREEN case FL_FULLSCREEN: - if (event == FL_FULLSCREEN) { - fullScreen.setParam(fullscreen_active()); - if (!fullscreen_active()) { - size_range(100, 100, viewport->w(), viewport->h()); - size(viewport->w(), viewport->h()); - } else { - // We need to turn off the size limitations for proper - // fullscreen support, but in case fullscreen is activated via - // the WM, this is a bit of a problem. In practice, it seems to - // work to change the size limits after we have recieved the - // FL_FULLSCREEN event, at least with my Metacity. - size_range(100, 100, 0, 0); - } + fullScreen.setParam(fullscreen_active()); + + if (!fullscreen_active()) { + size_range(100, 100, viewport->w(), viewport->h()); + size(viewport->w(), viewport->h()); + } else { + // We need to turn off the size limitations for proper + // fullscreen support, but in case fullscreen is activated via + // the WM, this is a bit of a problem. In practice, it seems to + // work to change the size limits after we have recieved the + // FL_FULLSCREEN event, at least with my Metacity. + size_range(100, 100, 0, 0); } if (!fullscreenSystemKeys) -- 2.39.5