summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/window_wayland.c16
-rw-r--r--src/window_win32.c2
2 files changed, 10 insertions, 8 deletions
diff --git a/src/window_wayland.c b/src/window_wayland.c
index 4591827..68a0444 100644
--- a/src/window_wayland.c
+++ b/src/window_wayland.c
@@ -450,8 +450,8 @@ static void pointer_button(void *data, struct wl_pointer *pointer,
#else
(void)serial;
#endif
- u8 mapped_state = (state == WL_POINTER_BUTTON_STATE_PRESSED) ? STELA_BUTTON_PRESSED : STELA_BUTTON_RELEASED;
u8 mapped_button = 1 << (button - MOUSE1);
+ u8 mapped_state = (state == WL_POINTER_BUTTON_STATE_PRESSED) ? STELA_BUTTON_PRESSED : STELA_BUTTON_RELEASED;
stl_window_send_mouse_button_event(&wl->w, mapped_state, mapped_button);
}
@@ -564,11 +564,12 @@ static void keyboard_enter(void *data, struct wl_keyboard *keyboard,
(void)keyboard;
(void)serial;
(void)surface;
- void *key;
- wl_array_for_each(key, keys) {
- u16 mapped_key = global.keycodes[*(u32 *)key];
- u32 mod = stl_key_to_mod(mapped_key);
- if (mod == STELA_MOD_NONE) continue;
+ void *item;
+ wl_array_for_each(item, keys) {
+ u32 key = *(u32 *)item;
+ al_assert(key < STELA_WAYLAND_KEY_MAX);
+ u16 mapped_key = global.keycodes[key];
+ if (stl_key_to_mod(mapped_key) == STELA_MOD_NONE) continue;
stl_window_send_key_event(&wl->w, STELA_BUTTON_PRESSED, mapped_key);
}
}
@@ -590,8 +591,9 @@ static void keyboard_key(void *data, struct wl_keyboard *keyboard,
(void)keyboard;
(void)serial;
(void)time;
- u8 mapped_state = (state == WL_KEYBOARD_KEY_STATE_PRESSED) ? STELA_BUTTON_PRESSED : STELA_BUTTON_RELEASED;
+ al_assert(key < STELA_WAYLAND_KEY_MAX);
u16 mapped_key = global.keycodes[key];
+ u8 mapped_state = (state == WL_KEYBOARD_KEY_STATE_PRESSED) ? STELA_BUTTON_PRESSED : STELA_BUTTON_RELEASED;
stl_window_send_key_immediate_event(&wl->w, mapped_state, mapped_key);
stl_window_send_key_event(&wl->w, mapped_state, mapped_key);
}
diff --git a/src/window_win32.c b/src/window_win32.c
index 791bacf..46835e2 100644
--- a/src/window_win32.c
+++ b/src/window_win32.c
@@ -278,7 +278,7 @@ bool stl_global_init(bool skip_graphics)
HMODULE NTModule = LoadLibraryA("ntdll.dll");
if (!NTModule) return false;
if (GetProcAddress(NTModule, "wine_get_version") != NULL) {
- log_info("Wine detected.");
+ log_info("Wine detected; using Windows-incompatible window move method.");
Global.IsWine = TRUE;
} else {
Global.IsWine = FALSE;