]> git.tdb.fi Git - libs/gui.git/blobdiff - source/graphics/window.cpp
Set window title to application name by default
[libs/gui.git] / source / graphics / window.cpp
index 00acbc459446a6d410d12d876f4bb7662f4265f0..ebdc578e14d44524f982c74e29beb2503a7c0c99 100644 (file)
@@ -1,3 +1,4 @@
+#include <msp/core/application.h>
 #include "display.h"
 #include "window.h"
 #include "window_private.h"
@@ -43,6 +44,10 @@ void Window::init()
 
        display.add_window(*this);
        display.check_error();
+
+       const string &app_name = Application::get_name();
+       if(!app_name.empty())
+               set_title(app_name);
 }
 
 Window::~Window()
@@ -51,7 +56,7 @@ Window::~Window()
 
        display.remove_window(*this);
 
-       if(options.fullscreen)
+       if(options.fullscreen && visible)
                display.restore_mode();
 
        delete priv;
@@ -60,7 +65,8 @@ Window::~Window()
 void Window::reconfigure(const WindowOptions &opts)
 {
        bool fullscreen_changed = (opts.fullscreen!=options.fullscreen);
-       resizing = (opts.width!=options.width || opts.height!=options.height);
+       if(opts.width!=options.width || opts.height!=options.height)
+               resizing = true;
 
        if(visible)
        {