Merge lp:~mterry/unity/683735 into lp:unity
| Status: | Merged |
|---|---|
| Merge reported by: | Neil J. Patel |
| Merged at revision: | not available |
| Proposed branch: | lp:~mterry/unity/683735 |
| Merge into: | lp:unity |
| Diff against target: |
138 lines (+47/-4) 6 files modified
CMakeLists.txt (+1/-1) src/BamfLauncherIcon.cpp (+7/-3) src/PluginAdapter.cpp (+30/-0) src/PluginAdapter.h (+4/-0) src/SimpleLauncherIcon.cpp (+3/-0) src/TrashLauncherIcon.cpp (+2/-0) |
| To merge this branch: | bzr merge lp:~mterry/unity/683735 |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Sam Spilsbury (community) | 2010-12-01 | Approve on 2010-12-09 | |
|
Review via email:
|
|||
| Alex Launi (alexlauni) wrote : | # |
| Sam Spilsbury (smspillaz) wrote : | # |
Yeah alex is right. Basically just do an if (m_ScaleAction-
- 650. By Michael Terry on 2010-12-04
-
don't terminate scale if we're not scaling; terminate scale if we click on any launcher icon, not just running bamf ones
| Michael Terry (mterry) wrote : | # |
I've modified the code to:
* Terminate the scale if any launcher icon is clicked, not just running bamf icons
* Does not scale again if the user clicks on the same bamf launcher while scaled
* Does not terminate scale if we aren't scaled
In order to determine if we're scaled, I could not use your state() code, Same. The only thing that worked for me was actually getting the plugin class and asking if it had the grab. The action object itself just didn't have the information. The state() function always returned the same state. Which I could have fixed by passing StateInitButton when initializing the scale, but even so, it would only work when checking for scaling done by that same action. If the user pressed Super+A, they would get a scale that couldn't be terminated by launcher clicks, though I think it should be.
So, I linked against the scale plugin and checked its status directly.
| Sam Spilsbury (smspillaz) wrote : | # |
That's strange the state () should reflect what is there of the action (since the scale plugin does action->setState ().
Maybe the initial state isn't set to StateInitKey, in which case you'll need to force that (eg m_ScaleAction-
| Sam Spilsbury (smspillaz) wrote : | # |
Oh, pass StateInitKey | StateInitButton. That should do it. core doesn't really care what state the action is in, it only sets those things so that the plugins can respond appropriately.
| Michael Terry (mterry) wrote : | # |
Right... As I said, "I could have fixed by passing StateInitButton when initializing the scale, but even so, it would only work when checking for scaling done by that same action. If the user pressed Super+A, they would get a scale that couldn't be terminated by launcher clicks, though I think it should be. So, I linked against the scale plugin and checked its status directly."
There's a difference between checking the action's state and the plugin's state.
| Alex Launi (alexlauni) wrote : | # |
You can pass StateInitKey | StateInitButton. That should handle the Super + A case.
| Michael Terry (mterry) wrote : | # |
Actually, in my testing the plugin only handles state like we want if we pass just StateInitButton. Passing in StateInitKey (either additionally or by itself) doens't change the results of state() calls.
Even if we did pass them both in, my point was that the action/plugin relationship was multiple-to-one (as I understand it, I may be totally wrong). So just checking the state of one action is not sufficient as you don't know what other actions are doing. So you have to go to the source, the plugin. That's why we can't handle Super+A without checking the plugin.
| Sam Spilsbury (smspillaz) wrote : | # |
Huh. My impression was that it worked differently. I'll check the code, sec
| Sam Spilsbury (smspillaz) wrote : | # |
Ah yes, the problem is that there is one CompAction * per CompOption *, which means that there is one CompAction * for initiate_key, initiate_button and initiate_edge, as well as initiate_all_* initiate_group_* etc
I guess this means you'll have to store all the actions and check all
of their states and fire the actions appropriately (eg don't initiate if one of them is already on StateTerminateKey | StateTerminateB
Since the fix is *fairly* non-trivial I will merge it for now and finish it myself tonight. Thanks for all your help Michael :)
- 651. By Michael Terry on 2010-12-13
-
merge from trunk
| Neil J. Patel (njpatel) wrote : | # |
Thanks for updating the branch, it's merged now!


Patch works nicely. Maybe it'd be good to check the scale action's state before calling terminate? It doesn't crash the way it is, but it would save a little bit of overhead.