Skip to content

Commit 277aacc

Browse files
RAOFAlanGriffiths
authored andcommitted
(#3379 #3307) Fix accidentally consuming input events on alt key up (#3382)
## What's new? - We were erroneously eating the event on complete, which made the final "up" on an alt some times not complete 🤦
1 parent c46c386 commit 277aacc

3 files changed

Lines changed: 2 additions & 28 deletions

File tree

src/miral/minimal_window_manager.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,8 @@ bool miral::MinimalWindowManager::handle_keyboard_event(MirKeyboardEvent const*
197197
switch (mir_keyboard_event_scan_code(event))
198198
{
199199
case KEY_LEFTALT:
200-
if (self->application_selector.complete() != nullptr)
201-
return true;
202-
break;
200+
self->application_selector.complete();
201+
[[fallthrough]];
203202
default:;
204203
}
205204
}

src/server/frontend_wayland/keyboard_helper.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "mir/events/keyboard_event.h"
2222
#include "mir/input/seat.h"
2323
#include "mir/fatal.h"
24-
#include "mir/log.h"
2524

2625
#include <cstring> // memcpy
2726
#include <unordered_set>
@@ -62,7 +61,6 @@ void mf::KeyboardHelper::handle_event(std::shared_ptr<MirEvent const> const& eve
6261
switch (mir_input_event_get_type(mir_event_get_input_event(event.get())))
6362
{
6463
case mir_input_event_type_keyboard_resync:
65-
mir::log_debug("mir_input_event_type_keyboard_resync is causing modifiers to be refreshed");
6664
refresh_modifiers();
6765
break;
6866

@@ -150,20 +148,6 @@ void mf::KeyboardHelper::set_keymap(std::shared_ptr<mi::Keymap> const& new_keyma
150148

151149
void mf::KeyboardHelper::set_modifiers(MirXkbModifiers const& new_modifiers)
152150
{
153-
mir::log_debug(
154-
"Modifiers are being set from: depressed=0x%08x, latched=0x%08x, locked=0x%08x, effective_layout=0x%08x",
155-
modifiers.depressed,
156-
modifiers.latched,
157-
modifiers.locked,
158-
modifiers.effective_layout);
159-
160-
mir::log_debug(
161-
"Modifiers are being set to: depressed=0x%08x, latched=0x%08x, locked=0x%08x, effective_layout=0x%08x",
162-
new_modifiers.depressed,
163-
new_modifiers.latched,
164-
new_modifiers.locked,
165-
new_modifiers.effective_layout);
166-
167151
if (new_modifiers != modifiers)
168152
{
169153
modifiers = new_modifiers;

src/server/frontend_wayland/wl_keyboard.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ void mf::WlKeyboard::focus_on(WlSurface* surface)
8383
auto const serial = client->next_serial(nullptr);
8484
send_enter_event(serial, surface->raw_resource(), &key_state);
8585
wl_array_release(&key_state);
86-
mir::log_debug("Surface (id=%u) has been focused and is refreshing its modifiers",
87-
wl_resource_get_id(surface->raw_resource()));
8886
helper->refresh_modifiers();
8987
}
9088

@@ -112,13 +110,6 @@ void mf::WlKeyboard::send_key(std::shared_ptr<MirKeyboardEvent const> const& eve
112110

113111
void mf::WlKeyboard::send_modifiers(MirXkbModifiers const& modifiers)
114112
{
115-
mir::log_debug(
116-
"Sending modifiers event: depressed=0x%08x, latched=0x%08x, locked=0x%08x, effective_layout=0x%08x",
117-
modifiers.depressed,
118-
modifiers.latched,
119-
modifiers.locked,
120-
modifiers.effective_layout);
121-
122113
auto const serial = client->next_serial(nullptr);
123114
send_modifiers_event(
124115
serial,

0 commit comments

Comments
 (0)