fix: close known windows on exit (#6054)
This commit is contained in:
@@ -42,6 +42,7 @@
|
|||||||
- Bugfix: Fixed color input thinking blue is also red. (#5982)
|
- Bugfix: Fixed color input thinking blue is also red. (#5982)
|
||||||
- Bugfix: Fixed an issue where commands would sometimes reset if Chatterino was improperly shut down. (#6011)
|
- Bugfix: Fixed an issue where commands would sometimes reset if Chatterino was improperly shut down. (#6011)
|
||||||
- Bugfix: Fixed a thick border on Windows 11. (#5836)
|
- Bugfix: Fixed a thick border on Windows 11. (#5836)
|
||||||
|
- Bugfix: Fixed some windows not immediately closing. (#6054)
|
||||||
- Dev: Subscriptions to PubSub channel points redemption topics now use no auth token, making it continue to work during PubSub shutdown. (#5947)
|
- Dev: Subscriptions to PubSub channel points redemption topics now use no auth token, making it continue to work during PubSub shutdown. (#5947)
|
||||||
- Dev: Add initial experimental EventSub support. (#5837, #5895, #5897, #5904, #5910, #5903, #5915, #5916, #5930, #5935, #5932, #5943, #5952, #5953, #5968, #5973, #5974, #5980, #5981, #5985, #5990, #5992, #5993, #5996, #5995, #6000, #6001, #6002, #6003, #6005, #6007, #6010, #6008, #6012, #6013, #6015, #6017, #6027, #6028, #6035, #6036, #6040, #6041, #6048)
|
- Dev: Add initial experimental EventSub support. (#5837, #5895, #5897, #5904, #5910, #5903, #5915, #5916, #5930, #5935, #5932, #5943, #5952, #5953, #5968, #5973, #5974, #5980, #5981, #5985, #5990, #5992, #5993, #5996, #5995, #6000, #6001, #6002, #6003, #6005, #6007, #6010, #6008, #6012, #6013, #6015, #6017, #6027, #6028, #6035, #6036, #6040, #6041, #6048)
|
||||||
- Dev: Remove unneeded platform specifier for toasts. (#5914)
|
- Dev: Remove unneeded platform specifier for toasts. (#5914)
|
||||||
|
|||||||
@@ -34,17 +34,36 @@
|
|||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
|
||||||
namespace chatterino {
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
std::optional<bool> &shouldMoveOutOfBoundsWindow()
|
std::optional<bool> &shouldMoveOutOfBoundsWindow()
|
||||||
|
{
|
||||||
|
static std::optional<bool> x;
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
void closeWindowsRecursive(QWidget *window)
|
||||||
|
{
|
||||||
|
if (window->isWindow() && window->isVisible())
|
||||||
{
|
{
|
||||||
static std::optional<bool> x;
|
window->close();
|
||||||
return x;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (auto *child : window->children())
|
||||||
|
{
|
||||||
|
if (child->isWidgetType())
|
||||||
|
{
|
||||||
|
// We check if it's a widget above
|
||||||
|
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-static-cast-downcast)
|
||||||
|
closeWindowsRecursive(static_cast<QWidget *>(child));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
namespace chatterino {
|
||||||
|
|
||||||
const QString WindowManager::WINDOW_LAYOUT_FILENAME(
|
const QString WindowManager::WINDOW_LAYOUT_FILENAME(
|
||||||
QStringLiteral("window-layout.json"));
|
QStringLiteral("window-layout.json"));
|
||||||
|
|
||||||
@@ -782,7 +801,7 @@ void WindowManager::closeAll()
|
|||||||
|
|
||||||
for (Window *window : windows_)
|
for (Window *window : windows_)
|
||||||
{
|
{
|
||||||
window->close();
|
closeWindowsRecursive(window);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user