After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 743857 - gtk_enumerate_printers can't be run from a thread
gtk_enumerate_printers can't be run from a thread
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: Printing
3.15.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-02-02 14:22 UTC by Carlos Garcia Campos
Modified: 2018-02-10 08:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test case example (1.31 KB, text/plain)
2015-02-02 14:22 UTC, Carlos Garcia Campos
  Details
Patch (1.54 KB, patch)
2015-02-02 14:26 UTC, Carlos Garcia Campos
none Details | Review

Description Carlos Garcia Campos 2015-02-02 14:22:51 UTC
Created attachment 295947 [details]
Test case example

The problem is that the sources used by the cups backend are always attached to the default main context. I want gtk_enumerate_printers to wait until done, but without using the default main context, because this will end up processing sources of my application. I really want the application to wait without processing sources, until the printer enumeration is done. So, I want to run a thread I can join from the main thread that calls gtk_enumerate_printers with wait=False, and use my own main loop and context. See attached the test case.
Comment 1 Carlos Garcia Campos 2015-02-02 14:26:20 UTC
Created attachment 295949 [details] [review]
Patch

Without the patch the thread never finishes, because the enumeration is attaching sources to the main context that is busy waiting for the thread to finish. With this patch the cups sources are attached to worker thread main context.
Comment 2 Carlos Garcia Campos 2015-02-02 17:50:11 UTC
See https://bugs.webkit.org/show_bug.cgi?id=141035#c14 for an explanation of why I need this.
Comment 3 Carlos Garcia Campos 2015-02-04 14:00:45 UTC
I'm reconsidering this . . . There are more places where GSources are attached to the default main context, the cups authentication dialog doesn't make things easy to run this in a thread either, and the fact that a possible third-party print backend might use the default main context makes it very risky to use a worker thread for gtk_enumerate_printer and join in it in the main thread. I've used a different approach for WebKit in the end.
Comment 4 Matthias Clasen 2018-02-10 04:57:50 UTC
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.