Bug 12663

Summary: Decorator command not run at startup
Product: xorg Reporter: Colin Guthrie <colin>
Component: App/compizAssignee: David Reveman <reveman>
Status: RESOLVED INVALID QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Fix to ignore return value of the string setting
none
Better patch none

Description Colin Guthrie 2007-10-03 09:17:31 UTC
Hi,

I've been trying to use the option in the decorator plugin to run the decorator of choice automatically when compiz starts.

Unf there is a bug in the current compiz decorator plugin, incl 0.6, that prevents it from working properly.

Currently it "if (compSetStringOption (o, value))" around where the option is set. This function call will return false if the option does not change (which is the case at startup) and thus when compiz is launched, the decorator does not fire up.

The only time the decorator will run is when you edit the options value which is not particularly useful.


I have now made good use of this option (after my patch) as it fixes an issue with Gnome session saving where the decorator was not started when the session was restored.
Comment 1 Colin Guthrie 2007-10-03 09:20:53 UTC
Created attachment 11879 [details] [review]
Fix to ignore return value of the string setting

This is not a final patch but it illustrates the point.

This just adds a "|| TRUE" into the if statement but the final solution should be to remove the whole if() statement completely.

A check further down will prevent the decorator command from being run if a decorator is already running. I have tested the behaviour and with the patch applied it seems to work as you'd expect (e.g. usefully!).

The only reason I didn't remove the whole if statement is that I can't quite work out the indentation style at first glance (it's bizarre to me!), so I didn't want ot mess it up. It will take someone who is applying this seconds to adapt, so I figured it's was not worth me doing it badly!

Cheers
Comment 2 Colin Guthrie 2007-10-03 09:40:00 UTC
Created attachment 11880 [details] [review]
Better patch

This is a better patch.

1) I noticed the tabs and spaces combo in the file so the indentation seemed normal.
2) I realised there was a potential null string issue that this latest patch checks for.
Comment 3 Colin Guthrie 2007-10-04 15:12:57 UTC
As maniac103 103 pointed out to me this patch does not fix things 100%.

It works when using ccp as a config backend but does not work if compiz starts without any config backend.

I will attempt to write a better patch.
Comment 4 Colin Guthrie 2007-10-04 15:13:11 UTC
As maniac103 103 pointed out to me this patch does not fix things 100%.

It works when using ccp as a config backend but does not work if compiz starts without any config backend.

I will attempt to write a better patch.
Comment 5 Colin Guthrie 2007-10-04 15:13:39 UTC
As maniac103 103 pointed out to me this patch does not fix things 100%.

It works when using ccp as a config backend but does not work if compiz starts without any config backend.

I will attempt to write a better patch.
Comment 6 Adam Jackson 2018-06-12 19:08:19 UTC
Mass closure: This bug has been untouched for more than six years, and is not
obviously still valid. Please reopen this bug or file a new report if you continue to experience issues with current releases.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.