~unity-team/unity/trunk

« back to all changes in this revision

Viewing changes to plugins/unityshell/src/Launcher.cpp

  • Committer: Tarmac
  • Author(s): Brandon Schaefer
  • Date: 2012-03-21 09:15:18 UTC
  • mfrom: (2128.1.3 unity)
  • Revision ID: tarmac-20120321091518-35goexng97lkex4q
* Fixes the icon getting frozen and producing a duplicate icon.. Fixes: https://bugs.launchpad.net/bugs/918753. Approved by Tim Penhey.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1471
1471
    if (!_dnd_check_handle)
1472
1472
      _dnd_check_handle = g_timeout_add(200, &Launcher::OnUpdateDragManagerTimeout, this);
1473
1473
  //}
 
1474
 
 
1475
  if (GetActionState() != ACTION_NONE)
 
1476
    ResetMouseDragState();
1474
1477
}
1475
1478
 
1476
1479
void
2183
2186
  }
2184
2187
}
2185
2188
 
 
2189
void Launcher::ResetMouseDragState()
 
2190
{
 
2191
  if (GetActionState() == ACTION_DRAG_ICON)
 
2192
    EndIconDrag();
 
2193
 
 
2194
  if (GetActionState() == ACTION_DRAG_LAUNCHER)
 
2195
    _hide_machine->SetQuirk(LauncherHideMachine::VERTICAL_SLIDE_ACTIVE, false);
 
2196
 
 
2197
  SetActionState(ACTION_NONE);
 
2198
  _dnd_delta_x = 0;
 
2199
  _dnd_delta_y = 0;
 
2200
  _last_button_press = 0;
 
2201
  EnsureAnimation();
 
2202
}
 
2203
 
2186
2204
void Launcher::RecvMouseDown(int x, int y, unsigned long button_flags, unsigned long key_flags)
2187
2205
{
2188
2206
  _last_button_press = nux::GetEventButton(button_flags);
2198
2216
  nux::Geometry geo = GetGeometry();
2199
2217
 
2200
2218
  MouseUpLogic(x, y, button_flags, key_flags);
2201
 
 
2202
 
  if (GetActionState() == ACTION_DRAG_ICON)
2203
 
    EndIconDrag();
2204
 
 
2205
 
  if (GetActionState() == ACTION_DRAG_LAUNCHER)
2206
 
    _hide_machine->SetQuirk(LauncherHideMachine::VERTICAL_SLIDE_ACTIVE, false);
2207
 
  SetActionState(ACTION_NONE);
2208
 
  _dnd_delta_x = 0;
2209
 
  _dnd_delta_y = 0;
2210
 
  _last_button_press = 0;
2211
 
  EnsureAnimation();
 
2219
  ResetMouseDragState();
2212
2220
}
2213
2221
 
2214
2222
void Launcher::RecvMouseDrag(int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags)