199
199
ubus_.RegisterInterest(UBUS_OVERLAY_SHOWN, sigc::mem_fun(this, &Launcher::OnOverlayShown));
200
200
ubus_.RegisterInterest(UBUS_OVERLAY_HIDDEN, sigc::mem_fun(this, &Launcher::OnOverlayHidden));
201
ubus_.RegisterInterest(UBUS_LAUNCHER_ACTION_DONE, sigc::mem_fun(this, &Launcher::OnActionDone));
202
201
ubus_.RegisterInterest(UBUS_BACKGROUND_COLOR_CHANGED, sigc::mem_fun(this, &Launcher::OnBGColorChanged));
203
202
ubus_.RegisterInterest(UBUS_LAUNCHER_LOCK_HIDE, sigc::mem_fun(this, &Launcher::OnLockHideChanged));
374
373
bool Launcher::IconNeedsAnimation(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const
376
struct timespec time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_VISIBLE);
377
if (unity::TimeUtil::TimeDelta(¤t, &time) < ANIM_DURATION_SHORT)
380
time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_RUNNING);
381
if (unity::TimeUtil::TimeDelta(¤t, &time) < ANIM_DURATION_SHORT)
384
time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_STARTING);
375
struct timespec time = icon->GetQuirkTime(AbstractLauncherIcon::Quirk::VISIBLE);
376
if (unity::TimeUtil::TimeDelta(¤t, &time) < ANIM_DURATION_SHORT)
379
time = icon->GetQuirkTime(AbstractLauncherIcon::Quirk::RUNNING);
380
if (unity::TimeUtil::TimeDelta(¤t, &time) < ANIM_DURATION_SHORT)
383
time = icon->GetQuirkTime(AbstractLauncherIcon::Quirk::STARTING);
385
384
if (unity::TimeUtil::TimeDelta(¤t, &time) < (ANIM_DURATION_LONG * MAX_STARTING_BLINKS * STARTING_BLINK_LAMBDA * 2))
388
time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_URGENT);
387
time = icon->GetQuirkTime(AbstractLauncherIcon::Quirk::URGENT);
389
388
if (unity::TimeUtil::TimeDelta(¤t, &time) < (ANIM_DURATION_LONG * URGENT_BLINKS * 2))
392
time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_PULSE_ONCE);
391
time = icon->GetQuirkTime(AbstractLauncherIcon::Quirk::PULSE_ONCE);
393
392
if (unity::TimeUtil::TimeDelta(¤t, &time) < (ANIM_DURATION_LONG * PULSE_BLINK_LAMBDA * 2))
396
time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_PRESENTED);
395
time = icon->GetQuirkTime(AbstractLauncherIcon::Quirk::PRESENTED);
397
396
if (unity::TimeUtil::TimeDelta(¤t, &time) < ANIM_DURATION)
400
time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_SHIMMER);
399
time = icon->GetQuirkTime(AbstractLauncherIcon::Quirk::SHIMMER);
401
400
if (unity::TimeUtil::TimeDelta(¤t, &time) < ANIM_DURATION_LONG)
404
time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_CENTER_SAVED);
405
if (unity::TimeUtil::TimeDelta(¤t, &time) < ANIM_DURATION)
408
time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_PROGRESS);
409
if (unity::TimeUtil::TimeDelta(¤t, &time) < ANIM_DURATION)
412
time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_DROP_DIM);
413
if (unity::TimeUtil::TimeDelta(¤t, &time) < ANIM_DURATION)
416
time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_DESAT);
403
time = icon->GetQuirkTime(AbstractLauncherIcon::Quirk::CENTER_SAVED);
404
if (unity::TimeUtil::TimeDelta(¤t, &time) < ANIM_DURATION)
407
time = icon->GetQuirkTime(AbstractLauncherIcon::Quirk::PROGRESS);
408
if (unity::TimeUtil::TimeDelta(¤t, &time) < ANIM_DURATION)
411
time = icon->GetQuirkTime(AbstractLauncherIcon::Quirk::DROP_DIM);
412
if (unity::TimeUtil::TimeDelta(¤t, &time) < ANIM_DURATION)
415
time = icon->GetQuirkTime(AbstractLauncherIcon::Quirk::DESAT);
417
416
if (unity::TimeUtil::TimeDelta(¤t, &time) < ANIM_DURATION_SHORT_SHORT)
420
time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_DROP_PRELIGHT);
419
time = icon->GetQuirkTime(AbstractLauncherIcon::Quirk::DROP_PRELIGHT);
421
420
if (unity::TimeUtil::TimeDelta(¤t, &time) < ANIM_DURATION)
496
495
if (!icon->IsVisibleOnMonitor(monitor))
499
if (icon->GetIconType() == AbstractLauncherIcon::TYPE_HUD)
498
if (icon->GetIconType() == AbstractLauncherIcon::IconType::HUD)
501
return (icon->GetQuirk(AbstractLauncherIcon::QUIRK_VISIBLE)) ? 1.0f : 0.0f;
500
return (icon->GetQuirk(AbstractLauncherIcon::Quirk::VISIBLE)) ? 1.0f : 0.0f;
504
if (icon->GetQuirk(AbstractLauncherIcon::QUIRK_VISIBLE))
503
if (icon->GetQuirk(AbstractLauncherIcon::Quirk::VISIBLE))
506
struct timespec icon_visible_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_VISIBLE);
505
struct timespec icon_visible_time = icon->GetQuirkTime(AbstractLauncherIcon::Quirk::VISIBLE);
507
506
int enter_ms = unity::TimeUtil::TimeDelta(¤t, &icon_visible_time);
508
507
return CLAMP((float) enter_ms / (float) ANIM_DURATION_SHORT, 0.0f, 1.0f);
512
struct timespec icon_hide_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_VISIBLE);
511
struct timespec icon_hide_time = icon->GetQuirkTime(AbstractLauncherIcon::Quirk::VISIBLE);
513
512
int hide_ms = unity::TimeUtil::TimeDelta(¤t, &icon_hide_time);
514
513
return 1.0f - CLAMP((float) hide_ms / (float) ANIM_DURATION_SHORT, 0.0f, 1.0f);
543
542
float Launcher::IconPresentProgress(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const
545
struct timespec icon_present_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_PRESENTED);
544
struct timespec icon_present_time = icon->GetQuirkTime(AbstractLauncherIcon::Quirk::PRESENTED);
546
545
int ms = unity::TimeUtil::TimeDelta(¤t, &icon_present_time);
547
546
float result = CLAMP((float) ms / (float) ANIM_DURATION, 0.0f, 1.0f);
549
if (icon->GetQuirk(AbstractLauncherIcon::QUIRK_PRESENTED))
548
if (icon->GetQuirk(AbstractLauncherIcon::Quirk::PRESENTED))
552
551
return 1.0f - result;
572
571
float Launcher::IconDropDimValue(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const
574
struct timespec dim_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_DROP_DIM);
573
struct timespec dim_time = icon->GetQuirkTime(AbstractLauncherIcon::Quirk::DROP_DIM);
575
574
int dim_ms = unity::TimeUtil::TimeDelta(¤t, &dim_time);
576
575
float result = CLAMP((float) dim_ms / (float) ANIM_DURATION, 0.0f, 1.0f);
578
if (icon->GetQuirk(AbstractLauncherIcon::QUIRK_DROP_DIM))
577
if (icon->GetQuirk(AbstractLauncherIcon::Quirk::DROP_DIM))
579
578
return 1.0f - result;
584
583
float Launcher::IconDesatValue(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const
586
struct timespec dim_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_DESAT);
585
struct timespec dim_time = icon->GetQuirkTime(AbstractLauncherIcon::Quirk::DESAT);
587
586
int ms = unity::TimeUtil::TimeDelta(¤t, &dim_time);
588
587
float result = CLAMP((float) ms / (float) ANIM_DURATION_SHORT_SHORT, 0.0f, 1.0f);
590
if (icon->GetQuirk(AbstractLauncherIcon::QUIRK_DESAT))
589
if (icon->GetQuirk(AbstractLauncherIcon::Quirk::DESAT))
591
590
return 1.0f - result;
596
595
float Launcher::IconShimmerProgress(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const
598
struct timespec shimmer_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_SHIMMER);
597
struct timespec shimmer_time = icon->GetQuirkTime(AbstractLauncherIcon::Quirk::SHIMMER);
599
598
int shimmer_ms = unity::TimeUtil::TimeDelta(¤t, &shimmer_time);
600
599
return CLAMP((float) shimmer_ms / (float) ANIM_DURATION_LONG, 0.0f, 1.0f);
603
602
float Launcher::IconCenterTransitionProgress(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const
605
struct timespec save_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_CENTER_SAVED);
604
struct timespec save_time = icon->GetQuirkTime(AbstractLauncherIcon::Quirk::CENTER_SAVED);
606
605
int save_ms = unity::TimeUtil::TimeDelta(¤t, &save_time);
607
606
return CLAMP((float) save_ms / (float) ANIM_DURATION, 0.0f, 1.0f);
610
609
float Launcher::IconUrgentPulseValue(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const
612
if (!icon->GetQuirk(AbstractLauncherIcon::QUIRK_URGENT))
611
if (!icon->GetQuirk(AbstractLauncherIcon::Quirk::URGENT))
613
612
return 1.0f; // we are full on in a normal condition
615
614
double urgent_progress = (double) IconUrgentProgress(icon, current);
619
618
float Launcher::IconPulseOnceValue(AbstractLauncherIcon::Ptr icon, struct timespec const ¤t) const
621
struct timespec pulse_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_PULSE_ONCE);
620
struct timespec pulse_time = icon->GetQuirkTime(AbstractLauncherIcon::Quirk::PULSE_ONCE);
622
621
int pulse_ms = unity::TimeUtil::TimeDelta(¤t, &pulse_time);
623
622
double pulse_progress = (double) CLAMP((float) pulse_ms / (ANIM_DURATION_LONG * PULSE_BLINK_LAMBDA * 2), 0.0f, 1.0f);
625
624
if (pulse_progress == 1.0f)
626
icon->SetQuirk(AbstractLauncherIcon::QUIRK_PULSE_ONCE, false);
625
icon->SetQuirk(AbstractLauncherIcon::Quirk::PULSE_ONCE, false);
628
627
return 0.5f + (float) (std::cos(M_PI * 2.0 * pulse_progress)) * 0.5f;
631
630
float Launcher::IconUrgentWiggleValue(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const
633
if (!icon->GetQuirk(AbstractLauncherIcon::QUIRK_URGENT))
632
if (!icon->GetQuirk(AbstractLauncherIcon::Quirk::URGENT))
634
633
return 0.0f; // we are full on in a normal condition
636
635
double urgent_progress = (double) IconUrgentProgress(icon, current);
640
639
float Launcher::IconStartingBlinkValue(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const
642
struct timespec starting_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_STARTING);
641
struct timespec starting_time = icon->GetQuirkTime(AbstractLauncherIcon::Quirk::STARTING);
643
642
int starting_ms = unity::TimeUtil::TimeDelta(¤t, &starting_time);
644
643
double starting_progress = (double) CLAMP((float) starting_ms / (float)(ANIM_DURATION_LONG * STARTING_BLINK_LAMBDA), 0.0f, 1.0f);
645
644
double val = IsBackLightModeToggles() ? 3.0f : 4.0f;
649
648
float Launcher::IconStartingPulseValue(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const
651
struct timespec starting_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_STARTING);
650
struct timespec starting_time = icon->GetQuirkTime(AbstractLauncherIcon::Quirk::STARTING);
652
651
int starting_ms = unity::TimeUtil::TimeDelta(¤t, &starting_time);
653
652
double starting_progress = (double) CLAMP((float) starting_ms / (float)(ANIM_DURATION_LONG * MAX_STARTING_BLINKS * STARTING_BLINK_LAMBDA * 2), 0.0f, 1.0f);
655
if (starting_progress == 1.0f && !icon->GetQuirk(AbstractLauncherIcon::QUIRK_RUNNING))
654
if (starting_progress == 1.0f && !icon->GetQuirk(AbstractLauncherIcon::Quirk::RUNNING))
657
icon->SetQuirk(AbstractLauncherIcon::QUIRK_STARTING, false);
658
icon->ResetQuirkTime(AbstractLauncherIcon::QUIRK_STARTING);
656
icon->SetQuirk(AbstractLauncherIcon::Quirk::STARTING, false);
657
icon->ResetQuirkTime(AbstractLauncherIcon::Quirk::STARTING);
661
660
return 0.5f + (float)(std::cos(M_PI * (float)(MAX_STARTING_BLINKS * 2) * starting_progress)) * 0.5f;
666
665
float result = 0.0f;
668
struct timespec running_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_RUNNING);
667
struct timespec running_time = icon->GetQuirkTime(AbstractLauncherIcon::Quirk::RUNNING);
669
668
int running_ms = unity::TimeUtil::TimeDelta(¤t, &running_time);
670
669
float running_progress = CLAMP((float) running_ms / (float) ANIM_DURATION_SHORT, 0.0f, 1.0f);
672
if (!icon->GetQuirk(AbstractLauncherIcon::QUIRK_RUNNING))
671
if (!icon->GetQuirk(AbstractLauncherIcon::Quirk::RUNNING))
673
672
running_progress = 1.0f - running_progress;
675
674
// After we finish a fade in from running, we can reset the quirk
676
if (running_progress == 1.0f && icon->GetQuirk(AbstractLauncherIcon::QUIRK_RUNNING))
677
icon->SetQuirk(AbstractLauncherIcon::QUIRK_STARTING, false);
675
if (running_progress == 1.0f && icon->GetQuirk(AbstractLauncherIcon::Quirk::RUNNING))
676
icon->SetQuirk(AbstractLauncherIcon::Quirk::STARTING, false);
679
678
float backlight_strength;
680
679
if (options()->backlight_mode() == BACKLIGHT_ALWAYS_ON)
698
697
result = backlight_strength; // The blink concept is a failure in this case (it just doesn't work right)
700
699
case LAUNCH_ANIMATION_PULSE:
701
if (running_progress == 1.0f && icon->GetQuirk(AbstractLauncherIcon::QUIRK_RUNNING))
702
icon->ResetQuirkTime(AbstractLauncherIcon::QUIRK_STARTING);
700
if (running_progress == 1.0f && icon->GetQuirk(AbstractLauncherIcon::Quirk::RUNNING))
701
icon->ResetQuirkTime(AbstractLauncherIcon::Quirk::STARTING);
704
703
result = backlight_strength;
705
704
if (options()->backlight_mode() == BACKLIGHT_ALWAYS_ON)
731
730
float Launcher::IconProgressBias(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const
733
struct timespec icon_progress_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_PROGRESS);
732
struct timespec icon_progress_time = icon->GetQuirkTime(AbstractLauncherIcon::Quirk::PROGRESS);
734
733
int ms = unity::TimeUtil::TimeDelta(¤t, &icon_progress_time);
735
734
float result = CLAMP((float) ms / (float) ANIM_DURATION, 0.0f, 1.0f);
737
if (icon->GetQuirk(AbstractLauncherIcon::QUIRK_PROGRESS))
736
if (icon->GetQuirk(AbstractLauncherIcon::Quirk::PROGRESS))
738
737
return -1.0f + result;
758
757
arg.alpha = 0.2f + 0.8f * desat_value;
759
758
arg.saturation = desat_value;
760
759
arg.colorify = nux::color::White;
761
arg.running_arrow = icon->GetQuirk(AbstractLauncherIcon::QUIRK_RUNNING);
762
arg.running_colored = icon->GetQuirk(AbstractLauncherIcon::QUIRK_URGENT);
760
arg.running_arrow = icon->GetQuirk(AbstractLauncherIcon::Quirk::RUNNING);
761
arg.running_colored = icon->GetQuirk(AbstractLauncherIcon::Quirk::URGENT);
763
762
arg.draw_edge_only = IconDrawEdgeOnly(icon);
764
763
arg.active_colored = false;
765
764
arg.x_rotation = 0.0f;
771
770
arg.progress_bias = IconProgressBias(icon, current);
772
771
arg.progress = CLAMP(icon->GetProgress(), 0.0f, 1.0f);
773
772
arg.draw_shortcut = _shortcuts_shown && !_hide_machine.GetQuirk(LauncherHideMachine::PLACES_VISIBLE);
774
arg.system_item = icon->GetIconType() == AbstractLauncherIcon::TYPE_HOME ||
775
icon->GetIconType() == AbstractLauncherIcon::TYPE_HUD;
776
arg.colorify_background = icon->GetIconType() == AbstractLauncherIcon::TYPE_HOME ||
777
icon->GetIconType() == AbstractLauncherIcon::TYPE_HUD ||
778
icon->GetIconType() == AbstractLauncherIcon::TYPE_TRASH ||
779
icon->GetIconType() == AbstractLauncherIcon::TYPE_DESKTOP ||
780
icon->GetIconType() == AbstractLauncherIcon::TYPE_DEVICE ||
781
icon->GetIconType() == AbstractLauncherIcon::TYPE_EXPO;
773
arg.system_item = icon->GetIconType() == AbstractLauncherIcon::IconType::HOME ||
774
icon->GetIconType() == AbstractLauncherIcon::IconType::HUD;
775
arg.colorify_background = icon->GetIconType() == AbstractLauncherIcon::IconType::HOME ||
776
icon->GetIconType() == AbstractLauncherIcon::IconType::HUD ||
777
icon->GetIconType() == AbstractLauncherIcon::IconType::TRASH ||
778
icon->GetIconType() == AbstractLauncherIcon::IconType::DESKTOP ||
779
icon->GetIconType() == AbstractLauncherIcon::IconType::DEVICE ||
780
icon->GetIconType() == AbstractLauncherIcon::IconType::EXPO;
783
782
// trying to protect against flickering when icon is dragged from dash LP: #863230
784
783
if (arg.alpha < 0.2)
787
786
arg.saturation = 0.0;
790
arg.active_arrow = icon->GetQuirk(AbstractLauncherIcon::QUIRK_ACTIVE);
789
arg.active_arrow = icon->GetQuirk(AbstractLauncherIcon::Quirk::ACTIVE);
792
791
/* BFB or HUD icons don't need the active arrow if the overaly is opened
793
792
* in another monitor */
794
793
if (arg.active_arrow && !IsOverlayOpen() &&
795
(icon->GetIconType() == AbstractLauncherIcon::TYPE_HOME ||
796
icon->GetIconType() == AbstractLauncherIcon::TYPE_HUD))
794
(icon->GetIconType() == AbstractLauncherIcon::IconType::HOME ||
795
icon->GetIconType() == AbstractLauncherIcon::IconType::HUD))
798
797
arg.active_arrow = false;
834
833
float urgent_progress = IconUrgentProgress(icon, current);
836
if (icon->GetQuirk(AbstractLauncherIcon::QUIRK_URGENT))
835
if (icon->GetQuirk(AbstractLauncherIcon::Quirk::URGENT))
837
836
urgent_progress = CLAMP(urgent_progress * 3.0f, 0.0f, 1.0f); // we want to go 3x faster than the urgent normal cycle
839
838
urgent_progress = CLAMP(urgent_progress * 3.0f - 2.0f, 0.0f, 1.0f); // we want to go 3x faster than the urgent normal cycle
840
839
arg.glow_intensity = urgent_progress;
842
if (icon->GetQuirk(AbstractLauncherIcon::QUIRK_URGENT) && options()->urgent_animation() == URGENT_ANIMATION_WIGGLE)
841
if (icon->GetQuirk(AbstractLauncherIcon::Quirk::URGENT) && options()->urgent_animation() == URGENT_ANIMATION_WIGGLE)
844
843
arg.z_rotation = IconUrgentWiggleValue(icon, current);
1057
1056
last_geo = box_geo;
1060
// logically dnd exit only restores to the clamped ranges
1061
// hover_progress restores to 0
1062
_launcher_drag_delta_max = 0.0f;
1063
_launcher_drag_delta_min = MIN(0.0f, launcher_height - sum);
1060
1065
if (hover_progress > 0.0f && _launcher_drag_delta != 0)
1062
1067
float delta_y = _launcher_drag_delta;
1064
// logically dnd exit only restores to the clamped ranges
1065
// hover_progress restores to 0
1066
_launcher_drag_delta_max = 0.0f;
1067
_launcher_drag_delta_min = MIN(0.0f, launcher_height - sum);
1069
1069
if (_launcher_drag_delta > _launcher_drag_delta_max)
1070
1070
delta_y = _launcher_drag_delta_max + DragLimiter(delta_y - _launcher_drag_delta_max);
1071
1071
else if (_launcher_drag_delta < _launcher_drag_delta_min)
1182
1182
for (auto icon : *_model)
1184
if (icon->GetIconType () != AbstractLauncherIcon::TYPE_HOME &&
1185
icon->GetIconType () != AbstractLauncherIcon::TYPE_HUD)
1184
if (icon->GetIconType () != AbstractLauncherIcon::IconType::HOME &&
1185
icon->GetIconType () != AbstractLauncherIcon::IconType::HUD)
1187
icon->SetQuirk(AbstractLauncherIcon::QUIRK_DESAT, true);
1187
icon->SetQuirk(AbstractLauncherIcon::Quirk::DESAT, true);
1190
1190
icon->HideTooltip();
1290
1290
return _dash_is_open || _hud_is_open;
1293
void Launcher::OnActionDone(GVariant* data)
1295
_hide_machine.SetQuirk(LauncherHideMachine::LAST_ACTION_ACTIVATE, true);
1298
void Launcher::SetHidden(bool hidden)
1300
if (hidden == _hidden)
1293
void Launcher::SetHidden(bool hide_launcher)
1295
if (hide_launcher == _hidden)
1304
_hide_machine.SetQuirk(LauncherHideMachine::LAUNCHER_HIDDEN, hidden);
1305
_hover_machine.SetQuirk(LauncherHoverMachine::LAUNCHER_HIDDEN, hidden);
1307
_hide_machine.SetQuirk(LauncherHideMachine::LAST_ACTION_ACTIVATE, false);
1298
_hidden = hide_launcher;
1299
_hide_machine.SetQuirk(LauncherHideMachine::LAUNCHER_HIDDEN, hide_launcher);
1300
_hover_machine.SetQuirk(LauncherHoverMachine::LAUNCHER_HIDDEN, hide_launcher);
1311
1304
_hide_machine.SetQuirk(LauncherHideMachine::MOUSE_MOVE_POST_REVEAL, false);
1312
1305
_hide_machine.SetQuirk(LauncherHideMachine::MT_DRAG_OUT, false);
1319
1312
TimeUtil::SetTimeStruct(&_times[TIME_AUTOHIDE], &_times[TIME_AUTOHIDE], ANIM_DURATION_SHORT);
1321
_parent->EnableInputWindow(!hidden, launcher::window_title, false, false);
1314
_parent->EnableInputWindow(!hide_launcher, launcher::window_title, false, false);
1323
if (!hidden && GetActionState() == ACTION_DRAG_EXTERNAL)
1316
if (!hide_launcher && GetActionState() == ACTION_DRAG_EXTERNAL)
1326
1319
EnsureAnimation();
1328
1321
hidden_changed.emit();
1324
void Launcher::UpdateChangeInMousePosition(int delta_x, int delta_y)
1326
_postreveal_mousemove_delta_x += delta_x;
1327
_postreveal_mousemove_delta_y += delta_y;
1329
// check the state before changing it to avoid uneeded hide calls
1330
if (!_hide_machine.GetQuirk(LauncherHideMachine::MOUSE_MOVE_POST_REVEAL) &&
1331
(nux::Abs(_postreveal_mousemove_delta_x) > MOUSE_DEADZONE ||
1332
nux::Abs(_postreveal_mousemove_delta_y) > MOUSE_DEADZONE))
1333
_hide_machine.SetQuirk(LauncherHideMachine::MOUSE_MOVE_POST_REVEAL, true);
1331
1337
int Launcher::GetMouseX() const
1333
1339
return _mouse_position.x;
1482
static bool first_time = true;
1476
1484
_parent->EnableInputWindow(true, launcher::window_title, false, false);
1478
if (!sources_.GetSource(STRUT_HACK_TIMEOUT))
1486
if (first_time && !sources_.GetSource(STRUT_HACK_TIMEOUT))
1480
1488
sources_.AddTimeout(1000, sigc::mem_fun(this, &Launcher::StrutHack), STRUT_HACK_TIMEOUT);
1483
1492
_parent->InputWindowEnableStruts(true);
2066
2080
AbstractLauncherIcon::Ptr hovered_icon = MouseIconIntersection(_mouse_position.x, _mouse_position.y);
2068
if (hovered_icon && hovered_icon->GetIconType() == AbstractLauncherIcon::TYPE_TRASH)
2082
if (hovered_icon && hovered_icon->GetIconType() == AbstractLauncherIcon::IconType::TRASH)
2070
hovered_icon->SetQuirk(AbstractLauncherIcon::QUIRK_PULSE_ONCE, true);
2084
hovered_icon->SetQuirk(AbstractLauncherIcon::Quirk::PULSE_ONCE, true);
2072
2086
launcher_removerequest.emit(_drag_icon);
2257
2279
SetMousePosition(x, y);
2261
_postreveal_mousemove_delta_x += dx;
2262
_postreveal_mousemove_delta_y += dy;
2264
// check the state before changing it to avoid uneeded hide calls
2265
if (!_hide_machine.GetQuirk(LauncherHideMachine::MOUSE_MOVE_POST_REVEAL) &&
2266
(nux::Abs(_postreveal_mousemove_delta_x) > MOUSE_DEADZONE ||
2267
nux::Abs(_postreveal_mousemove_delta_y) > MOUSE_DEADZONE))
2268
_hide_machine.SetQuirk(LauncherHideMachine::MOUSE_MOVE_POST_REVEAL, true);
2282
UpdateChangeInMousePosition(dx, dy);
2273
2284
// Every time the mouse moves, we check if it is inside an icon...
2588
2595
if (it->ShouldHighlightOnDrag(_dnd_data))
2590
it->SetQuirk(AbstractLauncherIcon::QUIRK_DESAT, false);
2591
it->SetQuirk(AbstractLauncherIcon::QUIRK_PRESENTED, true);
2597
it->SetQuirk(AbstractLauncherIcon::Quirk::DESAT, false);
2598
it->SetQuirk(AbstractLauncherIcon::Quirk::PRESENTED, true);
2595
it->SetQuirk(AbstractLauncherIcon::QUIRK_DESAT, true);
2596
it->SetQuirk(AbstractLauncherIcon::QUIRK_PRESENTED, false);
2602
it->SetQuirk(AbstractLauncherIcon::Quirk::DESAT, true);
2603
it->SetQuirk(AbstractLauncherIcon::Quirk::PRESENTED, false);