Scale Addons: "Exit Scale On Pull" code logic just works for the initiate_key binding, will fail completely if this is not defined

Bug #1173608 reported by MC Return
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Compiz
New
Medium
MC Return

Bug Description

[How to reproduce]

1. Enable Scale and Scale Addons
2. Remove the scale keybinding "Initiate Window Picker" and use "Initiate Window Picker For All Windows"
3. Open Scale Addons, enable the "Pull Window" binding and make sure Behaviour->"Exit Scale On Pull" is enabled
4. Activate Scale and try to "Pull" a window

[What you would expect to happen]

The window should focus and scale should exit.

[What actually happens]

The enabled "Exit Scale On Pull" setting gets ignored.

This is the code responsible for that problem:

     if (optionGetExitAfterPull ())
     {
  CompAction *action;
  CompOption::Vector o;
  CompOption *opt;

  o.push_back (CompOption ("root", CompOption::TypeInt));
  o[0].value ().set ((int) screen->root ());

  opt = CompOption::findOption (sScreen->getOptions (),
           "initiate_key", 0);
  action = &opt->value ().action ();

  if (action->terminate ())
      action->terminate () (action, 0, o);
     }

It is weak design, because it assumes that the "initiate_key" is defined, which is not always the case
(as you can clearly see in the how-to-reproduce part above)

It should instead directly call the terminate function of scale instead of initiating the key.

MC Return (mc-return)
Changed in compiz:
assignee: nobody → MC Return (mc-return)
status: New → In Progress
status: In Progress → New
MC Return (mc-return)
Changed in compiz:
importance: Undecided → Medium
milestone: none → 0.9.10.0
MC Return (mc-return)
Changed in compiz:
milestone: 0.9.10.0 → 0.9.11.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.