display: fixed for problem of white screen on windows
authorsungmin ha <sungmin82.ha@samsung.com>
Mon, 13 Jul 2015 05:47:43 +0000 (14:47 +0900)
committerSangho Park <sangho.p@samsung.com>
Tue, 14 Jul 2015 09:23:21 +0000 (18:23 +0900)
If the emulator received native event (erase background),
emulator screen is changed to white screen.

Change-Id: I8d4f67c0ba91056d6dce99018f5c623f554e4b5a
Signed-off-by: sungmin ha <sungmin82.ha@samsung.com>
tizen/src/display/qt5_supplement.cpp

index 824a1da..d64f4ad 100644 (file)
@@ -80,6 +80,28 @@ public:
     int priority;
 };
 
+#ifdef CONFIG_WIN32
+class EventFilter : public QAbstractNativeEventFilter
+{
+public:
+    virtual bool nativeEventFilter(const QByteArray &eventType, void *message, long *res) Q_DECL_OVERRIDE;
+};
+
+EventFilter *eventFilter = NULL;
+
+bool EventFilter::nativeEventFilter(const QByteArray &eventType, void *message, long *res)
+{
+    if (eventType == "windows_generic_MSG") {
+        MSG *msg = static_cast<MSG *>(message);
+        if (msg->message == WM_ERASEBKGND) {
+            qt5_graphic_hw_invalidate();
+        }
+    }
+
+    return false;
+}
+#endif
+
 void qt5_gui_init(void)
 {
     QCoreApplication::setApplicationName("Tizen Emulator");
@@ -271,6 +293,9 @@ void qt5_destroy()
     mruInfo.sync();
 
     /* clean up */
+#ifdef CONFIG_WIN32
+    delete eventFilter;
+#endif
     qt5App->flush();
 
     mainwindow->closeController();
@@ -314,6 +339,11 @@ void qt5_early_prepare(bool isOnscreen)
     qInstallMessageHandler(qMessageOutput);
 
     qDebug() << "* Qt plugin library path:" << QCoreApplication::libraryPaths();
+
+#ifdef CONFIG_WIN32
+    eventFilter = new EventFilter();
+    qt5App->installNativeEventFilter(eventFilter);
+#endif
 }
 
 void qt5_prepare(void)