Merge lp:~tribaal/unity-tweak-tool/fix-show-desktop-core-dump into lp:unity-tweak-tool

Proposed by Chris Glass
Status: Merged
Merge reported by: J Phani Mahesh
Merged at revision: not available
Proposed branch: lp:~tribaal/unity-tweak-tool/fix-show-desktop-core-dump
Merge into: lp:unity-tweak-tool
Diff against target: 14 lines (+4/-1)
1 file modified
UnityTweakTool/section/spaghetti/compiz.py (+4/-1)
To merge this branch: bzr merge lp:~tribaal/unity-tweak-tool/fix-show-desktop-core-dump
Reviewer Review Type Date Requested Status
Freyja Development Pending
Review via email: mp+207381@code.launchpad.net

Commit message

Only activate the "Show desktop" option of the "Window spread" section if the option is available.

Description of the change

This fixes the linked bug by only activating the "Show desktop" option of the "Window spread" section (labeled as "Click to access desktop") if the option is actually available.

Pretty straightforward check. While this was not tested on previous ubuntu versions it should work fine on saucy (since the key will be defined there).

To post a comment you must log in.
Revision history for this message
J Phani Mahesh (phanimahesh) wrote :

Hi Chris!

Thanks for the patch. This solves the problem partially. The other bit that is missing is to unsensitize the checkbox, so that the user can not interact with it, when the key is missing. We are good to merge after adding that.

Cheers,
Mahesh.

Revision history for this message
Chris Glass (tribaal) wrote :

It's already never activated - that's what set_active() does.

Here's a screenshot with my patch applied. Notice how the tickbox is disabled already.

Revision history for this message
Chris Glass (tribaal) wrote :

Oh, of course, I forgot the URL for the screenshot:)

http://imgur.com/FERyoy3

Revision history for this message
J Phani Mahesh (phanimahesh) wrote :

I'm looking at it right now. Should be merged in ten minutes if that is the case.

Revision history for this message
J Phani Mahesh (phanimahesh) wrote :

No, set_active changes the state of the checkbox, ticked vs unticked. set_sensitive(True|False) should be used to make the widget usable/unusable.

And I just checked the UI definitions, it is set to be sensitive by default. I'll need to hunt down where it is getting unsensitized, and if it is not being unsensitized, will have to add that bit. This is going to take some time..

I'll comment back in an hour or so. If you have some time to spare, try to identify where set_sensitive(False) is being called on the checkbox.

179. By Chris Glass

Added explicit desensitization.

Revision history for this message
Chris Glass (tribaal) wrote :

So, the checkbox cannot be toggled on or off and shows as "grey" (please see screenshot).

I added an explicit desensitization in case the show-desktop key is not found. While it doesn't change the behaviour at all it should be quite clear that this won't break in any way now.

Revision history for this message
J Phani Mahesh (phanimahesh) wrote :

Found it. It has been taken out of spaghetti long ago, but the reference has not been deleted from spaghetti. there is a checkbox defined in section/windowmanager.py (L188) which automatically takes care of checking the key, and unsensitizing the widget if it is not found.

So the correct patch would be to delete all references to check_click_desktop from the section/spaghetti/compiz.py
Well, all except where it appears as a dependant.

Our bzr repo is actually a mirror of git repo, which gets rewritten daily by LP bots. Would you like to submit a pull request on github, or mail me a patch? Or would you prefer that I commit the changes myself?

Revision history for this message
Chris Glass (tribaal) wrote :

So if submitting these changes to github will make the merge, sure, I'll open a PR in a minute.

However I'm not sure I'll have time and dedication enough to attempt the refactoring you describe. Maybe a middle ground would be to merge this in (via github) now to fix the core dump for current users, then handle the refactoring separately?

Revision history for this message
J Phani Mahesh (phanimahesh) wrote :

Well, the refactoring has been done. We missed removing the bits in spaghetti. (the code is duplicated currently)

All you have to do is, in the compiz.py file you were editing, delete the function on_check_click_desktop_toggled (Line 721) and the line you were trying to edit earlier. That fixes the crash.

Revision history for this message
J Phani Mahesh (phanimahesh) wrote :

Merged on github.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'UnityTweakTool/section/spaghetti/compiz.py'
2--- UnityTweakTool/section/spaghetti/compiz.py 2013-05-13 02:55:19 +0000
3+++ UnityTweakTool/section/spaghetti/compiz.py 2014-02-20 13:01:52 +0000
4@@ -428,7 +428,10 @@
5 else:
6 self.ui['check_overlay_emblem'].set_active(False)
7
8- self.ui['check_click_desktop'].set_active(gsettings.scale.get_boolean('show-desktop'))
9+ if 'show-desktop' in gsettings.scale.list_keys():
10+ self.ui['check_click_desktop'].set_active(gsettings.scale.get_boolean('show-desktop'))
11+ else:
12+ self.ui['check_click_desktop'].set_sensitive(False)
13
14 model = self.ui['list_compiz_windows_spread_accelerators']
15

Subscribers

People subscribed via source and target branches