summaryrefslogtreecommitdiff
path: root/vcl/inc/unx
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2017-09-04 17:40:13 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2017-09-28 17:48:37 +0200
commite310c00709ed4fe0788aeff5142e3581d8b4d319 (patch)
treeb85827742e4a93a57150b5d8d254ea85a6265379 /vcl/inc/unx
parentdea1b649765262b2e8beac88b0977d5dead98953 (diff)
Unify SalUserEvent handling
Merges the various SalUserEvent structs and their handling into a single class. This includes a common SalFrame* hash map, as all backends use such a map to verify alive SalFrames. It also reverts the "FIXME: lousy workaround" for i#90083, which was part of commit d6f7c94e5c27ba02ff5c3229760c9808cc9b5bea. At least on my current OSX box application based window switching "just works" "out of the box", even without the code. Change-Id: I188b567e44fd79c162b2d9cabbd771d1f66c7dc4 Reviewed-on: https://gerrit.libreoffice.org/42845 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/inc/unx')
-rw-r--r--vcl/inc/unx/gendisp.hxx32
-rw-r--r--vcl/inc/unx/gtk/gtkdata.hxx8
-rw-r--r--vcl/inc/unx/saldisp.hxx8
3 files changed, 15 insertions, 33 deletions
diff --git a/vcl/inc/unx/gendisp.hxx b/vcl/inc/unx/gendisp.hxx
index 64564237a232..5c8f5113c300 100644
--- a/vcl/inc/unx/gendisp.hxx
+++ b/vcl/inc/unx/gendisp.hxx
@@ -27,45 +27,27 @@
#include <vcl/dllapi.h>
#include <list>
#include <vector>
+#include <salusereventlist.hxx>
class SalFrame;
-class VCL_DLLPUBLIC SalGenericDisplay
+class VCL_DLLPUBLIC SalGenericDisplay : public SalUserEventList
{
- mutable osl::Mutex m_aEventGuard;
- struct SalUserEvent
- {
- SalFrame* m_pFrame;
- void* m_pData;
- SalEvent m_nEvent;
-
- SalUserEvent( SalFrame* pFrame, void* pData,
- SalEvent nEvent )
- : m_pFrame( pFrame ),
- m_pData( pData ),
- m_nEvent( nEvent )
- {}
- };
- std::list< SalUserEvent > m_aUserEvents;
protected:
SalFrame* m_pCapture;
- std::list<SalFrame*> m_aFrames;
+
+ virtual void ProcessEvent( SalUserEvent aEvent ) override;
+
public:
SalGenericDisplay();
- virtual ~SalGenericDisplay();
-
- osl::Mutex& getEventGuardMutex() { return m_aEventGuard; }
+ virtual ~SalGenericDisplay() override;
void registerFrame( SalFrame* pFrame );
virtual void deregisterFrame( SalFrame* pFrame );
void emitDisplayChanged();
- // Event handling
- virtual void PostUserEvent() = 0;
-
void SendInternalEvent( SalFrame* pFrame, void* pData, SalEvent nEvent = SalEvent::UserEvent );
- void CancelInternalEvent( SalFrame const * pFrame, void const * pData, SalEvent nEvent );
+ void CancelInternalEvent( SalFrame* pFrame, void* pData, SalEvent nEvent );
bool DispatchInternalEvent();
- bool HasUserEvents() const;
bool MouseCaptured( const SalFrame *pFrameData ) const
{ return m_pCapture == pFrameData; }
diff --git a/vcl/inc/unx/gtk/gtkdata.hxx b/vcl/inc/unx/gtk/gtkdata.hxx
index 4f4d520fc141..01b5c46b8dca 100644
--- a/vcl/inc/unx/gtk/gtkdata.hxx
+++ b/vcl/inc/unx/gtk/gtkdata.hxx
@@ -117,9 +117,9 @@ public:
static void initNWF();
static void deInitNWF();
- static gboolean userEventFn( gpointer data );
+ void TriggerUserEventProcessing();
+ void TriggerAllUserEventsProcessed();
- void PostUserEvent();
bool Yield( bool bWait, bool bHandleAllCurrentEvents );
inline GdkDisplay *GetGdkDisplay();
@@ -146,6 +146,7 @@ class GtkSalDisplay : public SalDisplay
GdkCursor* getFromXBM( const unsigned char *pBitmap, const unsigned char *pMask,
int nWidth, int nHeight, int nXHot, int nYHot );
+
public:
GtkSalDisplay( GdkDisplay* pDisplay );
virtual ~GtkSalDisplay() override;
@@ -180,7 +181,8 @@ public:
void screenSizeChanged( GdkScreen const * );
void monitorsChanged( GdkScreen const * );
- virtual void PostUserEvent() override;
+ virtual void TriggerUserEventProcessing() override;
+ virtual void TriggerAllUserEventsProcessed() override;
#if !GTK_CHECK_VERSION(3,0,0)
virtual bool Dispatch( XEvent *pEvent ) override;
diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx
index 0ec4e10e7d65..8f96e03630b0 100644
--- a/vcl/inc/unx/saldisp.hxx
+++ b/vcl/inc/unx/saldisp.hxx
@@ -168,7 +168,7 @@ public:
virtual bool Yield( bool bWait, bool bHandleAllCurrentEvents );
virtual void Wakeup();
- virtual void PostUserEvent();
+ void TriggerUserEventProcessing();
virtual void Insert( int fd, void* data,
YieldFunc pending,
@@ -371,12 +371,10 @@ public:
{ return getDataForScreen( nXScreen ).m_aRoot; }
unsigned int GetXScreenCount() const { return m_aScreens.size(); }
- const std::list< SalFrame* >& getFrames() const { return m_aFrames; }
+ const SalFrameSet& getFrames() const { return m_aFrames; }
bool IsNumLockFromXS() const { return bNumLockFromXS_; }
std::list< SalObject* >& getSalObjects() { return m_aSalObjects; }
-
- virtual void PostUserEvent() override = 0;
};
inline Display *SalColormap::GetXDisplay() const
@@ -390,7 +388,7 @@ public:
virtual bool Dispatch( XEvent *pEvent ) override;
virtual void Yield();
- virtual void PostUserEvent() override;
+ virtual void TriggerUserEventProcessing() override;
bool IsEvent();
void SetupInput();