Hey I noticed an issue in my app with ToasterBoxes and MessageDialogs.
It only seems to happen if the ToasterBox is from a different frame (or possibly from a different parent). But if a MessageDialog appears while the ToasterBox is visible a focus deadlock happens when the toaster box tries to close. You can’t select any other window because message dialog is modal, but the toaster box seems to get the focus back (?) while it’s trying to close. I’m not entirely sure the reason for the problem but that’s what it appears like.
Oddly it works ok if the toaster box dialog is already showing when the toaster box comes up.
I’ve attached a demo which displays the behaviour. If you wait for the toaster box to appear, click the dialog button to pop the dialog and leave it up until the toaster tries to close you should be able to see the problem (everything stops responding)
Hey I noticed an issue in my app with ToasterBoxes and MessageDialogs.
It only seems to happen if the ToasterBox is from a different frame (or possibly from a different parent). But if a MessageDialog appears while the ToasterBox is visible a focus deadlock happens when the toaster box tries to close. You can't select any other window because message dialog is modal, but the toaster box seems to get the focus back (?) while it's trying to close. I'm not entirely sure the reason for the problem but that's what it appears like.
Oddly it works ok if the toaster box dialog is already showing when the toaster box comes up.
I've attached a demo which displays the behaviour. If you wait for the toaster box to appear, click the dialog button to pop the dialog and leave it up until the toaster tries to close you should be able to see the problem (everything stops responding)
I don't see this here, the focus jumps to the toasterbox and back to the message dialog and so on and I can also go to other windows unrelated to this.
BTW, the app doesn't close as one can't close the second frame. I changed it a bit so it closes when the first frame is closed and simplified the message dialog call, using 'with'.
Works fine with no problems for me:
Windows 7-32 bit
Python 2.6
wx 2.8.12.1 (msw-unicode)
Gadget/Steve
···
On 29/03/2012 11:24 AM, Paul Wiseman wrote:
I should mention I'm running wx 2.8.12.1 (mac-unicode) on python 2.7.2
on OSX 10.6.8 --
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en
Hey I noticed an issue in my app with ToasterBoxes and MessageDialogs.
It only seems to happen if the ToasterBox is from a different frame (or possibly from a different parent). But if a MessageDialog appears while the ToasterBox is visible a focus deadlock happens when the toaster box tries to close. You can’t select any other window because message dialog is modal, but the toaster box seems to get the focus back (?) while it’s trying to close. I’m not entirely sure the reason for the problem but that’s what it appears like.
Oddly it works ok if the toaster box dialog is already showing when the toaster box comes up.
I’ve attached a demo which displays the behaviour. If you wait for the toaster box to appear, click the dialog button to pop the dialog and leave it up until the toaster tries to close you should be able to see the problem (everything stops responding)
I don’t see this here, the focus jumps to the toasterbox and back to the message dialog and so on and I can also go to other windows unrelated to this.
BTW, the app doesn’t close as one can’t close the second frame. I changed it a bit so it closes when the first frame is closed and simplified the message dialog call, using ‘with’.
OK Thanks werner, It does that if the toaster pops after the dialog shows, but if you time it so you pop the dialog whilst the toaster is already up you should see it
Hey I noticed an issue in my app with ToasterBoxes and
MessageDialogs.
It only seems to happen if the ToasterBox is from a
different frame (or possibly from a different parent). But
if a MessageDialog appears while the ToasterBox is visible
a focus deadlock happens when the toaster box tries to
close. You can’t select any other window because message
dialog is modal, but the toaster box seems to get the
focus back (?) while it’s trying to close. I’m not
entirely sure the reason for the problem but that’s what
it appears like.
Oddly it works ok if the toaster box dialog is already
showing when the toaster box comes up.
I've attached a demo which displays the behaviour. If you
wait for the toaster box to appear, click the dialog
button to pop the dialog and leave it up until the toaster
tries to close you should be able to see the problem
(everything stops responding)
I don't see this here, the focus jumps to the toasterbox and
back to the message dialog and so on and I can also go to
other windows unrelated to this.
BTW, the app doesn't close as one can't close the second
frame. I changed it a bit so it closes when the first frame
is closed and simplified the message dialog call, using
‘with’.
OK Thanks werner, It does that if the toaster pops after
the dialog shows, but if you time it so you pop the dialog
whilst the toaster is already up you should see it
I’m on wxPython 2.9.4 cocoa build and able to reproduce this issue.
Nilay
···
On Thursday, March 29, 2012 10:14:47 PM UTC+5:30, Robin Dunn wrote:
On 3/29/12 3:24 AM, Paul Wiseman wrote:
I should mention I’m running wx 2.8.12.1 (mac-unicode) on python 2.7.2
on OSX 10.6.8
Try with the wxPython 2.9.3 cocoa build, I wasn’t able to duplicate the
problem there.
I'm on wxPython 2.9.4 cocoa build and able to reproduce this issue.
Nilay
Just incase you're interested this is the temporary fix I put in place. I
just use these subclasses when I need a message dialog or message box, and
they close any toaster messages to prevent the deadlock. Not ideal but it
was the best I could do
Just looking at it again now, it should probably have some locking as this
might still not work if the timing is bad. (or throw an error from the list
being mutated)
from wx.lib.agw import toasterbox as TB
import wx
class MessageDialogFix(wx.MessageDialog):
"""Fix where if toaster boxes have STAY_ON_TOP flag, when message
dialogs try to
become modal, there's a clash and the app stops responding, this fix
just closes
all tray pop ups to avoid the issue"""
def __init__(self,*args,**kwargs):
delete_all_pops()
wx.MessageDialog.__init__(self,*args,**kwargs)
You received this message because you are subscribed to the Google Groups
"wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
I'm on wxPython 2.9.4 cocoa build and able to reproduce this issue.
Nilay
Just incase you're interested this is the temporary fix I put in place. I
just use these subclasses when I need a message dialog or message box, and
they close any toaster messages to prevent the deadlock. Not ideal but it
was the best I could do
Just looking at it again now, it should probably have some locking as this
might still not work if the timing is bad. (or throw an error from the list
being mutated)
from wx.lib.agw import toasterbox as TB
import wx
class MessageDialogFix(wx.MessageDialog):
"""Fix where if toaster boxes have STAY_ON_TOP flag, when message
dialogs try to
become modal, there's a clash and the app stops responding, this fix
just closes
all tray pop ups to avoid the issue"""
def __init__(self,*args,**kwargs):
delete_all_pops()
wx.MessageDialog.__init__(self,*args,**kwargs)
You received this message because you are subscribed to the Google Groups
"wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.