Florian Bösch
unread,Aug 12, 2009, 12:27:28 PM8/12/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pyglet-users
Posting this here since issues/patches seem to be dropped to the
floor.
I've noticed a while ago that the new xlib select devices are queried
poorly when the app becomes idle. I've also noticed just now that when
quering a tablet for values, and there's more then 3 fields queried,
that the input update performance becomes extremely sluggish (as in
pen moving and touching). I propose this patch which solves all of
these issues for me:
Index: pyglet/app/xlib.py
===================================================================
--- pyglet/app/xlib.py (revision 2449)
+++ pyglet/app/xlib.py (working copy)
@@ -100,24 +100,8 @@
self._notification_device.set()
def step(self, timeout=None):
- pending_devices = []
-
- # Check for already pending events
- for device in self._select_devices:
- if device.poll():
- pending_devices.append(device)
-
- # If nothing was immediately pending, block until there's
activity
- # on a device.
- if not pending_devices and (timeout is None or not timeout):
- iwtd = self._select_devices
- pending_devices, _, _ = select.select(iwtd, (), (),
timeout)
-
- if not pending_devices:
- return False
-
- # Dispatch activity on matching devices
- for device in pending_devices:
+ pending, _, _, = select.select(self._select_devices, (), (),
timeout)
+ for device in pending:
device.select()