diff options
| author | Federico Angelilli <code@fedang.net> | 2024-03-23 11:16:24 +0100 |
|---|---|---|
| committer | Federico Angelilli <code@fedang.net> | 2024-03-23 11:16:24 +0100 |
| commit | 46de28e9789618b2ea7af66c461f3f7db5ef0bd5 (patch) | |
| tree | 00a4493d538895b168ba9852a07319a71e553788 /src/connect.c | |
| parent | 12f20dd7cd742e0cf54543ea5a1642b911ed1ec6 (diff) | |
Implement initial hidpi scaling
Diffstat (limited to 'src/connect.c')
| -rw-r--r-- | src/connect.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/connect.c b/src/connect.c index 4b04ac4..79fd2b1 100644 --- a/src/connect.c +++ b/src/connect.c @@ -131,8 +131,12 @@ static bool button_action_find(State *state, GList *layouts, int x, int y) static void button_action(State *state, const char *event, int x, int y) { - log_debug("Checking %s event [x=%d, y=%d]", event, x, y); - if (!button_action_find(state, state->draw->layouts, x, y)) + double scale = window_get_scale(state->win); + int digital_x = x / scale; + int digital_y = y / scale; + + log_debug("Checking %s event [device_x=%d, device_y=%d, x=%d, y=%d]", event, x, y, digital_x, digital_y); + if (!button_action_find(state, state->draw->layouts, digital_x, digital_y)) log_debug("Ignoring %s", event); } |
