vcl/inc/osx/salinst.h |6 -
vcl/inc/win/saldata.hxx |4 -
vcl/inc/win/saltimer.h|2
vcl/osx/vclnsapp.mm |2
vcl/win/app/salinst.cxx | 144 --
vcl/win/window/salobj.cxx |6 -
6 files changed, 73 insertions(+), 91 deletions(-)
New commits:
commit 8ba60ca42d4d1873b8cd85c5d3b5ed2f0e19df60
Author: Jan-Marek Glogowski
Date: Mon Oct 16 17:04:24 2017 +0200
WIN message handling cleanup and refactoring
Replace a lot of duplicated case code with macros.
Some minor constifications of function parameters.
I restrained from shorten the SAL_MSG_* via preprocessor concat,
so a grep will still find the whole names.
Change-Id: If1f2477fc8817b4ae7816e807154e35004bb4da9
Reviewed-on: https://gerrit.libreoffice.org/43531
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski
diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h
index 01e50af77b99..a80af4fb5ee7 100644
--- a/vcl/inc/osx/salinst.h
+++ b/vcl/inc/osx/salinst.h
@@ -63,6 +63,8 @@ public:
class AquaSalInstance : public SalInstance, public SalUserEventList
{
+friend class AquaSalFrame;
+
bool RunInMainYield( bool bHandleAllCurrentEvents );
virtual void TriggerUserEventProcessing() override;
@@ -81,7 +83,6 @@ public:
static std::list aAppEventList;
-public:
AquaSalInstance();
virtual ~AquaSalInstance() override;
@@ -136,9 +137,6 @@ public:
// this is needed to avoid duplicate open events through a) command line
and b) NSApp's openFile
static bool isOnCommandLine( const OUString& );
-public:
-friend class AquaSalFrame;
-
void delayedSettingsChanged( bool bInvalidate );
// Is this the NSAppThread?
diff --git a/vcl/inc/win/saldata.hxx b/vcl/inc/win/saldata.hxx
index 0f3e05b8f31a..659fd68f7dda 100644
--- a/vcl/inc/win/saldata.hxx
+++ b/vcl/inc/win/saldata.hxx
@@ -180,8 +180,8 @@ bool ImplHandleSalObjSysCharMsg( HWND hWnd, WPARAM wParam,
LPARAM lParam );
bool ImplHandleGlobalMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam,
LRESULT& rlResult );
WinSalObject* ImplFindSalObject( HWND hWndChild );
-bool ImplSalPreDispatchMsg( MSG* pMsg );
-void ImplSalPostDispatchMsg( MSG* pMsg, LRESULT nDispatchResult );
+bool ImplSalPreDispatchMsg( const MSG* pMsg );
+void ImplSalPostDispatchMsg( const MSG* pMsg );
void ImplSalLogFontToFontW( HDC hDC, const LOGFONTW& rLogFont, vcl::Font&
rFont );
diff --git a/vcl/inc/win/saltimer.h b/vcl/inc/win/saltimer.h
index b7d1a1e0d0f1..61d284d82ddb 100644
--- a/vcl/inc/win/saltimer.h
+++ b/vcl/inc/win/saltimer.h
@@ -25,7 +25,7 @@
class WinSalTimer final : public SalTimer, protected VersionedEvent
{
// for access to Impl* functions
-friend LRESULT CALLBACK SalComWndProc( HWND, UINT nMsg, WPARAM wParam,
LPARAM lParam, int& rDef );
+friend LRESULT CALLBACK SalComWndProc( HWND, UINT nMsg, WPARAM wParam,
LPARAM lParam, bool& rDef );
// for access to GetNextVersionedEvent
friend void CALLBACK SalTimerProc( PVOID data, BOOLEAN );
// for access to ImplHandleElapsedTimer
diff --git a/vcl/osx/vclnsapp.mm b/vcl/osx/vclnsapp.mm
index 4dd8ceac8169..23b22c360eeb 100644
--- a/vcl/osx/vclnsapp.mm
+++ b/vcl/osx/vclnsapp.mm
@@ -66,7 +66,7 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH
NSEvent* pEvent = [NSEvent otherEventWithType: NSApplicationDefined
location: NSZeroPoint
modifierFlags: 0
- timestamp: 0
+ timestamp: [[NSProcessInfo processInfo]
systemUptime]
windowNumber: 0
context: nil
subtype: AquaSalInstance::AppExecuteSVMain
diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx
index 693411a0583c..68ad7deb994d 100644
--- a/vcl/win/app/salinst.cxx
+++ b/vcl/win/app/salinst.cxx
@@ -459,14 +459,14 @@ void WinSalInstance::AcquireYieldMutex( sal_uInt32 nCount
)
mpSalYieldMutex->acquire( nCount );
}
-static LRESULT ImplSalDispatchMessage( MSG* pMsg )
+static LRESULT ImplSalDispatchMessage( const MSG* pMsg )
{
SalData* pSalData = GetSalData();
if ( pSalData->mpFirstObject && ImplSalPreDispatchMsg( pMsg ) )
return 0;
LRESULT lResult = DispatchMessageW( pMsg );
if ( pSalData->mpFirstObject )
-ImplSalPostDispatchMsg( pMsg, lResult );
+ImplSalPostDispatchMsg( pMsg );
return lResult;
}
@@ -569,124 +569,108 @@ bool WinSalInstance::DoYield(bool bWait, bool
bHandleAllCurrentEvents)
return bDidWork;
}
-LRESULT CALLBACK SalComWndProc( HWND, UINT nMsg, WPARAM wParam, LPARAM lParam,
int& rDef )
+#define CASE_NOYIELDLOCK( salmsg, function ) \
+case salmsg: \
+assert( !pInst->mbNoYieldLock ); \
+pInst->mbNoYieldLock = true; \
+function; \
+