[webkit-gtk] Is JS callback run from GUI thread?

Gaute Hope eg at gaute.vetsj.com
Thu Oct 19 00:29:39 PDT 2017


Hi,

I am trying to use javascript in synchronized fashion, by waiting in the 
calling thread using condition_variables and mutex (C++):

```
  void run_js () {
    /* this runs in GTK gui thread */

    webkit_web_view_run_javascript (...., callback, ...)

    /* wait for notification from callback */
  }

  void callback (GObject *, GAsyncResult *r) {
    
    /* non-GUI processing of result */

    /* notify run_js thread */
  }
```

However, if I wait for notifications in run_js the callback is never 
called. Is the JS callback somehow called from the main GTK thread?

(please include my email in To:/Cc: in your reply).

Regards, Gaute




More information about the webkit-gtk mailing list