[Sugar-devel] [PATCH sugar] sugar-session: Check for already-running window manager on start-up

Simon Schampijer simon at schampijer.de
Tue Jul 5 05:51:12 EDT 2011


On 07/02/2011 02:29 PM, Sascha Silbe wrote:
> This not only fixes a race condition (metacity is started before sugar-session
> in sugar), but also allows running Sugar inside a different window manager.
>
> Signed-off-by: Sascha Silbe<silbe at activitycentral.com>
> ---
>   bin/sugar-session |    2 ++
>   1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/bin/sugar-session b/bin/sugar-session
> index ced8b6f..ff4beb2 100755
> --- a/bin/sugar-session
> +++ b/bin/sugar-session
> @@ -266,6 +266,8 @@ def main():
>
>       screen = wnck.screen_get_default()
>       screen.connect('window-manager-changed', __window_manager_changed_cb)
> +    # check whether the window manager is already up&  running
> +    __window_manager_changed_cb(screen)
>
>       try:
>           gtk.main()

I don't like calling callbacks directly. I would maybe do introduce a 
method like '_get_current_window_manager()'.

Regards,
    Simon


More information about the Sugar-devel mailing list