Guest User

Untitled

a guest
Jan 21st, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. Wow. This is amazing. So the purpose here is to merge the Xt loop with
  2. the GTK loop. We don't want to poll the input sources, but apparently
  3. there's no way to avoid it. So instead disable the poll when there are
  4. no input sources attached to Xt. But you can't figure that out.
  5.  
  6. Somewhere in this struct, we know there is a field for how many
  7. input sources there are, but depending on compiler flags, etc., we
  8. don't know where they are. So we pick a range of offsets it may be
  9. in and start probing: before there are any input sources registered
  10. (I don't think it actually guarantees this), we add one to
  11. /dev/null. Now gather all offsets of shorts which contain a 1. Now
  12. add another one and filter the list down to all the ones that have
  13. gone up to 2. Repeat this up to 4. If we are down to one offset,
  14. save that offset and check there for the input count. Otherwise fall
  15. back to always polling.
Add Comment
Please, Sign In to add comment