diff --git a/ScreenPlay/src/screenplaymanager.cpp b/ScreenPlay/src/screenplaymanager.cpp index fcba65ba..ca4233c5 100644 --- a/ScreenPlay/src/screenplaymanager.cpp +++ b/ScreenPlay/src/screenplaymanager.cpp @@ -307,7 +307,7 @@ bool ScreenPlayManager::removeAllWallpapers() bool ScreenPlayManager::removeAllWidgets() { if (m_screenPlayWidgets.empty()) { - qWarning() << "Trying to remove all Widgets while m_screenPlayWidgets is not empty. Count: " << m_screenPlayWidgets.size(); + qWarning() << "Trying to remove all Widgets while m_screenPlayWidgets is empty. Count: " << m_screenPlayWidgets.size(); return false; } diff --git a/ScreenPlayWallpaper/Godot/GDExtention/src/ScreenPlayGodotWallpaper.cpp b/ScreenPlayWallpaper/Godot/GDExtention/src/ScreenPlayGodotWallpaper.cpp index 6bf0eef1..c98566b6 100644 --- a/ScreenPlayWallpaper/Godot/GDExtention/src/ScreenPlayGodotWallpaper.cpp +++ b/ScreenPlayWallpaper/Godot/GDExtention/src/ScreenPlayGodotWallpaper.cpp @@ -21,7 +21,9 @@ void ScreenPlayGodotWallpaper::_bind_methods() ClassDB::bind_method(godot::D_METHOD("send_welcome"), &ScreenPlayGodotWallpaper::send_welcome); ClassDB::bind_method(godot::D_METHOD("get_screenPlayConnected"), &ScreenPlayGodotWallpaper::get_screenPlayConnected); ClassDB::bind_method(godot::D_METHOD("get_pipeConnected"), &ScreenPlayGodotWallpaper::get_pipeConnected); + ClassDB::bind_method(godot::D_METHOD("read_from_pipe"), &ScreenPlayGodotWallpaper::read_from_pipe); ClassDB::bind_method(godot::D_METHOD("ping_alive_screenplay"), &ScreenPlayGodotWallpaper::ping_alive_screenplay); + ClassDB::bind_method(godot::D_METHOD("exit"), &ScreenPlayGodotWallpaper::exit); ClassDB::bind_method(godot::D_METHOD("get_activeScreensList"), &ScreenPlayGodotWallpaper::get_activeScreensList); ClassDB::bind_method(godot::D_METHOD("set_activeScreensList", "screens"), &ScreenPlayGodotWallpaper::set_activeScreensList); @@ -63,22 +65,6 @@ ScreenPlayGodotWallpaper::~ScreenPlayGodotWallpaper() UtilityFunctions::print( "ScreenPlayWallpaper ", itos(mID), " destroyed, current instance count: ", itos(sInstanceCount)); - - // Somehow this gets called at editor startup - // so just return if not initialized - if (m_hook) { - - ShowWindow(m_hook->windowHandle, SW_HIDE); - - // Force refresh so that we display the regular - // desktop wallpaper again - ShowWindow(m_hook->windowHandleWorker, SW_HIDE); - ShowWindow(m_hook->windowHandleWorker, SW_SHOW); - } - // Destructor - if (m_hPipe != INVALID_HANDLE_VALUE) { - CloseHandle(m_hPipe); - } } bool ScreenPlayGodotWallpaper::configureWindowGeometry() @@ -285,6 +271,26 @@ bool ScreenPlayGodotWallpaper::get_pipeConnected() const { return m_pipeConnected; } +bool ScreenPlayGodotWallpaper::exit() +{ + + // Somehow this gets called at editor startup + // so just return if not initialized + if (m_hook) { + + ShowWindow(m_hook->windowHandle, SW_HIDE); + + // Force refresh so that we display the regular + // desktop wallpaper again + ShowWindow(m_hook->windowHandleWorker, SW_HIDE); + ShowWindow(m_hook->windowHandleWorker, SW_SHOW); + } + // Destructor + if (m_hPipe != INVALID_HANDLE_VALUE) { + CloseHandle(m_hPipe); + } + return true; +} bool ScreenPlayGodotWallpaper::get_checkWallpaperVisible() const { return m_checkWallpaperVisible; diff --git a/ScreenPlayWallpaper/Godot/GDExtention/src/ScreenPlayGodotWallpaper.h b/ScreenPlayWallpaper/Godot/GDExtention/src/ScreenPlayGodotWallpaper.h index 575b2a88..3d96c883 100644 --- a/ScreenPlayWallpaper/Godot/GDExtention/src/ScreenPlayGodotWallpaper.h +++ b/ScreenPlayWallpaper/Godot/GDExtention/src/ScreenPlayGodotWallpaper.h @@ -41,6 +41,7 @@ public: bool get_screenPlayConnected() const; bool get_pipeConnected() const; bool ping_alive_screenplay(); + bool exit(); protected: static void _bind_methods(); diff --git a/ScreenPlayWallpaper/Godot/ScreenPlayGodot/main.gd b/ScreenPlayWallpaper/Godot/ScreenPlayGodot/main.gd index c0f2fe58..a95b8b5e 100644 --- a/ScreenPlayWallpaper/Godot/ScreenPlayGodot/main.gd +++ b/ScreenPlayWallpaper/Godot/ScreenPlayGodot/main.gd @@ -10,6 +10,8 @@ func ping_alive_screenplay(): if not msg.isEmpty(): print("message", msg) if "quit" in msg: + var exit = screen_play_wallpaper.exit() + print("exit ", exit) get_tree().quit() return