Beyond GDK threads and gtk_dialog_run - What to use?



Hello there,

I'm running an effort to add support for modal dialogs in WebKitGTK+, bug
report is located at WebKit's bugzilla[1]. When a web page requests a modal
dialog, the user agent is required to create a new window that will
represent the modal dialog, set it transient to its parent and set it as
modal. The window will be shown and after that the WebKit library will take
over, running a loop to prevent user interaction with other windows. When
the modal dialog window is closed, the loop is ended.

gtk_dialog_run was a perfect example to follow, using main loops with
GDK_THREADS_LEAVE and GDK_THREADS_ENTER calls. These, however, seem to be
on their way to become deprecated.[2] WebKitGTK+ should, however, still
provide the modal effect when modal dialogs are to be shown and run (i.e.
there's no signals or similar workarounds as with gtk_dialog_run), meaning
a main loop should probably be established and run until the dialog itself
is destroyed.

I'd like some input on what's the best and most (thread-)safe way to set up
the main loop or if there are any other options to avoid using GDK threads
calls and make the implementation future-complaint today.

Best regards,
Zan

[1] https://bugs.webkit.org/show_bug.cgi?id=53600
[2] http://blogs.gnome.org/desrt/2012/02/26/sprout-and-the-bean/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]