~sil2100/unity/precise_sru-2

« back to all changes in this revision

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

  • Committer: Łukasz 'sil2100' Zemczak
  • Date: 2012-09-11 10:38:44 UTC
  • mfrom: (55.813.24)
  • Revision ID: lukasz.zemczak@canonical.com-20120911103844-a55oeilobmdpi4wc
* New upstream release.
  - launcher is not refreshed after user session switch (LP: #1016430)
  - Dragging windows around is slow/sluggish/laggy when multiple monitors 
    are enabled (LP: #874619)
  - Dragging icons to reorder -away from launcher causes the dragged icon 
    image edges to fade away(cut off) (LP: #1026247)
  - Arrow for indicating lenses points empty space on alt+F2 (LP: #998752)
  - Tooltips backgrounds are not refreshed (no active blur) (LP: #967112)
  - [regression] Unity panel transparency (active blur) not updating properly
    (LP: #865006)
  - [Regression] Hideous low-res icon when using the HUD with autohide 
    enabled. (LP: #1035951)
  - Launcher dragged icon is not redrawn when the mouse pointer is not moved
    (LP: #1032700)
  - Black background around after dash is restored (LP: #992516)
  - Refreshing active blur makes the dash painfully slow (LP: #874230)
  - [SRU regression] alt-grave not switching to next window unless 'grave' 
    pressed twice (LP: #1035668)
  - [SRU Regression] Unity 5.14 + Nux 2.14: Launcher tooltips are 
    incomplete/missing (LP: #1034164)
  - [nvidia] unity crashed in 
    nux::GraphicsEngine::QRP_GLSL_1Tex (glDrawArrays) (LP: #1031554)
  - compiz crashed with SIGSEGV in 
    unity::ui::EdgeBarrierController::Impl::OnPointerBarrierEvent() 
    (LP: #1020075)
  - Much slower OpenGL frame rates with unityshell loaded, than plain compiz
    (LP: #988079)
  - Compiz won't start if "unredirect fullscreen windows" is enabled 
    (LP: #980663)
  - [regression] Unity launcher on-screen corruption on resume from suspend 
    with nVidia proprietary driver (LP: #915265)
  - Desktop, Launcher and menu bar still visible when screen locked 
    (LP: #886605)
  - Unity is visible on top of fullscreen apps (LP: #734908)
  - [nvidia] compiz crashed with SIGSEGV in 
    nux::BasePainter::PaintBackground (LP: #982626)
  - Update dependency on the renamed libgeis

Show diffs side-by-side

added added

removed removed

Lines of Context:
140
140
Launcher::Launcher(nux::BaseWindow* parent,
141
141
                   NUX_FILE_LINE_DECL)
142
142
  : View(NUX_FILE_LINE_PARAM)
 
143
  , _launcher_drag_delta_max(0)
 
144
  , _launcher_drag_delta_min(0)
143
145
  , _model(0)
144
146
  , _collection_window(NULL)
145
147
  , _background_color(nux::color::DimGray)
200
202
  _folded_angle           = 1.0f;
201
203
  _neg_folded_angle       = -1.0f;
202
204
  _space_between_icons    = 5;
203
 
  _last_delta_y           = 0.0f;
204
205
  _folded_z_distance      = 10.0f;
205
206
  _launcher_action_state  = ACTION_NONE;
206
207
  _icon_under_mouse       = NULL;
225
226
  _shortcuts_shown        = false;
226
227
  _hovered                = false;
227
228
  _hidden                 = false;
228
 
  _scroll_limit_reached   = false;
229
229
  _render_drag_window     = false;
230
230
  _drag_edge_touching     = false;
231
231
  _steal_drag             = false;
1202
1202
  last_geo = box_geo;
1203
1203
  _enter_y = 0;
1204
1204
 
 
1205
  // logically dnd exit only restores to the clamped ranges
 
1206
  // hover_progress restores to 0
 
1207
  _launcher_drag_delta_max = 0.0f;
 
1208
  _launcher_drag_delta_min = std::min(0.0f, launcher_height - sum);
 
1209
 
1205
1210
  if (hover_progress > 0.0f && _launcher_drag_delta != 0)
1206
1211
  {
1207
1212
    float delta_y = _launcher_drag_delta;
1208
1213
 
1209
 
    // logically dnd exit only restores to the clamped ranges
1210
 
    // hover_progress restores to 0
1211
 
    float max = 0.0f;
1212
 
    float min = MIN(0.0f, launcher_height - sum);
1213
 
 
1214
 
    if (_launcher_drag_delta > max)
1215
 
      delta_y = max + DragLimiter(delta_y - max);
1216
 
    else if (_launcher_drag_delta < min)
1217
 
      delta_y = min + DragLimiter(delta_y - min);
 
1214
    if (_launcher_drag_delta > _launcher_drag_delta_max)
 
1215
      delta_y = _launcher_drag_delta_max + DragLimiter(delta_y - _launcher_drag_delta_max);
 
1216
    else if (_launcher_drag_delta < _launcher_drag_delta_min)
 
1217
      delta_y = _launcher_drag_delta_min + DragLimiter(delta_y - _launcher_drag_delta_min);
1218
1218
 
1219
1219
    if (GetActionState() != ACTION_DRAG_LAUNCHER)
1220
1220
    {
1221
1221
      float dnd_progress = DnDExitProgress(current);
1222
1222
 
1223
 
      if (_launcher_drag_delta > max)
1224
 
        delta_y = max + (delta_y - max) * dnd_progress;
1225
 
      else if (_launcher_drag_delta < min)
1226
 
        delta_y = min + (delta_y - min) * dnd_progress;
 
1223
      if (_launcher_drag_delta > _launcher_drag_delta_max)
 
1224
        delta_y = _launcher_drag_delta_max + (delta_y - _launcher_drag_delta_max) * dnd_progress;
 
1225
      else if (_launcher_drag_delta < _launcher_drag_delta_min)
 
1226
        delta_y = _launcher_drag_delta_min + (delta_y - _launcher_drag_delta_min) * dnd_progress;
1227
1227
 
1228
1228
      if (dnd_progress == 0.0f)
1229
1229
        _launcher_drag_delta = (int) delta_y;
1232
1232
    delta_y *= hover_progress;
1233
1233
    center.y += delta_y;
1234
1234
    folding_threshold += delta_y;
1235
 
 
1236
 
    _scroll_limit_reached = (delta_y == _last_delta_y);
1237
 
    _last_delta_y = delta_y;
1238
1235
  }
1239
1236
  else
1240
1237
  {
1655
1652
  }
1656
1653
}
1657
1654
 
 
1655
nux::ObjectPtr<nux::View> const& Launcher::GetActiveTooltip() const
 
1656
{
 
1657
  return _active_tooltip;
 
1658
}
 
1659
 
 
1660
nux::ObjectPtr<LauncherDragWindow> Launcher::GetDraggedIcon() const
 
1661
{
 
1662
  return nux::ObjectPtr<LauncherDragWindow>(_drag_window);
 
1663
}
 
1664
 
1658
1665
void
1659
1666
Launcher::SetActionState(LauncherActionState actionstate)
1660
1667
{
1724
1731
gboolean Launcher::OnScrollTimeout(gpointer data)
1725
1732
{
1726
1733
  Launcher* self = (Launcher*) data;
1727
 
  nux::Geometry geo = self->GetGeometry();
1728
 
  gboolean anim = TRUE;
 
1734
  gboolean continue_animation = TRUE;
1729
1735
 
1730
 
  //
1731
 
  // Always check _scroll_limit_reached to ensure we don't keep spinning
1732
 
  // this timer if the mouse happens to be left idle over one of the autoscroll
1733
 
  // hotspots on the launcher.
1734
 
  //
1735
1736
  if (self->IsInKeyNavMode() || !self->_hovered ||
1736
 
      self->_scroll_limit_reached ||
1737
1737
      self->GetActionState() == ACTION_DRAG_LAUNCHER)
1738
 
    anim = FALSE;
 
1738
  {
 
1739
    continue_animation = FALSE;
 
1740
  }
1739
1741
  else if (self->MouseOverTopScrollArea())
1740
1742
  {
1741
 
    if (self->MouseOverTopScrollExtrema())
 
1743
    if (self->_launcher_drag_delta >= self->_launcher_drag_delta_max)
 
1744
      continue_animation = FALSE;
 
1745
    else if (self->MouseOverTopScrollExtrema())
1742
1746
      self->_launcher_drag_delta += 6;
1743
1747
    else
1744
1748
      self->_launcher_drag_delta += 3;
1745
1749
  }
1746
1750
  else if (self->MouseOverBottomScrollArea())
1747
1751
  {
1748
 
    if (self->MouseOverBottomScrollExtrema())
 
1752
    if (self->_launcher_drag_delta <= self->_launcher_drag_delta_min)
 
1753
      continue_animation = FALSE;
 
1754
    else if (self->MouseOverBottomScrollExtrema())
1749
1755
      self->_launcher_drag_delta -= 6;
1750
1756
    else
1751
1757
      self->_launcher_drag_delta -= 3;
1752
1758
  }
1753
1759
  else
1754
 
    anim = FALSE;
 
1760
  {
 
1761
    continue_animation = FALSE;
 
1762
  }
1755
1763
 
1756
 
  if (anim)
 
1764
  if (continue_animation != FALSE)
 
1765
  {
1757
1766
    self->EnsureAnimation();
 
1767
  }
1758
1768
  else
1759
1769
  {
1760
1770
    self->_autoscroll_handle = 0;
1761
 
    self->_scroll_limit_reached = false;
1762
1771
  }
1763
1772
 
1764
 
  return anim;
 
1773
  return continue_animation;
1765
1774
}
1766
1775
 
1767
1776
void Launcher::EnsureScrollTimer()
1815
1824
  EnsureAnimation();
1816
1825
 
1817
1826
  icon->needs_redraw.connect(sigc::mem_fun(this, &Launcher::OnIconNeedsRedraw));
 
1827
  icon->tooltip_visible.connect(sigc::mem_fun(this, &Launcher::OnTooltipVisible));
1818
1828
}
1819
1829
 
1820
1830
void Launcher::OnIconRemoved(AbstractLauncherIcon::Ptr icon)
1891
1901
  EnsureAnimation();
1892
1902
}
1893
1903
 
 
1904
void Launcher::OnTooltipVisible(nux::ObjectPtr<nux::View> view)
 
1905
{
 
1906
  _active_tooltip = view;
 
1907
}
 
1908
 
1894
1909
void Launcher::Draw(nux::GraphicsEngine& GfxContext, bool force_draw)
1895
1910
{
1896
1911