<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>120070</bug_id>
          
          <creation_ts>2013-08-20 09:48:11 -0700</creation_ts>
          <short_desc>[GTK] gdk threads deprecated functions calls should be refactored</short_desc>
          <delta_ts>2017-03-11 10:45:04 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>REOPENED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>120678</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Anton Obzhirov">obzhirov</reporter>
          <assigned_to name="Anton Obzhirov">obzhirov</assigned_to>
          <cc>berto</cc>
    
    <cc>bugs-noreply</cc>
    
    <cc>cgarcia</cc>
    
    <cc>commit-queue</cc>
    
    <cc>gustavo</cc>
    
    <cc>mario</cc>
    
    <cc>mrobinson</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>919087</commentid>
    <comment_count>0</comment_count>
    <who name="Anton Obzhirov">obzhirov</who>
    <bug_when>2013-08-20 09:48:11 -0700</bug_when>
    <thetext>Warnings: &apos;gdk_threads_enter/gdk_threads_leave is deprecated&apos; should be removed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>919900</commentid>
    <comment_count>1</comment_count>
    <who name="Anton Obzhirov">obzhirov</who>
    <bug_when>2013-08-22 09:19:18 -0700</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>924026</commentid>
    <comment_count>2</comment_count>
      <attachid>210376</attachid>
    <who name="Anton Obzhirov">obzhirov</who>
    <bug_when>2013-09-03 08:46:24 -0700</bug_when>
    <thetext>Created attachment 210376
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>924027</commentid>
    <comment_count>3</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2013-09-03 08:48:38 -0700</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>924031</commentid>
    <comment_count>4</comment_count>
    <who name="Anton Obzhirov">obzhirov</who>
    <bug_when>2013-09-03 08:56:04 -0700</bug_when>
    <thetext>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&apos;t notice any changes in code behaviour.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>924051</commentid>
    <comment_count>5</comment_count>
      <attachid>210376</attachid>
    <who name="Mario Sanchez Prada">mario</who>
    <bug_when>2013-09-03 09:54:18 -0700</bug_when>
    <thetext>Comment on attachment 210376
Patch

lgtm</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>924061</commentid>
    <comment_count>6</comment_count>
      <attachid>210376</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2013-09-03 10:07:13 -0700</bug_when>
    <thetext>Comment on attachment 210376
Patch

Clearing flags on attachment: 210376

Committed r154989: &lt;http://trac.webkit.org/changeset/154989&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>924062</commentid>
    <comment_count>7</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2013-09-03 10:07:16 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>924357</commentid>
    <comment_count>8</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2013-09-04 04:26:59 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; 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&apos;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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>924370</commentid>
    <comment_count>9</comment_count>
    <who name="Mario Sanchez Prada">mario</who>
    <bug_when>2013-09-04 05:39:29 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; [...]
&gt; 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&apos;s the case, feel free to roll it out and apologies for perhaps rushing it too much.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>924387</commentid>
    <comment_count>10</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2013-09-04 06:13:53 -0700</bug_when>
    <thetext>Re-opened since this is blocked by bug 120678</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>924391</commentid>
    <comment_count>11</comment_count>
    <who name="Mario Sanchez Prada">mario</who>
    <bug_when>2013-09-04 06:17:51 -0700</bug_when>
    <thetext>I talked to Carlos by IRC and there&apos;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.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>210376</attachid>
            <date>2013-09-03 08:46:24 -0700</date>
            <delta_ts>2013-09-03 10:07:13 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-120070-20130903164623.patch</filename>
            <type>text/plain</type>
            <size>2358</size>
            <attacher name="Anton Obzhirov">obzhirov</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTU0OTg0CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViS2l0Mi9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViS2l0Mi9DaGFuZ2VMb2cKaW5kZXggYTBmZjAxZDllN2YxNTUw
YWM5MzBjMTgzMmQzZDU0NDY3MGM3ZmY2NC4uMWFjNjhhMTBlZDI4MmUzMjhiMWJkNDE0MzNjZDli
OTEyMzNhYjZjMiAxMDA2NDQKLS0tIGEvU291cmNlL1dlYktpdDIvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJLaXQyL0NoYW5nZUxvZwpAQCAtMSwzICsxLDE4IEBACisyMDEzLTA5LTAzICBBbnRv
biBPYnpoaXJvdiAgPGEub2J6aGlyb3ZAc2Ftc3VuZy5jb20+CisKKyAgICAgICAgW0dUS10gZ2Rr
IHRocmVhZHMgZGVwcmVjYXRlZCBmdW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