summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-04-27 14:34:00 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-04-28 21:15:30 +0100
commit06d8afc2292c66738b460d7fd8324fc53721d949 (patch)
treea6c02abea748a2933a33807191cf719859e3c83e
parented305e96bd098fad973d6f85b4efe7ac444bc16d (diff)
Remove stuff that doesn't make sense since AnyInput change
Resolves: fdo#48011 writer idle-callbacks are halting when events pending commit id: 658954e8b50fc264428402dc5a95b0d6f690d191 which isn't to pretend that its definitely the *right* fix Change-Id: I228cf86b8e5eb0e4918c31e853a8d567831ce5e2
-rw-r--r--vcl/inc/unx/gtk/gtkinst.hxx3
-rw-r--r--vcl/unx/gtk/app/gtkinst.cxx131
2 files changed, 26 insertions, 108 deletions
diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx
index 331bcff884c3..89743ca85ffd 100644
--- a/vcl/inc/unx/gtk/gtkinst.hxx
+++ b/vcl/inc/unx/gtk/gtkinst.hxx
@@ -147,9 +147,6 @@ public:
std::vector<GtkSalTimer *> m_aTimers;
bool IsTimerExpired();
- // count of in-flight un-dispatched gdk events of a given input type
- sal_uInt32 m_nAnyInput[16];
- void resetEvents();
mutable boost::shared_ptr<vcl::unx::GtkPrintWrapper> m_pPrintWrapper;
};
diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx
index c78de14b9fba..845e2fc0965a 100644
--- a/vcl/unx/gtk/app/gtkinst.cxx
+++ b/vcl/unx/gtk/app/gtkinst.cxx
@@ -203,107 +203,36 @@ extern "C"
}
}
-// Handling the event queue
-
-void GtkInstance::resetEvents()
-{
- memset( m_nAnyInput, 0, sizeof( m_nAnyInput ) );
-}
-
-void GtkInstance::addEvent( sal_uInt16 nMask )
-{
- sal_uInt16 nShift = 1;
- for (int i = 0; i < 16; i++) {
- if( nMask & nShift )
- m_nAnyInput[i]++;
- nShift <<= 1;
- }
-}
-
-void GtkInstance::subtractEvent( sal_uInt16 nMask )
+#if GTK_CHECK_VERSION(3,0,0)
+static sal_uInt16 categorizeEvent(const GdkEvent *pEvent)
{
- sal_uInt16 nShift = 1;
- for (int i = 0; i < 16; i++) {
- if( nMask & nShift && m_nAnyInput[i] > 0 )
- m_nAnyInput[i]--;
- nShift <<= 1;
- }
-}
-
-extern "C" {
- // We catch events as they pop out of X and into gdk
- static GdkFilterReturn _sal_gtk_instance_filter_fn (GdkXEvent *_xevent,
- GdkEvent *event,
- gpointer data)
- {
- (void)event;
- // FIXME: in theory this could be for non-X events but in reality it never is.
- XEvent *pXEvent = (XEvent *)_xevent;
- sal_uInt16 nType;
- switch( pXEvent->type ) {
- case ButtonPress:
- case ButtonRelease:
- case MotionNotify:
- case EnterNotify:
- case LeaveNotify:
- nType = VCL_INPUT_MOUSE;
- break;
- case XLIB_KeyPress:
- nType = VCL_INPUT_KEYBOARD;
- break;
- case Expose:
- case GraphicsExpose:
- case NoExpose:
- nType = VCL_INPUT_PAINT;
- break;
- default:
- nType = VCL_INPUT_OTHER;
- break;
- }
- ((GtkInstance *)data)->addEvent( nType );
-
- return GDK_FILTER_CONTINUE;
- }
-
- static sal_uInt16 categorizeEvent(const GdkEvent *pEvent)
+ sal_uInt16 nType = 0;
+ switch( pEvent->type )
{
- sal_uInt16 nType = 0;
- switch( pEvent->type )
- {
- case GDK_MOTION_NOTIFY:
- case GDK_BUTTON_PRESS:
- case GDK_2BUTTON_PRESS:
- case GDK_3BUTTON_PRESS:
- case GDK_BUTTON_RELEASE:
- case GDK_ENTER_NOTIFY:
- case GDK_LEAVE_NOTIFY:
- case GDK_SCROLL:
- nType = VCL_INPUT_MOUSE;
- break;
- case GDK_KEY_PRESS:
- case GDK_KEY_RELEASE:
- nType = VCL_INPUT_KEYBOARD;
- break;
- case GDK_EXPOSE:
- nType = VCL_INPUT_PAINT;
- break;
- default:
- nType = VCL_INPUT_OTHER;
- break;
- }
- return nType;
- }
-
-
- // And then again as they pop out of gdk and into gtk+
-
- static void _sal_gtk_event_handler_fn (GdkEvent *pEvent, gpointer data)
- {
- sal_uInt16 nType = categorizeEvent(pEvent);
- ((GtkInstance *)data)->subtractEvent( nType );
- gtk_main_do_event( pEvent );
+ case GDK_MOTION_NOTIFY:
+ case GDK_BUTTON_PRESS:
+ case GDK_2BUTTON_PRESS:
+ case GDK_3BUTTON_PRESS:
+ case GDK_BUTTON_RELEASE:
+ case GDK_ENTER_NOTIFY:
+ case GDK_LEAVE_NOTIFY:
+ case GDK_SCROLL:
+ nType = VCL_INPUT_MOUSE;
+ break;
+ case GDK_KEY_PRESS:
+ case GDK_KEY_RELEASE:
+ nType = VCL_INPUT_KEYBOARD;
+ break;
+ case GDK_EXPOSE:
+ nType = VCL_INPUT_PAINT;
+ break;
+ default:
+ nType = VCL_INPUT_OTHER;
+ break;
}
+ return nType;
}
+#endif
GtkInstance::GtkInstance( SalYieldMutex* pMutex )
#if GTK_CHECK_VERSION(3,0,0)
@@ -312,21 +241,16 @@ GtkInstance::GtkInstance( SalYieldMutex* pMutex )
: X11SalInstance( pMutex )
#endif
{
- resetEvents();
}
// This has to happen after gtk_init has been called by saldata.cxx's
// Init or our handlers just get clobbered.
void GtkInstance::Init()
{
- gdk_window_add_filter( NULL, _sal_gtk_instance_filter_fn, this );
- gdk_event_handler_set( _sal_gtk_event_handler_fn, this, NULL );
}
GtkInstance::~GtkInstance()
{
- gdk_event_handler_set( (GdkEventFunc)gtk_main_do_event, NULL, NULL );
- gdk_window_remove_filter( NULL, _sal_gtk_instance_filter_fn, this );
while( !m_aTimers.empty() )
delete *m_aTimers.begin();
DeInitAtkBridge();
@@ -612,9 +536,6 @@ void GtkInstance::RemoveTimer (SalTimer *pTimer)
void GtkInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
{
GetGtkSalData()->Yield( bWait, bHandleAllCurrentEvents );
-
- if( !gdk_events_pending() )
- resetEvents();
}
bool GtkInstance::IsTimerExpired()