hiro/gtk: Remove pendingEvents here too.

Now that pApplication::pendingEvents() has been removed from hiro/core, it
should be removed from the GTK+ backend too.
This commit is contained in:
Tim Allen
2025-09-02 01:10:27 +10:00
parent 08e6de3186
commit b7678f5261
2 changed files with 1 additions and 6 deletions

View File

@@ -34,16 +34,12 @@ auto pApplication::run() -> void {
}
}
auto pApplication::pendingEvents() -> bool {
return gtk_events_pending();
}
auto pApplication::processEvents() -> void {
//GTK can sometimes return gtk_pending_events() == true forever,
//no matter how many times gtk_main_iteration_do() is called.
//implement a timeout to prevent hiro from hanging forever in this case.
auto time = chrono::millisecond();
while(pendingEvents() && chrono::millisecond() - time < 50) {
while(gtk_events_pending() && chrono::millisecond() - time < 50) {
gtk_main_iteration_do(false);
}
for(auto& window : state().windows) window->_synchronizeGeometry();

View File

@@ -6,7 +6,6 @@ struct pApplication {
static auto exit() -> void;
static auto modal() -> bool;
static auto run() -> void;
static auto pendingEvents() -> bool;
static auto processEvents() -> void;
static auto quit() -> void;
static auto setScreenSaver(bool screenSaver) -> void;