From: Peter Åstrand Date: Mon, 18 Jul 2011 07:45:14 +0000 (+0000) Subject: Make fullscreen mode work better with some X11 WMs such as Fedora 14 X-Git-Tag: v1.1.90~199 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=17067b16ee38125b0a0a97baf758f9166c96e13a;p=tigervnc.git Make fullscreen mode work better with some X11 WMs such as Fedora 14 Metacity by removing the size limits before attempting fullscreen. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4599 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx index b4b2ae9d..91019516 100644 --- a/vncviewer/DesktopWindow.cxx +++ b/vncviewer/DesktopWindow.cxx @@ -72,8 +72,11 @@ DesktopWindow::DesktopWindow(int w, int h, const char *name, Fl::event_dispatch(&fltkHandle); #ifdef HAVE_FLTK_FULLSCREEN - if (fullScreen) + if (fullScreen) { + // See comment in DesktopWindow::handleOptions + size_range(100, 100, 0, 0); fullscreen(); + } #endif show(); @@ -200,8 +203,19 @@ int DesktopWindow::handle(int event) switch (event) { #ifdef HAVE_FLTK_FULLSCREEN case FL_FULLSCREEN: - if (event == FL_FULLSCREEN) + if (event == FL_FULLSCREEN) { fullScreen.setParam(fullscreen_active()); + if (!fullscreen_active()) { + size_range(100, 100, 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) break; @@ -400,9 +414,12 @@ void DesktopWindow::handleOptions(void *data) else self->ungrabKeyboard(); - if (fullScreen && !self->fullscreen_active()) + if (fullScreen && !self->fullscreen_active()) { + // Some WMs (Metacity) apparently requires that the size limits + // are removed before fullscreen + self->size_range(100, 100, 0, 0); self->fullscreen(); - else if (!fullScreen && self->fullscreen_active()) + } else if (!fullScreen && self->fullscreen_active()) self->fullscreen_off(); #endif } diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx index 08ca2728..0936a632 100644 --- a/vncviewer/Viewport.cxx +++ b/vncviewer/Viewport.cxx @@ -884,8 +884,11 @@ void Viewport::popupContextMenu() case ID_FULLSCREEN: if (window()->fullscreen_active()) window()->fullscreen_off(); - else + else { + // See comment in DesktopWindow::handleOptions + window()->size_range(100, 100, 0, 0); window()->fullscreen(); + } break; #endif case ID_CTRL: