Reputation: 110510
In Gtk application, there is 1 main loop which listens for events (e.g. mouse click, keyboard, etc). And when a modal dialog popup, the main loop is blocked until user clicks 'OK' in the dialog, right? (i.e. nothing will happen when user clicks on the main window). Is that correct?
My question is how can firefox did its modal dialog so that it can: 1. when 1 have 2 Firefox windows 2. one of them has a modal dialog 3. other one is still interactive
If both window shares the same gtk main loop, how is that possible? Please help me understanding this.
Thank you.
Upvotes: 1
Views: 427
Reputation: 21
The alert window of firefox is modal. When you open a new window in firefox, it spawns another firefox process so you have two processes, two windows, two independent main loops.
Upvotes: 2
Reputation: 57854
If both windows share the same GTK main loop, then it's not possible. So they don't. Either they have two main loops, or they fake a modal dialog by raising the dialog every time you click on the one main window.
Upvotes: 1