Closed quozl closed 5 years ago
@quozl,
In order to test my fix, I needed to call the display-resize
event. I can't figure out how to do that. Please guide me how to emit this event.
A size-changed
event probably already occurs as the PygameCanvas
widget negotiates up from the default 1x1 size to the area provided by the parent Activity
.
You can cause the size-changed
event by running Sugar inside a virtual machine or rdesktop
window and resize the window.
The event may also be caused by using right-click or left-click on the activity toolbar icon.
@quozl Left-click or right-click on the activity toolbar icon does not seem to cause resize as the traceback is not being printed.
Is there any other way to reproduce the error? I currently do not have a VM with me and rdesktop does not seem to be working.
Thanks!
Correct, there is no way for a user to resize the activity using the toolbar, because Sugar activities are always maximised to the display size.
On the OLPC XO laptops there is a rotate button to the left of the display which rotates the image by 90 degrees, effectively changing display resolution from 1200x900 to 900x1200. That's what I use.
Resizing with xrandr
should also cause a display-resize
event. Try that.
Yet another method is to plug in an external monitor, which may cause a laptop to select a resolution that is compatible with that monitor and the built-in display.
Otherwise you'll have to work on your VM or rdesktop issue.
Resize causes execution recursion, may eventually fail, and leaves a process running after stop.
While in the Pygame main loop
Letters.run()
, a display resize event is handled byGtk.main_iteration()
which callsPeterActivity.__configure_cb
which callsLetters.run()
again.Proven by reporting a traceback in the
size-changed
handler;Activity process keeps running because there is only one
QUIT
event and thegoing
state is local to each instance ofrun()
.