removed redundant injection stop

This commit is contained in:
sezanzeb 2020-11-19 01:45:31 +01:00 committed by sezanzeb
parent 07660bf8a3
commit db0876373f
2 changed files with 3 additions and 6 deletions

View File

@ -58,10 +58,10 @@ if __name__ == '__main__':
atexit.register(stop_injecting)
if getpass.getuser() != 'root' and 'unittest' not in sys.modules.keys():
logger.error('Needs to run with sudo')
logger.warn('Without sudo, your devices may not be visible')
ErrorDialog(
'Error',
'Key Mapper needs administrator privileges to run properly.'
'Warning',
'Without sudo, your devices may not be visible'
)
Gtk.main()

View File

@ -124,8 +124,6 @@ class Window:
def on_close(self, *_):
"""Safely close the application."""
if self.keycode_reader is not None:
self.keycode_reader.stop_injecting()
GLib.source_remove(self.timeout)
Gtk.main_quit()
@ -262,7 +260,6 @@ class Window:
f'Could not grab device "{self.selected_device}"'
)
def on_select_device(self, dropdown):
"""List all presets, create one if none exist yet."""
if dropdown.get_active_id() == self.selected_device: