no-dbus-1.5_p20230109.patch 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. diff --git a/Screenkey/screenkey.py b/Screenkey/screenkey.py
  2. index 20dc372..5a161c8 100644
  3. --- a/Screenkey/screenkey.py
  4. +++ b/Screenkey/screenkey.py
  5. @@ -1036,44 +1036,8 @@ class Screenkey(Gtk.Window):
  6. def start_lockscreen_detection(self):
  7. from re import match
  8. from threading import Thread
  9. - from dbus import SessionBus
  10. - from dbus.mainloop.glib import DBusGMainLoop
  11. -
  12. - def filter_bus_message(bus, message):
  13. - message_member = message.get_member()
  14. -
  15. - if not self.enabled or message_member != "ActiveChanged":
  16. - return
  17. -
  18. - args_list = message.get_args_list()
  19. - if args_list[0]:
  20. - self.labelmngr.stop()
  21. - self.logger.debug("Lock Screen; Screenkey disabled.")
  22. - else:
  23. - self.restart_labelmanager()
  24. - self.logger.debug("Unlock Screen; Screenkey enabled.")
  25. def lockscreen_detection_loop():
  26. - DBusGMainLoop(set_as_default=True)
  27. - session_bus = SessionBus()
  28. -
  29. - signal_interface = None
  30. -
  31. - for dbus_string in session_bus.list_names():
  32. - bus_name = str(dbus_string)
  33. - if match(r"org\.(\w+)\.ScreenSaver", bus_name):
  34. - signal_interface = bus_name
  35. - self.logger.debug("DBUS signal interface found: \""+signal_interface+"\" ; password should not show when unlocking the screen.")
  36. - break
  37. -
  38. - if not signal_interface:
  39. - self.logger.debug("ScreenSaver DBUS signal interface not found; beware: password may show when unlocking the screen!")
  40. - del(session_bus)
  41. - DBusGMainLoop(set_as_default=False)
  42. - return
  43. -
  44. - session_bus.add_match_string("type='signal',interface='"+signal_interface+"'")
  45. - session_bus.add_message_filter(filter_bus_message)
  46. mainloop = GLib.MainLoop()
  47. mainloop.run()