mirror of
https://github.com/scorpion-26/gBar.git
synced 2024-11-21 18:52:49 +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()
|
void Window::Run()
|
||||||
{
|
{
|
||||||
Create();
|
Create();
|
||||||
while (gtk_main_iteration())
|
while (!bShouldQuit)
|
||||||
{
|
{
|
||||||
|
gtk_main_iteration();
|
||||||
if (bHandleMonitorChanges)
|
if (bHandleMonitorChanges)
|
||||||
{
|
{
|
||||||
// Flush the event loop
|
// Flush the event loop
|
||||||
|
@ -185,7 +186,7 @@ void Window::Destroy()
|
||||||
void Window::Close()
|
void Window::Close()
|
||||||
{
|
{
|
||||||
Destroy();
|
Destroy();
|
||||||
gtk_main_quit();
|
bShouldQuit = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::UpdateMargin()
|
void Window::UpdateMargin()
|
||||||
|
|
|
@ -78,5 +78,6 @@ private:
|
||||||
|
|
||||||
GdkMonitor* m_Monitor = nullptr;
|
GdkMonitor* m_Monitor = nullptr;
|
||||||
|
|
||||||
|
bool bShouldQuit = false;
|
||||||
bool bHandleMonitorChanges = false;
|
bool bHandleMonitorChanges = false;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue