summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2015-02-24 15:56:42 +0100
committerAndras Timar <andras.timar@collabora.com>2015-02-24 22:38:18 +0100
commitb0760a5732b70c42bfdc370a7a019403c2643a8d (patch)
tree2074efc2454714996d504229b2c5252d4577fdee
parent6e9d351bae650e8fbf7f397a6bc6747c731e291b (diff)
dump ugly hack working around an ancient libxcb bug (tdf#89141)
According to the X protocol log in the bugreport, this timed function sometimes does time out, in which case the timestamp becomes 0, which as user timestamp is interpreted by window managers as "do not focus", which is indeed stupid to ask for just because a call timed out. Especially given that this is broken in principle, as the event is bound to come (barring the more than 5 years old libxcb bug, which must have been such a lame bug that it probably shouldn't even have been worked around, and definitely not unconditionally and permanently). Change-Id: I4d122ea038c0c56b1fda590df13bf119d746fd0a
-rw-r--r--vcl/unx/generic/app/saldisp.cxx9
1 files changed, 1 insertions, 8 deletions
diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx
index 73c7b1fd4c5e..96cbfa143133 100644
--- a/vcl/unx/generic/app/saldisp.cxx
+++ b/vcl/unx/generic/app/saldisp.cxx
@@ -2309,14 +2309,7 @@ XLIB_Time SalDisplay::GetLastUserEventTime( bool i_bAlwaysReget ) const
Atom nAtom = getWMAdaptor()->getAtom( WMAdaptor::SAL_GETTIMEEVENT );
XChangeProperty( GetDisplay(), GetDrawable( GetDefaultXScreen() ),
nAtom, nAtom, 8, PropModeReplace, &c, 1 );
- XFlush( GetDisplay() );
-
- if( ! XIfEventWithTimeout( &aEvent, (XPointer)this, timestamp_predicate ) )
- {
- // this should not happen at all; still sometimes it happens
- aEvent.xproperty.time = CurrentTime;
- }
-
+ XIfEvent( GetDisplay(), &aEvent, timestamp_predicate, reinterpret_cast<XPointer>(const_cast<SalDisplay *>(this)));
m_nLastUserEventTime = aEvent.xproperty.time;
}
return m_nLastUserEventTime;