WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
REOPENED
120070
[GTK] gdk threads deprecated functions calls should be refactored
https://bugs.webkit.org/show_bug.cgi?id=120070
Summary
[GTK] gdk threads deprecated functions calls should be refactored
Anton Obzhirov
Reported
2013-08-20 09:48:11 PDT
Warnings: 'gdk_threads_enter/gdk_threads_leave is deprecated' should be removed.
Attachments
Patch
(2.30 KB, patch)
2013-09-03 08:46 PDT
,
Anton Obzhirov
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Anton Obzhirov
Comment 1
2013-08-22 09:19:18 PDT
We have 2 places where gdk_threads_leave()/gdk_threads_enter() is used to unblock GDK lock to run nested loop for modal dialogs - void WebPopupMenuProxyGtk::showPopupMenu and webkitWebViewRunAsModal. It is not possible to use gdk_threads_add_* API here because we need to block in these functions. May be popup menu can be refactored not to be modal dialog (For QT port for example it is not). In webkitWebViewRunAsModal it has to be modal unless there is some way to block somewhere else (need to check with Mario since he added this function). Or it should be possible to create new thread, make current thread join new one and run main loop in the new thread.
Anton Obzhirov
Comment 2
2013-09-03 08:46:24 PDT
Created
attachment 210376
[details]
Patch
WebKit Commit Bot
Comment 3
2013-09-03 08:48:38 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See
http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Anton Obzhirov
Comment 4
2013-09-03 08:56:04 PDT
After extensive manual testing and running Layout tests it seems that these functions calls can be removed for good. There is no more checks for threads lock in GTK 3.6. In both places (WebPopupMenuProxyGtk::showPopupMenu and webkitWebViewRunAsModal) new loop is created in the context of the thread running main loop so it should be safe and I didn't notice any changes in code behaviour.
Mario Sanchez Prada
Comment 5
2013-09-03 09:54:18 PDT
Comment on
attachment 210376
[details]
Patch lgtm
WebKit Commit Bot
Comment 6
2013-09-03 10:07:13 PDT
Comment on
attachment 210376
[details]
Patch Clearing flags on attachment: 210376 Committed
r154989
: <
http://trac.webkit.org/changeset/154989
>
WebKit Commit Bot
Comment 7
2013-09-03 10:07:16 PDT
All reviewed patches have been landed. Closing bug.
Carlos Garcia Campos
Comment 8
2013-09-04 04:26:59 PDT
(In reply to
comment #4
)
> After extensive manual testing and running Layout tests it seems that these functions calls can be removed for good. There is no more checks for threads lock in GTK 3.6. In both places (WebPopupMenuProxyGtk::showPopupMenu and webkitWebViewRunAsModal) new loop is created in the context of the thread running main loop so it should be safe and I didn't notice any changes in code behaviour.
Are you sure? leave/enter is still used by gtk itself in current git master for every nested run loop
Mario Sanchez Prada
Comment 9
2013-09-04 05:39:29 PDT
(In reply to
comment #8
)
> [...] > Are you sure? leave/enter is still used by gtk itself in current git master for every nested run loop
In theory those two functions are deprecated as of GTK 3.6. This is what can be red from gtk-doc in gdk/gdk.c: * Deprecated:3.6: All GDK and GTK+ calls should be made from the main * thread We tested this locally and did not presented any issue, but there might be perhaps something we did not considered properly? If that's the case, feel free to roll it out and apologies for perhaps rushing it too much.
WebKit Commit Bot
Comment 10
2013-09-04 06:13:53 PDT
Re-opened since this is blocked by
bug 120678
Mario Sanchez Prada
Comment 11
2013-09-04 06:17:51 PDT
I talked to Carlos by IRC and there's actually a valid point here: as webkitgtk+ is not an app, but a library (like gtk+), we need to protect against apps not using webkitgtk+ from the main thread by keeping those gdk_threads_enter/leave calls in place for modal dialogs and popups. This is exactly what gtk+ does and why it internally still uses those functions everywhere, so we need to do the same, even if that means getting some warnings because of have them marked as deprecated functions. Sorry again for the too fast review.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug