diff --git a/rviz_common/include/rviz_common/visualization_frame.hpp b/rviz_common/include/rviz_common/visualization_frame.hpp index 215c52917..935d0ccb5 100644 --- a/rviz_common/include/rviz_common/visualization_frame.hpp +++ b/rviz_common/include/rviz_common/visualization_frame.hpp @@ -238,6 +238,14 @@ public Q_SLOTS: void setStatus(const QString & message) override; + /// Set full screen mode. + void + setFullScreen(bool full_screen); + + /// Exit full screen mode. + void + exitFullScreen(); + Q_SIGNALS: /// Emitted during file-loading and initialization to indicate progress. void @@ -332,14 +340,6 @@ protected Q_SLOTS: void onDeletePanel(); - /// Set full screen mode. - void - setFullScreen(bool full_screen); - - /// Exit full screen mode. - void - exitFullScreen(); - /// Indicate that loading is done. void markLoadingDone(); diff --git a/rviz_common/src/rviz_common/visualizer_app.cpp b/rviz_common/src/rviz_common/visualizer_app.cpp index d2e68258c..e6233d9e7 100644 --- a/rviz_common/src/rviz_common/visualizer_app.cpp +++ b/rviz_common/src/rviz_common/visualizer_app.cpp @@ -112,12 +112,18 @@ bool VisualizerApp::init(int argc, char ** argv) "A custom splash-screen image to display", "splash_path"); parser.addOption(splash_screen_option); + QCommandLineOption fullscreen_option( + "fullscreen", + "Start RViz in fullscreen mode."); + parser.addOption(fullscreen_option); + QString display_config, fixed_frame, splash_path, help_path, display_title_format; - bool enable_ogre_log; + bool enable_ogre_log, fullscreen; if (app_) {parser.process(*app_);} enable_ogre_log = parser.isSet(ogre_log_option); + fullscreen = parser.isSet(fullscreen_option); if (parser.isSet(display_config_option)) { display_config = parser.value(display_config_option); @@ -162,6 +168,10 @@ bool VisualizerApp::init(int argc, char ** argv) frame_->getManager()->setFixedFrame(fixed_frame); } + if (fullscreen) { + frame_->setFullScreen(true); + } + frame_->show(); return true;