tdf#77444: Call TriggerUserEventProcessing() in a few key places

Causes the updated aAppEventList to be handled right away, and not
only when the next ten-second timed fires.

Change-Id: Idbcc67f13c8ea69cc08b6c5f832d4461579d5dc6
Reviewed-on: https://gerrit.libreoffice.org/54643
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
This commit is contained in:
Tor Lillqvist
2018-05-21 17:06:38 +03:00
parent 0f2157cb15
commit 059872b47e
2 changed files with 10 additions and 1 deletions

View File

@@ -71,10 +71,11 @@ class AquaSalInstance : public SalInstance, public SalUserEventList
bool RunInMainYield( bool bHandleAllCurrentEvents );
virtual void TriggerUserEventProcessing() override;
virtual void ProcessEvent( SalUserEvent aEvent ) override;
public:
virtual void TriggerUserEventProcessing() override;
SalYieldMutex* mpSalYieldMutex; // Sal-Yield-Mutex
OUString maDefaultPrinter;
oslThreadIdentifier maMainThread;

View File

@@ -248,6 +248,8 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
{
const ApplicationEvent* pAppEvent = new ApplicationEvent(ApplicationEvent::Type::Open, aFile);
AquaSalInstance::aAppEventList.push_back( pAppEvent );
AquaSalInstance *pInst = GetSalData()->mpInstance;
pInst->TriggerUserEventProcessing();
}
return YES;
}
@@ -276,6 +278,8 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
// [app replyToOpenOrPrint: NSApplicationDelegateReplySuccess];
const ApplicationEvent* pAppEvent = new ApplicationEvent(ApplicationEvent::Type::Open, aFileList);
AquaSalInstance::aAppEventList.push_back( pAppEvent );
AquaSalInstance *pInst = GetSalData()->mpInstance;
pInst->TriggerUserEventProcessing();
}
}
@@ -286,6 +290,8 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
aFile.push_back( GetOUString( pFile ) );
const ApplicationEvent* pAppEvent = new ApplicationEvent(ApplicationEvent::Type::Print, aFile);
AquaSalInstance::aAppEventList.push_back( pAppEvent );
AquaSalInstance *pInst = GetSalData()->mpInstance;
pInst->TriggerUserEventProcessing();
return YES;
}
-(NSApplicationPrintReply)application: (NSApplication *) app printFiles:(NSArray *)files withSettings: (NSDictionary *)printSettings showPrintPanels:(BOOL)bShowPrintPanels
@@ -305,6 +311,8 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
}
const ApplicationEvent* pAppEvent = new ApplicationEvent(ApplicationEvent::Type::Print, aFileList);
AquaSalInstance::aAppEventList.push_back( pAppEvent );
AquaSalInstance *pInst = GetSalData()->mpInstance;
pInst->TriggerUserEventProcessing();
// we have no back channel here, we have to assume success
// correct handling would be NSPrintingReplyLater and then send [app replyToOpenOrPrint]
return NSPrintingSuccess;