mirror of
https://github.com/scorpion-26/gBar.git
synced 2024-11-24 12:12:09 +00:00
Fix infinite loop on Window::Close()
Apparently gtk_main_quit doesn't work anymore due to the changes to the main loop
This commit is contained in:
parent
95f9b0aadb
commit
2c50bed1d8
2 changed files with 4 additions and 2 deletions
|
@ -60,8 +60,9 @@ void Window::Init(const std::string& overideConfigLocation)
|
|||
void Window::Run()
|
||||
{
|
||||
Create();
|
||||
while (gtk_main_iteration())
|
||||
while (!bShouldQuit)
|
||||
{
|
||||
gtk_main_iteration();
|
||||
if (bHandleMonitorChanges)
|
||||
{
|
||||
// Flush the event loop
|
||||
|
@ -185,7 +186,7 @@ void Window::Destroy()
|
|||
void Window::Close()
|
||||
{
|
||||
Destroy();
|
||||
gtk_main_quit();
|
||||
bShouldQuit = true;
|
||||
}
|
||||
|
||||
void Window::UpdateMargin()
|
||||
|
|
|
@ -78,5 +78,6 @@ private:
|
|||
|
||||
GdkMonitor* m_Monitor = nullptr;
|
||||
|
||||
bool bShouldQuit = false;
|
||||
bool bHandleMonitorChanges = false;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue