squash
This commit is contained in:
21
bar/services/wlr/event_loop.py
Normal file
21
bar/services/wlr/event_loop.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from fabric.core.service import Service, Property
|
||||
from pywayland.client import Display
|
||||
from gi.repository import GLib
|
||||
|
||||
|
||||
class WaylandEventLoopService(Service):
|
||||
@Property(object, "readable", "display")
|
||||
def display_property(self):
|
||||
return self._display
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
self._display = Display()
|
||||
self._display.connect()
|
||||
|
||||
self.thread = GLib.Thread.new("wayland-loop", self._loop)
|
||||
|
||||
def _loop(self):
|
||||
while True:
|
||||
self._display.dispatch(block=True)
|
||||
print("DISPATCHING...")
|
||||
Reference in New Issue
Block a user