Hanging on connection to display
<p>Consider the following code:</p>

<pre><code>#!/usr/bin/env python 

from Xlib.display import Display
import os

def main():
        disp = Display() # connect to display
        while True:
                print("1")
                event = disp.next_event()
                print("2")
                if event.type == Xlib.protocol.event.KeyPress:
                        print("keypress!")

if __name__ == '__main__':
        main()
</code></pre>

<p>This code outputs <code>1</code> but does not output <code>2</code>. It seems to be hanging on the display connection. Why might that be? Thank you.</p>
