Comment 2 for bug 1182603

Revision history for this message
Stephan Haller (nomad-p) wrote :

Ok, I found a way to reproduce the problem. I created a simple PHP script at http://froevel.de/~<email address hidden>/cookiedelay.php for reproduction. It is a serious problem as a cookie might be set (by AJAX request) even minutes after the page was loaded initially. In the meantime you might open a modal dialog.

The problem now is that there two concurrent modal main loops - easily said. To be honest - I don't know how to solve this problem. Does someone know a proper way to determine if a MidoriBrowser instance or GtkWindow instance has a window which is transient for our instance and knows a way how to wait for our MidoriBrowser/GtkWindow get the only top-level window in an asynchronous way?

Currently I have the idea to create a while-loop which waits for the MidoriBrowser (where we will create the infobar at) to get the active one. The disadvantage is that it will we CPU intensive (100% cpu load). The advantage should be that it should enter our modal main loop only if it got the active window - that should only happen if the modal window like toolbar editor was closed. I have no idea to make it asynchronously to be nice to CPU.