]> git.tdb.fi Git - libs/gui.git/blobdiff - source/graphics/window.cpp
Touchscreen input device
[libs/gui.git] / source / graphics / window.cpp
index 8c9d1748a199648b3ae5b1e232c99066399c0882..d2fb37f893d23379a1df46914b175f3a7312bdc5 100644 (file)
@@ -1,3 +1,4 @@
+#include <msp/core/application.h>
 #include "display.h"
 #include "window.h"
 #include "window_private.h"
@@ -36,6 +37,7 @@ void Window::init()
 {
        visible = false;
        kbd_autorepeat = true;
+       touch_input = false;
        resizing = false;
        priv = new Private;
 
@@ -43,6 +45,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()
@@ -60,7 +66,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)
        {
@@ -79,6 +86,12 @@ void Window::set_keyboard_autorepeat(bool r)
        kbd_autorepeat = r;
 }
 
+void Window::set_touch_input(bool t)
+{
+       touch_input = t;
+       platform_set_touch_input();
+}
+
 void Window::show()
 {
        platform_show();