How to use GDK locking with pygtk3 ?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to use GDK locking with pygtk3 ?

Ronald Sayers
Hello,

I just added a infobar into my application -
https://github.com/wifiextender/pshot and the uploading processes is
started in a new thread -
thread.start_new_thread(self.on_upload_clicked,
("start_in_new_thread", )) . Once it reaches the point - if
resp_json['success']: , I get the following message, not every time
but it happens and closes the whole application:

(pshot.py:5016): Gdk-WARNING **: pshot.py: Fatal IO error 11 (Resource
temporarily unavailable) on X server :0.
_______________________________________________
pygtk mailing list   [hidden email]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/
Reply | Threaded
Open this post in threaded view
|

Re: How to use GDK locking with pygtk3 ?

Petr Kubánek
Hi,

you are performing some GTK ops in the thread, aren't you? Consider
calling that with gobject.idle_add, so they will run in main thread.

Please see pygtk threading/FAQ for details.

Petr

On Čt, 2013-12-26 at 22:45 +0200, Ronald Sayers wrote:

> Hello,
>
> I just added a infobar into my application -
> https://github.com/wifiextender/pshot and the uploading processes is
> started in a new thread -
> thread.start_new_thread(self.on_upload_clicked,
> ("start_in_new_thread", )) . Once it reaches the point - if
> resp_json['success']: , I get the following message, not every time
> but it happens and closes the whole application:
>
> (pshot.py:5016): Gdk-WARNING **: pshot.py: Fatal IO error 11 (Resource
> temporarily unavailable) on X server :0.
> _______________________________________________
> pygtk mailing list   [hidden email]
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/


_______________________________________________
pygtk mailing list   [hidden email]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/
Reply | Threaded
Open this post in threaded view
|

Re: How to use GDK locking with pygtk3 ?

Ronald Sayers
In reply to this post by Ronald Sayers
Solved it, it was caused by "infobar" which seems have some bugs
combined with threaded function. Parent-> start new function in a
thread and show the infobar -> process completes -> hide the infobar
-> spawn a new dialog window.

On 26/12/2013, Ronald Sayers <[hidden email]> wrote:

> Hello,
>
> I just added a infobar into my application -
> https://github.com/wifiextender/pshot and the uploading processes is
> started in a new thread -
> thread.start_new_thread(self.on_upload_clicked,
> ("start_in_new_thread", )) . Once it reaches the point - if
> resp_json['success']: , I get the following message, not every time
> but it happens and closes the whole application:
>
> (pshot.py:5016): Gdk-WARNING **: pshot.py: Fatal IO error 11 (Resource
> temporarily unavailable) on X server :0.
>
_______________________________________________
pygtk mailing list   [hidden email]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/
Reply | Threaded
Open this post in threaded view
|

Re: How to use GDK locking with pygtk3 ?

John Stowers
No gtk functions can be called from outside the gtk thread (unless you take the lock - although that doesnt work on windows)

This is not specific to infobar.


On Fri, Dec 27, 2013 at 4:21 PM, Ronald Sayers <[hidden email]> wrote:
Solved it, it was caused by "infobar" which seems have some bugs
combined with threaded function. Parent-> start new function in a
thread and show the infobar -> process completes -> hide the infobar
-> spawn a new dialog window.

On 26/12/2013, Ronald Sayers <[hidden email]> wrote:
> Hello,
>
> I just added a infobar into my application -
> https://github.com/wifiextender/pshot and the uploading processes is
> started in a new thread -
> thread.start_new_thread(self.on_upload_clicked,
> ("start_in_new_thread", )) . Once it reaches the point - if
> resp_json['success']: , I get the following message, not every time
> but it happens and closes the whole application:
>
> (pshot.py:5016): Gdk-WARNING **: pshot.py: Fatal IO error 11 (Resource
> temporarily unavailable) on X server :0.
>
_______________________________________________
pygtk mailing list   [hidden email]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


_______________________________________________
pygtk mailing list   [hidden email]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/