Re: Print dialog hangs for several seconds before activating

2010-06-10 Thread Alexander Larsson
On Wed, 2010-06-09 at 20:20 -0400, David A Benjamin wrote:
 I've run into this issue (and have been poking at it recently). The core 
 problem appears to be that, although GTK+ is using CUPS and setting things 
 like httpBlocking off, the CUPS non-blocking API isn't. See 
 conversations with CUPS developers at [1,2,3].

Yeah, it seems like threads are the way to go.

 It appears that the only sane way to interact with CUPS in a GUI 
 application is to use separate threads. If folks do not object the change, 
 I'll try my hand at them.

Historically gtk+ could not depend on threads being enabled, leaving it
up to apps to call g_thread_init() and gdk_thread_init(). However, as of
glib 2.24 gobject now calls g_thread_init(), so it should be safe to use
threads in gtk+. You can't call gtk+ widget code from a thread though,
as apps may still not have called gdk_thread_init(), so you need to
marshal any thread results back to the mainloop (via e.g. g_idle_add()).

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander LarssonRed Hat, Inc 
   al...@redhat.comalexander.lars...@gmail.com 
He's an unconventional coffee-fuelled vagrant on the run. She's a 
transdimensional snooty mercenary who can talk to animals. They fight crime! 

___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: Print dialog hangs for several seconds before activating

2010-06-10 Thread Olivier Fourdan
On Thu, Jun 10, 2010 at 9:38 AM, Alexander Larsson al...@redhat.com wrote:
 On Wed, 2010-06-09 at 20:20 -0400, David A Benjamin wrote:
 I've run into this issue (and have been poking at it recently). The core
 problem appears to be that, although GTK+ is using CUPS and setting things
 like httpBlocking off, the CUPS non-blocking API isn't. See
 conversations with CUPS developers at [1,2,3].

 Yeah, it seems like threads are the way to go.

Dunno if this is related, but there is also bug 614581 that may help as well:

https://bugzilla.gnome.org/show_bug.cgi?id=614581 which was committed
as http://git.gnome.org/browse/gtk+/commit/?id=33097d65

HTH,
Olivier.
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: Print dialog hangs for several seconds before activating

2010-06-10 Thread Nicolas Dufresne
Le mercredi 09 juin 2010 à 20:20 -0400, David A Benjamin a écrit :

 It appears that the only sane way to interact with CUPS in a GUI 
 application is to use separate threads. If folks do not object the
 change, 
 I'll try my hand at them. 


I would suggest to write a very thin layer that wraps the API and make
it asynchronous the GLib way. See GAsyncResult/GSimpleAsyncResult with
help of g_simple_async_result_run_in_thread(). Note that it won't make
your API cancellable, I think that GResolver implement a solution to
that.

regards,
Nicolas

p.s. You could also simplement a DBus API for CUPS.
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


RE: [Gtk-osx-users] Print dialog hangs for several seconds before activating

2010-06-10 Thread Shawn Bakhtiar


Thanks Guys!

This looks like it solved my problem.  I had to apply the patch manually (GTK 
2.18 on OS X 10.6.3 using jhbuild).

No more hangs in the print dialog... my users will be singing your blessing.

So the patch works, and from the bug it is has already been committed since 
2.22. If it works, don't add more layers.
Shawn
 



 Date: Thu, 10 Jun 2010 10:11:41 +0200
 From: four...@gmail.com
 To: gtk-devel-list@gnome.org; gtk-osx-us...@lists.sourceforge.net
 CC: david...@mit.edu; al...@redhat.com
 Subject: Re: [Gtk-osx-users] Print dialog hangs for several seconds before
 activating
 
 On Thu, Jun 10, 2010 at 9:38 AM, Alexander Larsson al...@redhat.com wrote:
  On Wed, 2010-06-09 at 20:20 -0400, David A Benjamin wrote:
  I've run into this issue (and have been poking at it recently). The core
  problem appears to be that, although GTK+ is using CUPS and setting things
  like httpBlocking off, the CUPS non-blocking API isn't. See
  conversations with CUPS developers at [1,2,3].
 
  Yeah, it seems like threads are the way to go.
 
 Dunno if this is related, but there is also bug 614581 that may help as well:
 
 https://bugzilla.gnome.org/show_bug.cgi?id=614581 which was committed
 as http://git.gnome.org/browse/gtk+/commit/?id=33097d65
 
 HTH,
 Olivier.
 
 --
 ThinkGeek and WIRED's GeekDad team up for the Ultimate 
 GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
 lucky parental unit.  See the prize list and enter to win: 
 http://p.sf.net/sfu/thinkgeek-promo
 ___
 Gtk-osx-users mailing list
 gtk-osx-us...@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gtk-osx-users
  
_
Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Print dialog hangs for several seconds before activating

2010-06-09 Thread Shawn Bakhtiar


For some reason the Print dialog hangs for several seconds before fully 
activating. During this period I am unable to push any buttons and on my OS X 
10.6.3, I get the little color wheel. After a few seconds, The dialog pops 
bigger, with several added tabs show up at the top (printer info).


jhbuild info 



Name: gtk-i386
Module Set: gtk-osx-universal
Type: autogen
Install-date: not installed
URL: http://ftp.gnome.org/gtk+/2.16/gtk+-2.18.2.tar.bz2
Version: 2.18.2
Tree-ID: 2.18.2-d41d8cd98f00b204e9800998ecf8427e
Required-by: meta-gtk-universal

Name: glib
Module Set: gtk-osx
Type: autogen
Install-date: 2010-03-22 16:31:17
URL: http://ftp.gnome.org/pub/GNOME/sources/glib/2.22/glib-2.22.2.tar.bz2
Version: 2.22.2
Tree-ID: 2.22.2-d41d8cd98f00b204e9800998ecf8427e
Required-by: glibmm, gnome-mime-data, pango, enchant, shared-mime-info, 
libsoup, atk
After: meta-gtk-osx-bootstrap, gtk-doc
Before: loudmouth, gstreamer


.




According to google, there seems to be a bug everyone is working arround, I 
have as of yet to implement correctly on my machine.

https://bugs.launchpad.net/ubuntu/+source/gtk+2.0/+bug/475845
https://bugs.launchpad.net/ubuntu/+source/gtk+2.0/+bug/475845/comments/29
https://bugs.launchpad.net/ubuntu/+source/gtk+2.0/+bug/359975
http://serverfault.com/questions/104935/authinforequired-cups-overwrites

Has anyone run into this problem, and is there a fix I am not aware of?
Thanks in advance,
Shawn


  ___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: Print dialog hangs for several seconds before activating

2010-06-09 Thread David A Benjamin
I've run into this issue (and have been poking at it recently). The core 
problem appears to be that, although GTK+ is using CUPS and setting things 
like httpBlocking off, the CUPS non-blocking API isn't. See 
conversations with CUPS developers at [1,2,3].


It appears that the only sane way to interact with CUPS in a GUI 
application is to use separate threads. If folks do not object the change, 
I'll try my hand at them.


David

[1] http://www.cups.org/newsgroups.php?s3708+gcups.development+v3713+T0
[2] http://www.cups.org/newsgroups.php?s3708+gcups.development+v3714+T0
[3] http://www.cups.org/newsgroups.php?s3708+gcups.development+v3716+T0


On Wed, 9 Jun 2010, Shawn Bakhtiar wrote:



For some reason the Print dialog hangs for several seconds before fully 
activating. During this
period I am unable to push any buttons and on my OS X 10.6.3, I get the little 
color wheel. After a
few seconds, The dialog pops bigger, with several added tabs show up at the top 
(printer info).


jhbuild info



Name: gtk-i386
Module Set: gtk-osx-universal
Type: autogen
Install-date: not installed
URL: http://ftp.gnome.org/gtk+/2.16/gtk+-2.18.2.tar.bz2
Version: 2.18.2
Tree-ID: 2.18.2-d41d8cd98f00b204e9800998ecf8427e
Required-by: meta-gtk-universal

Name: glib
Module Set: gtk-osx
Type: autogen
Install-date: 2010-03-22 16:31:17
URL: http://ftp.gnome.org/pub/GNOME/sources/glib/2.22/glib-2.22.2.tar.bz2
Version: 2.22.2
Tree-ID: 2.22.2-d41d8cd98f00b204e9800998ecf8427e
Required-by: glibmm, gnome-mime-data, pango, enchant, shared-mime-info, 
libsoup, atk
After: meta-gtk-osx-bootstrap, gtk-doc
Before: loudmouth, gstreamer


.




According to google, there seems to be a bug everyone is working arround, I 
have as of yet to
implement correctly on my machine.

https://bugs.launchpad.net/ubuntu/+source/gtk+2.0/+bug/475845
https://bugs.launchpad.net/ubuntu/+source/gtk+2.0/+bug/475845/comments/29
https://bugs.launchpad.net/ubuntu/+source/gtk+2.0/+bug/359975
http://serverfault.com/questions/104935/authinforequired-cups-overwrites

Has anyone run into this problem, and is there a fix I am not aware of?
Thanks in advance,
Shawn





___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list