~timo-jyrinki/unity/ubuntu.5200

« back to all changes in this revision

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

  • Committer: Łukasz 'sil2100' Zemczak
  • Date: 2012-07-18 15:25:17 UTC
  • mfrom: (55.813.23)
  • mto: This revision was merged to the branch mainline in revision 703.
  • Revision ID: lukasz.zemczak@canonical.com-20120718152517-y8eet69l91nsectg
* New upstream release.
  - Unity launcher shows internal partitions after they have been unmounted 
    (LP: #994163)
  - can't click to dismiss hud in the area where dynamic hud results are 
    meant to appear (LP: #962651)
  - Spread/Scale should exit if Dash is invoked (LP: #944033)
  - Searching in the HUD freezes unity (LP: #1016239)
  - Dash - The search bar gets the focus when pressing invalid keys 
    (LP: #931393)
  - unity crashed with NameError in reset_unity_compiz_profile(): global name 
    'GError' is not defined (LP: #778470)
  - When number of workspaces is set to 1, the Spread no longer works 
    (LP: #996604)
  - compiz crashed with SIGSEGV in CompWindow::id() from getPaintMask() 
    from unity::UnityWindow::glPaint() (LP: #851982)
  - "Keyboard Shortcuts" overlay can cause annoyance (LP: #934062)
  - padding between last quicklist item and bottom edge is non-deterministic 
    (changes randomly) (LP: #955158)
  - HUD Draws improperly while searching for results (LP: #932531)
  - compiz crashed with SIGSEGV in 
    unity::ui::KeyboardUtil::GetKeycodeAboveKeySymbol() (LP: #920258)
  - Launcher - when a user starts dragging a item, any folded launcher icons 
    that are valid drop receptacles should unfold (LP: #839717)
  - Dragging image from firefox/chrome to dock causes lagg/freeze 
    (LP: #772445)
  - dash should open when pressing "super" in scale mode (LP: #1023811)
  - Multimonitor, Launcher - When the Launcher is set to autohide and 
    'Sticky edges' are turned off, 'Launcher Edge Stop Overcome Pressure' 
    seems to be broken when revealing the Launcher (LP: #987955)
  - Software Center add to launcher icon animation is delayed when the 
    launcher is in auto-hide mode (LP: #1012896)
  - Purchased items are not being added to the Unity launcher (LP: #925014)
  - Unity Launcher Fails To Auto-Hide When Enabled & Installing Commercial 
    Software (LP: #1002440)
  - Regression: shift+click on a launcher icon to open a new application 
    instance gone (LP: #754565)
  - Regression: Installing apps causes a terrible visual glitch-- have to 
    restart X.org. (LP: #981168)
  - Duplicated applications icons on quick application restart (LP: #1003574)
  - HUD - Formatting of text in the auto-complete is wrong (LP: #939436)
  - alt-backtick flickers between windows (LP: #987156)
  - [Hud] The result grid is not drawn in proximity of the search entry 
    (LP: #1008603)
  - Dash and Launcher - As soon as a user starts dragging a file from the 
    Dash, there is a 'flicker' before the Launcher icons that are valid drop 
    receptacles re-saturate (LP: #863230)
  - [hud] The last button is not rounded (LP: #1008656)
  - Hud flickers when show up (LP: #1011507)
  - Dash maximise button changed location (LP: #987674)
  - launcher reordering "line" doesn't go to the bottom slot (LP: #971421)
  - Dash/HUD should close on "Spread" (LP: #870284)
  - Nothing should be written into the dash/hud searchbar when holding super,
    ctrl or Alt (LP: #1013751)
  - Dash - when a file is dragged from the Dash (Dash home, file lens, or 
    music lens) and dropped on a Launcher icon, the Dash should automatically
    close (LP: #865168)
  - Wrong keyboard focus after opening workspace switcher via keyboard 
    navigation (LP: #962408)

Show diffs side-by-side

added added

removed removed

Lines of Context:
331
331
 
332
332
  delete _hover_machine;
333
333
  delete _hide_machine;
 
334
 
 
335
  g_free(_sc_icon);
 
336
  g_free(_sc_icon_title);
 
337
  g_free(_sc_icon_desktop_file);
 
338
  g_free(_sc_icon_aptdaemon_task);
334
339
}
335
340
 
336
341
/* Introspection */
2101
2106
  if (_sc_anim_icon)
2102
2107
  {
2103
2108
    launcher_addrequest_special.emit(_sc_icon_desktop_file, AbstractLauncherIcon::Ptr(), _sc_icon_aptdaemon_task, _sc_icon, _sc_icon_x, _sc_icon_y, _sc_icon_size);
2104
 
    g_free(_sc_icon);
2105
 
    g_free(_sc_icon_title);
2106
 
    g_free(_sc_icon_desktop_file);
2107
 
    g_free(_sc_icon_aptdaemon_task);
 
2109
    g_free(_sc_icon); _sc_icon = NULL;
 
2110
    g_free(_sc_icon_title); _sc_icon_title = NULL;
 
2111
    g_free(_sc_icon_desktop_file); _sc_icon_desktop_file = NULL;
 
2112
    g_free(_sc_icon_aptdaemon_task); _sc_icon_aptdaemon_task = NULL;
2108
2113
    _sc_anim_icon = false;
2109
2114
  }
2110
2115
}
2267
2272
 
2268
2273
      if (progress >= 1.0f)
2269
2274
        _model->ReorderSmart(_drag_icon, hovered_icon, true);
2270
 
      else if (progress == 0.0f)
2271
 
        _model->ReorderBefore(_drag_icon, hovered_icon, false);
 
2275
      else if (progress == 0.0f) {
 
2276
        if (_drag_icon->GetIconType() == hovered_icon->GetIconType()) {
 
2277
          _model->ReorderBefore(_drag_icon, hovered_icon, false);
 
2278
        } else {
 
2279
          // LauncherModel::ReorderBefore does not work on different icon types
 
2280
          // so if hovered_icon is of a different type than _drag_icon
 
2281
          // try to use LauncherModel::ReorderAfter with the icon that is before hovered_icon
 
2282
          AbstractLauncherIcon::Ptr iconBeforeHover;
 
2283
          LauncherModel::iterator it;
 
2284
          LauncherModel::iterator prevIt = _model->end();
 
2285
          for (it = _model->begin(); it != _model->end(); it++)
 
2286
          {
 
2287
            if (!(*it)->GetQuirk(AbstractLauncherIcon::QUIRK_VISIBLE) || !(*it)->IsVisibleOnMonitor(monitor))
 
2288
              continue;
 
2289
 
 
2290
            if ((*it) == hovered_icon) {
 
2291
              if (prevIt != _model->end()) {
 
2292
                iconBeforeHover = *prevIt;
 
2293
              }
 
2294
              break;
 
2295
            }
 
2296
 
 
2297
            prevIt = it;
 
2298
          }
 
2299
 
 
2300
          if (iconBeforeHover && _drag_icon != iconBeforeHover) {
 
2301
            _model->ReorderAfter(_drag_icon, iconBeforeHover);
 
2302
          }
 
2303
        }
 
2304
      }
2272
2305
    }
2273
2306
  }
2274
2307
}
2557
2590
      g_source_remove(_start_dragicon_handle);
2558
2591
    _start_dragicon_handle = g_timeout_add(START_DRAGICON_DURATION, &Launcher::StartIconDragTimeout, this);
2559
2592
 
2560
 
    launcher_icon->mouse_down.emit(nux::GetEventButton(button_flags), monitor);
 
2593
    launcher_icon->mouse_down.emit(nux::GetEventButton(button_flags), key_flags, monitor);
2561
2594
  }
2562
2595
}
2563
2596
 
2573
2606
 
2574
2607
  if (_icon_mouse_down && (_icon_mouse_down == launcher_icon))
2575
2608
  {
2576
 
    _icon_mouse_down->mouse_up.emit(nux::GetEventButton(button_flags), monitor);
 
2609
    _icon_mouse_down->mouse_up.emit(nux::GetEventButton(button_flags), key_flags, monitor);
2577
2610
 
2578
2611
    if (GetActionState() == ACTION_NONE)
2579
2612
    {
 
2613
 
2580
2614
      /* This will inform the icon if the action is valid for all the monitors */
2581
2615
      int action_monitor = options()->show_for_all ? -1 : monitor;
2582
 
      _icon_mouse_down->mouse_click.emit(nux::GetEventButton(button_flags), action_monitor);
 
2616
      _icon_mouse_down->mouse_click.emit(nux::GetEventButton(button_flags), key_flags, action_monitor);
2583
2617
    }
2584
2618
  }
2585
2619
 
2586
2620
  if (launcher_icon && (_icon_mouse_down != launcher_icon))
2587
2621
  {
2588
 
    launcher_icon->mouse_up.emit(nux::GetEventButton(button_flags), monitor);
 
2622
    launcher_icon->mouse_up.emit(nux::GetEventButton(button_flags), key_flags, monitor);
2589
2623
  }
2590
2624
 
2591
2625
  if (GetActionState() == ACTION_DRAG_LAUNCHER)
2691
2725
 
2692
2726
  _hide_machine->SetQuirk(LauncherHideMachine::EXTERNAL_DND_ACTIVE, true);
2693
2727
 
2694
 
  if (IsOverlayOpen())
2695
 
    SaturateIcons();
2696
 
 
2697
2728
  for (auto it : _dnd_data.Uris())
2698
2729
  {
2699
2730
    if (g_str_has_suffix(it.c_str(), ".desktop"))
2708
2739
    for (auto it : *_model)
2709
2740
    {
2710
2741
      if (it->ShouldHighlightOnDrag(_dnd_data))
 
2742
      {
 
2743
        it->SetQuirk(AbstractLauncherIcon::QUIRK_DESAT, false);
2711
2744
        it->SetQuirk(AbstractLauncherIcon::QUIRK_DROP_PRELIGHT, true);
 
2745
        it->SetQuirk(AbstractLauncherIcon::QUIRK_PRESENTED, true);
 
2746
      }
2712
2747
      else
 
2748
      {
2713
2749
        it->SetQuirk(AbstractLauncherIcon::QUIRK_DROP_DIM, true);
 
2750
      }
2714
2751
    }
2715
2752
  }
 
2753
  else
 
2754
  {
 
2755
    if (IsOverlayOpen())
 
2756
      SaturateIcons();
 
2757
  }
2716
2758
}
2717
2759
 
2718
2760
void
2737
2779
  {
2738
2780
    it->SetQuirk(AbstractLauncherIcon::QUIRK_DROP_PRELIGHT, false);
2739
2781
    it->SetQuirk(AbstractLauncherIcon::QUIRK_DROP_DIM, false);
 
2782
    it->SetQuirk(AbstractLauncherIcon::QUIRK_PRESENTED, false);
2740
2783
  }
2741
2784
 
2742
2785
  DndHoveredIconReset();
2807
2850
    {
2808
2851
      for (auto it : *_model)
2809
2852
      {
2810
 
        if (it->QueryAcceptDrop(_dnd_data) != nux::DNDACTION_NONE)
 
2853
        if (it->ShouldHighlightOnDrag(_dnd_data))
2811
2854
          it->SetQuirk(AbstractLauncherIcon::QUIRK_DROP_PRELIGHT, true);
2812
2855
        else
2813
2856
          it->SetQuirk(AbstractLauncherIcon::QUIRK_DROP_DIM, true);
2935
2978
  }
2936
2979
  else if (_dnd_hovered_icon && _drag_action != nux::DNDACTION_NONE)
2937
2980
  {
 
2981
    if (IsOverlayOpen())
 
2982
      ubus.SendMessage(UBUS_PLACE_VIEW_CLOSE_REQUEST);
 
2983
 
2938
2984
    _dnd_hovered_icon->AcceptDrop(_dnd_data);
2939
2985
  }
2940
2986
 
2975
3021
  {
2976
3022
    Launcher* self = (Launcher*)user_data;
2977
3023
    self->_sc_anim_icon = true;
 
3024
    g_free(self->_sc_icon);
 
3025
    g_free(self->_sc_icon_desktop_file);
 
3026
    g_free(self->_sc_icon_aptdaemon_task);
2978
3027
    g_variant_get(parameters, "(ssiiiss)", &self->_sc_icon_title,
2979
3028
      &self->_sc_icon,
2980
3029
      &self->_sc_icon_x,
2984
3033
      &self->_sc_icon_aptdaemon_task, NULL);
2985
3034
 
2986
3035
    g_dbus_method_invocation_return_value(invocation, nullptr);
 
3036
 
 
3037
    self->EnsureAnimation();
2987
3038
  }
2988
3039
}
2989
3040