X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgraphics%2Fwindow.cpp;h=ebdc578e14d44524f982c74e29beb2503a7c0c99;hb=e5e2d5b41f8977bc60eca5300f3da6efbbd5786a;hp=166e49f716fc8f63944015360b8806068ff325b6;hpb=1aca77b93853ee127ac3bbf6886f7f04920542ef;p=libs%2Fgui.git diff --git a/source/graphics/window.cpp b/source/graphics/window.cpp index 166e49f..ebdc578 100644 --- a/source/graphics/window.cpp +++ b/source/graphics/window.cpp @@ -1,3 +1,4 @@ +#include #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,18 +65,19 @@ Window::~Window() void Window::reconfigure(const WindowOptions &opts) { bool fullscreen_changed = (opts.fullscreen!=options.fullscreen); - resizing = (opts.width!=options.width || opts.height!=options.height); - - options = opts; - platform_reconfigure(fullscreen_changed); + if(opts.width!=options.width || opts.height!=options.height) + resizing = true; if(visible) { - if(options.fullscreen) - display.set_mode(VideoMode(options.width, options.height)); + if(opts.fullscreen) + display.set_mode(VideoMode(opts.width, opts.height)); else if(fullscreen_changed) display.restore_mode(); } + + options = opts; + platform_reconfigure(fullscreen_changed); } void Window::set_keyboard_autorepeat(bool r) @@ -86,7 +92,7 @@ void Window::show() if(options.fullscreen) { - display.set_mode(VideoMode(options.width, options.height)); + display.set_mode(VideoMode(options.width, options.height), true); warp_pointer(options.width/2, options.height/2); } }