diff --git a/keymapper/gui/row.py b/keymapper/gui/row.py index dce0bc33..dd8c3e20 100644 --- a/keymapper/gui/row.py +++ b/keymapper/gui/row.py @@ -292,7 +292,6 @@ class Row(Gtk.ListBoxRow): self.show_click_here() self.keycode_input.set_active(False) self._state = IDLE - reader.clear() self.window.save_preset() def set_keycode_input_label(self, label): @@ -305,6 +304,7 @@ class Row(Gtk.ListBoxRow): label.set_line_wrap_mode(2) label.set_max_width_chars(13) label.set_justify(Gtk.Justification.CENTER) + self.keycode_input.set_opacity(1) def put_together(self, character): """Create all child GTK widgets and connect their signals.""" diff --git a/tests/testcases/test_integration.py b/tests/testcases/test_integration.py index 2d35b850..b607adcb 100644 --- a/tests/testcases/test_integration.py +++ b/tests/testcases/test_integration.py @@ -554,24 +554,15 @@ class TestIntegration(unittest.TestCase): def test_clears_unreleased_on_focus_change(self): ev_1 = Key(EV_KEY, 41, 1) - rows = self.get_rows() - row = rows[-1] - - # focused - self.window.window.set_focus(row.keycode_input) + # focus + self.window.window.set_focus(self.get_rows()[0].keycode_input) send_event_to_reader(new_event(*ev_1.keys[0])) reader.read() self.assertEqual(reader.get_unreleased_keys(), ev_1) - # unfocused - self.window.window.set_focus(None) - self.assertEqual(reader.get_unreleased_keys(), None) - send_event_to_reader(new_event(*ev_1.keys[0])) - reader.read() - self.assertEqual(reader.get_unreleased_keys(), ev_1) - - # focus back - self.window.window.set_focus(row.keycode_input) + # focus different row + self.window.add_empty() + self.window.window.set_focus(self.get_rows()[1].keycode_input) self.assertEqual(reader.get_unreleased_keys(), None) def test_rows(self): diff --git a/tests/testcases/test_reader.py b/tests/testcases/test_reader.py index 72899a5a..d25c8de1 100644 --- a/tests/testcases/test_reader.py +++ b/tests/testcases/test_reader.py @@ -490,6 +490,7 @@ class TestReader(unittest.TestCase): reader.terminate() reader.clear() + time.sleep(EVENT_READ_TIMEOUT) # no new events arrive after terminating push_events('device 1', [new_event(EV_KEY, CODE_3, 1)])