Hi,
Imagine following scenario, performed on Windows 7 x32:
1. wx application is up and running, opening windows and dialogs on a computer that has 2 displays attached.
2. User disconnects (using windows display property) one of his displays
(wx application is now displayed on the other display, and everything looks fine)
4. Now it tries to open new dialog and dialog __ini__ contains the following code:
dispIndex = wx.Display_GetFromWindow(self.GetParent())
if dispIndex == wx.NOT_FOUND:
#Parent was displayed on deattached display or not found at all?
dispIndex = 0
disp = wx.Display(dispIndex)
rect = disp.GetClientArea()
Question is, why rect has x,y,width and height all set to 0?
Code above is used to limit dialog boundaries, so it's resized to fit the screen. If wx.Display::GetClientArea() returns empty rect, well.. dialog ends up having size 0 and being modal which successfully locks up whole application.
There's sample application in the attachment, you can use to see this problem. Dialog that recalculates its size (one started with lower button) will not appear after deattaching second display and lock application.
Please advise how can I notify wx.Display class that display configuration has been changed and how can I get correct result from GetClientArea() call.
Regards,
Adam.
displayProblem.py (3.33 KB)