Code review comment for lp:~ksamak/compiz/showmouse_autostart_option

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

> > I'm just wondering, as Sam asked, why you need a Timer here...
>
> pasting:
> I tried optionGetActivateAtStartup() in the constructor, but I think GSettings
> aren't initialized yet if the object isn't constructed.
> The optionGetActivateAtStartup function only returns default value (0) if
> placed in constructor, or in function called by constructor. I don't know of
> any other mean to bypass this except a timer.

I had a look around and you're right - it looks like the compizconfig plugin itself applies settings on an idle timer at startup. I'm not sure why that is exactly, but we'll have to work around it.

One option is to use timeout handler like this. I suppose another option is that if the setting will remain off by default, you could use optionGetActivateAtStartupNotify to receive a callback when the setting changes from false to true and then use that to activate the plugin.

I also note that the way the keybindings are done here are such that holding down the keys initiates the effect whereas releasing them terminates it. I would imagine such behaviour would have to be inverted in the "on-by-default" case.

« Back to merge proposal