tdf#114839: Drop ancient AquaBlinker crack

Most probably that was related to "pulsating" buttons that haven't
been used since 10.9. Whether the code even worked (made buttons
pulsate) on 10.9 anyway is unclear.

Much of the code in this file uses various HITheme (Carbon?) API that
as far as I know is long since deprecated and undocumented. It's weird
that it still compiles, and that it doesn't get caught by the private
API use checking when submitting to the the Mac App Store, in the
LibreOffice Vanilla case.

This change reduces the busy looping in Dialog::Execute() even when
nothing happens (no user input, no mouse movement) when displaying a
dialog.

Change-Id: I9c62db608f637aa5d8493176feb2873f6426fd00
This commit is contained in:
Tor Lillqvist
2018-11-27 10:16:27 +02:00
parent e30f3e76a9
commit c76160c6e2
3 changed files with 0 additions and 50 deletions

View File

@@ -42,7 +42,6 @@ class AquaSalFrame;
class AquaSalTimer;
class AquaSalInstance;
class AquaSalMenu;
class AquaBlinker;
typedef struct SalFrame::SalPointerState SalPointerState;
@@ -87,8 +86,6 @@ public:
CGMutablePathRef mrClippingPath; // used for "shaping"
std::vector< CGRect > maClippingRects;
std::list<AquaBlinker*> maBlinkers;
tools::Rectangle maInvalidRect;
InputContextFlags mnICOptions;

View File

@@ -44,45 +44,6 @@
#endif
class AquaBlinker : public Timer
{
AquaSalFrame* mpFrame;
tools::Rectangle maInvalidateRect;
AquaBlinker( AquaSalFrame* pFrame, const tools::Rectangle& rRect )
: Timer( "AquaBlinker" )
, mpFrame( pFrame )
, maInvalidateRect( rRect )
{
mpFrame->maBlinkers.push_back( this );
}
public:
static void Blink( AquaSalFrame*, const tools::Rectangle&, int nTimeout = 80 );
virtual void Invoke() override
{
if( AquaSalFrame::isAlive( mpFrame ) && mpFrame->mbShown )
{
mpFrame->maBlinkers.remove( this );
mpFrame->SendPaintEvent( &maInvalidateRect );
}
delete this;
}
};
void AquaBlinker::Blink( AquaSalFrame* pFrame, const tools::Rectangle& rRect, int nTimeout )
{
// prevent repeated paints from triggering themselves all the time
auto isRepeated = std::any_of(pFrame->maBlinkers.begin(), pFrame->maBlinkers.end(),
[&rRect](AquaBlinker* pBlinker) { return pBlinker->maInvalidateRect == rRect; });
if( isRepeated )
return;
AquaBlinker* pNew = new AquaBlinker( pFrame, rRect );
pNew->SetTimeout( nTimeout );
pNew->Start();
}
// Helper returns an HIRect
static HIRect ImplGetHIRectFromRectangle(tools::Rectangle aRect)
@@ -514,13 +475,6 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
// avoid clipping when focused
rc.origin.x += FOCUS_RING_WIDTH/2;
rc.size.width -= FOCUS_RING_WIDTH;
if( nState & ControlState::DEFAULT )
{
AquaBlinker::Blink( mpFrame, buttonRect );
// show correct animation phase
aPushInfo.animation.time.current = CFAbsoluteTimeGetCurrent();
}
}
else
aPushInfo.kind = kThemeBevelButton;

View File

@@ -151,7 +151,6 @@ next_priority:
// TODO: shutdown these timers before Scheduler de-init
// TODO: remove Task from static object
if ( pTask->GetDebugName() && ( false
|| !strcmp( pTask->GetDebugName(), "AquaBlinker" )
|| !strcmp( pTask->GetDebugName(), "desktop::Desktop m_firstRunTimer" )
|| !strcmp( pTask->GetDebugName(), "DrawWorkStartupTimer" )
|| !strcmp( pTask->GetDebugName(), "editeng::ImpEditEngine aOnlineSpellTimer" )