[Sugar-devel] Making Sugar Shell smarter with Activities that change window
Martin Langhoff
martin.langhoff at gmail.com
Fri Feb 11 18:01:58 EST 2011
Aleksey, Simon,
after tearing my hair off a bit with an app that jumps through various
windows during its lifetime, I came up with what seems to be a
reasonable strategy for handling the situation
In brief summary:
- change the Activity.window property to an stack.
- new windows are append()ed, closed windows are remove()d
- the "lowest" window in the stack is considered the 'main' window
- we only consider the activity instance closed once its last window is closed
- some logging.debug() calls added to trace apps that chew through
windows like a drunken sailor
I mainly wonder about the rough logic I apply to select the 'main'
window. It appeals to my common sense -- it'll be the oldest window
that is still around -- but I know very little about gtk and window
management. Maybe there is a gtk call or convention that we should use
instead?
Trac entry at http://dev.laptop.org/ticket/10695 -- has a pair of
patches that I think are master-worthy...
m
--
martin.langhoff at gmail.com
martin at laptop.org -- Software Architect - OLPC
- ask interesting questions
- don't get distracted with shiny stuff - working code first
- http://wiki.laptop.org/go/User:Martinlanghoff
More information about the Sugar-devel
mailing list