From 771f7cb8c3cd3cc92f586641c61b5d515cca2918 Mon Sep 17 00:00:00 2001 From: LunaDL <91587464+EnzoDLofi@users.noreply.github.com> Date: Sat, 28 Nov 2026 23:00:48 -0400 Subject: [PATCH] Feat: Adds Screen zoom buttons in DD side menu (#3361) --- app/src/main/cpp/waylandcomp/src/compositor.c | 123 ++++++++++- app/src/main/cpp/waylandcomp/src/vk_present.c | 209 +++++++++++++++++- app/src/main/cpp/waylandcomp/src/vk_present.h | 2 + .../cpp/waylandcomp/src/waylandcomp_jni.c | 10 + .../com/droiddeck/launcher/SessionActivity.kt | 30 +++ .../droiddeck/launcher/input/InputProfile.kt | 2 +- .../launcher/session/SessionService.kt | 1 + .../launcher/session/SessionState.kt | 3 + .../launcher/ui/InputBindingWidgets.kt | 2 + .../droiddeck/launcher/ui/SessionOverlay.kt | 42 ++++ .../launcher/wayland/WaylandCompositor.java | 1 + .../main/res/values-ar/input_zoom_strings.xml | 5 + app/src/main/res/values-ar/strings.xml | 2 + .../values-b+es+419/input_zoom_strings.xml | 5 + .../main/res/values-bg/input_zoom_strings.xml | 5 + app/src/main/res/values-bg/strings.xml | 2 + .../main/res/values-cs/input_zoom_strings.xml | 5 + app/src/main/res/values-cs/strings.xml | 2 + .../main/res/values-da/input_zoom_strings.xml | 5 + app/src/main/res/values-da/strings.xml | 2 + .../main/res/values-de/input_zoom_strings.xml | 5 + app/src/main/res/values-de/strings.xml | 2 + .../main/res/values-el/input_zoom_strings.xml | 5 + app/src/main/res/values-el/strings.xml | 2 + .../main/res/values-es/input_zoom_strings.xml | 5 + app/src/main/res/values-es/strings.xml | 2 + .../main/res/values-fi/input_zoom_strings.xml | 5 + app/src/main/res/values-fi/strings.xml | 2 + .../main/res/values-fr/input_zoom_strings.xml | 5 + app/src/main/res/values-fr/strings.xml | 2 + .../main/res/values-hi/input_zoom_strings.xml | 5 + app/src/main/res/values-hi/strings.xml | 2 + .../main/res/values-hu/input_zoom_strings.xml | 5 + app/src/main/res/values-hu/strings.xml | 2 + .../main/res/values-in/input_zoom_strings.xml | 5 + app/src/main/res/values-in/strings.xml | 2 + .../main/res/values-it/input_zoom_strings.xml | 5 + app/src/main/res/values-it/strings.xml | 2 + .../main/res/values-ja/input_zoom_strings.xml | 5 + app/src/main/res/values-ja/strings.xml | 2 + .../main/res/values-ko/input_zoom_strings.xml | 5 + app/src/main/res/values-ko/strings.xml | 2 + .../main/res/values-ms/input_zoom_strings.xml | 5 + app/src/main/res/values-ms/strings.xml | 2 + .../main/res/values-nb/input_zoom_strings.xml | 5 + app/src/main/res/values-nb/strings.xml | 2 + .../main/res/values-nl/input_zoom_strings.xml | 5 + app/src/main/res/values-nl/strings.xml | 2 + .../main/res/values-pl/input_zoom_strings.xml | 5 + app/src/main/res/values-pl/strings.xml | 2 + .../res/values-pt-rPT/input_zoom_strings.xml | 5 + app/src/main/res/values-pt-rPT/strings.xml | 2 + app/src/main/res/values-pt/input_strings.xml | 2 + app/src/main/res/values-pt/strings.xml | 2 + .../main/res/values-ro/input_zoom_strings.xml | 5 + app/src/main/res/values-ro/strings.xml | 2 + .../main/res/values-ru/input_zoom_strings.xml | 5 + app/src/main/res/values-ru/strings.xml | 2 + .../main/res/values-sv/input_zoom_strings.xml | 5 + app/src/main/res/values-sv/strings.xml | 2 + .../main/res/values-th/input_zoom_strings.xml | 5 + app/src/main/res/values-th/strings.xml | 2 + .../main/res/values-tr/input_zoom_strings.xml | 5 + app/src/main/res/values-tr/strings.xml | 2 + .../main/res/values-uk/input_zoom_strings.xml | 5 + app/src/main/res/values-uk/strings.xml | 2 + .../main/res/values-vi/input_zoom_strings.xml | 5 + app/src/main/res/values-vi/strings.xml | 2 + .../res/values-zh-rCN/input_zoom_strings.xml | 5 + .../res/values-zh-rHK/input_zoom_strings.xml | 5 + .../res/values-zh-rTW/input_zoom_strings.xml | 5 + app/src/main/res/values/input_strings.xml | 2 + app/src/main/res/values/strings.xml | 2 + .../launcher/input/InputProfilesTest.kt | 2 + tools/tests/pen_pointer_harness.c | 16 +- tools/tests/test_output_refresh.py | 3 + 76 files changed, 650 insertions(+), 13 deletions(-) create mode 100644 app/src/main/res/values-ar/input_zoom_strings.xml create mode 100644 app/src/main/res/values-b+es+419/input_zoom_strings.xml create mode 100644 app/src/main/res/values-bg/input_zoom_strings.xml create mode 100644 app/src/main/res/values-cs/input_zoom_strings.xml create mode 100644 app/src/main/res/values-da/input_zoom_strings.xml create mode 100644 app/src/main/res/values-de/input_zoom_strings.xml create mode 100644 app/src/main/res/values-el/input_zoom_strings.xml create mode 100644 app/src/main/res/values-es/input_zoom_strings.xml create mode 100644 app/src/main/res/values-fi/input_zoom_strings.xml create mode 100644 app/src/main/res/values-fr/input_zoom_strings.xml create mode 100644 app/src/main/res/values-hi/input_zoom_strings.xml create mode 100644 app/src/main/res/values-hu/input_zoom_strings.xml create mode 100644 app/src/main/res/values-in/input_zoom_strings.xml create mode 100644 app/src/main/res/values-it/input_zoom_strings.xml create mode 100644 app/src/main/res/values-ja/input_zoom_strings.xml create mode 100644 app/src/main/res/values-ko/input_zoom_strings.xml create mode 100644 app/src/main/res/values-ms/input_zoom_strings.xml create mode 100644 app/src/main/res/values-nb/input_zoom_strings.xml create mode 100644 app/src/main/res/values-nl/input_zoom_strings.xml create mode 100644 app/src/main/res/values-pl/input_zoom_strings.xml create mode 100644 app/src/main/res/values-pt-rPT/input_zoom_strings.xml create mode 100644 app/src/main/res/values-ro/input_zoom_strings.xml create mode 100644 app/src/main/res/values-ru/input_zoom_strings.xml create mode 100644 app/src/main/res/values-sv/input_zoom_strings.xml create mode 100644 app/src/main/res/values-th/input_zoom_strings.xml create mode 100644 app/src/main/res/values-tr/input_zoom_strings.xml create mode 100644 app/src/main/res/values-uk/input_zoom_strings.xml create mode 100644 app/src/main/res/values-vi/input_zoom_strings.xml create mode 100644 app/src/main/res/values-zh-rCN/input_zoom_strings.xml create mode 100644 app/src/main/res/values-zh-rHK/input_zoom_strings.xml create mode 100644 app/src/main/res/values-zh-rTW/input_zoom_strings.xml diff --git a/app/src/main/cpp/waylandcomp/src/compositor.c b/app/src/main/cpp/waylandcomp/src/compositor.c index 98b5746037..c9eceed111 100644 --- a/app/src/main/cpp/waylandcomp/src/compositor.c +++ b/app/src/main/cpp/waylandcomp/src/compositor.c @@ -696,6 +696,8 @@ static struct surface *g_key_target; static struct surface *g_ime_click; static int g_input_pipe[2] = {-1, -1}; struct input_msg { int type; int p1; int p2; int p3; int p4; }; +static atomic_int g_zoom_request_percent = 100; +static atomic_int g_zoom_request_pending = 0; struct surface; static void constraints_surface_gone(struct surface *s); @@ -3544,6 +3546,15 @@ static void pointer_input(double x, double y, int relative, uint32_t button, int if (k) confine_clamp(k, &x, &y); g_ptr_x = x; g_ptr_y = y; g_ptr_known = 1; + if (relative && !button && (dx != 0.0 || dy != 0.0)) { + int ow, oh; + double ox, oy; + vkp_output_size(&ow, &oh); + if (ow > 0 && oh > 0 && + vkp_scene_to_output(g_ptr_x, g_ptr_y, &ox, &oy) && + vkp_zoom_pan_cursor(ox, oy)) + schedule_render(); + } if (atomic_load(&g_cursor_composite)) schedule_render(); if (k) { target = k->surface; @@ -3612,15 +3623,38 @@ static void pointer_button(uint32_t button, int pressed) { } static void deliver_pointer(const struct input_msg *m) { + static int last_x, last_y, last_valid; int w, h, ow, oh; double x, y; + int moved = last_valid && (m->p2 != last_x || m->p3 != last_y); + last_x = m->p2; + last_y = m->p3; + last_valid = 1; scene_size(&w, &h); vkp_output_size(&ow, &oh); - if (ow <= 0 || oh <= 0 || - !vkp_output_to_scene((double)m->p2 * ow / INPUT_SPACE_W, (double)m->p3 * oh / INPUT_SPACE_H, &x, &y)) { + + if (ow <= 0 || oh <= 0) { x = (double)m->p2 * w / INPUT_SPACE_W; y = (double)m->p3 * h / INPUT_SPACE_H; + } else { + double ox = (double)m->p2 * ow / INPUT_SPACE_W; + double oy = (double)m->p3 * oh / INPUT_SPACE_H; + if (m->p1 == 1 && !pointer_locked_for_cursor() && + (moved || ox <= 0.0 || oy <= 0.0 || ox >= ow || oy >= oh) && + vkp_zoom_pan_cursor(ox, oy)) + schedule_render(); + if (!vkp_output_to_scene(ox, oy, &x, &y)) { + schedule_render(); + if (g_ptr_known) { + x = g_ptr_x; + y = g_ptr_y; + } else { + x = (double)m->p2 * w / INPUT_SPACE_W; + y = (double)m->p3 * h / INPUT_SPACE_H; + } + } } + if (x < 0) x = 0; if (y < 0) y = 0; if (x > w - 1) x = w - 1; @@ -3632,6 +3666,7 @@ static void input_output_to_scene(double px, double py, double *x, double *y) { int w, h, ow, oh; scene_size(&w, &h); vkp_output_size(&ow, &oh); + if (ow <= 0 || oh <= 0 || !vkp_output_to_scene(px * ow / INPUT_SPACE_W, py * oh / INPUT_SPACE_H, x, y)) { *x = px * w / INPUT_SPACE_W; @@ -3855,12 +3890,63 @@ static void touch_up(int id, double x, double y) { } static void deliver_touch(const struct input_msg *m) { + static int last_x[MAX_TOUCH_POINTS], last_y[MAX_TOUCH_POINTS]; + static int pan_start_x[MAX_TOUCH_POINTS], pan_start_y[MAX_TOUCH_POINTS]; + static unsigned char last_valid[MAX_TOUCH_POINTS]; + static unsigned char pan_started[MAX_TOUCH_POINTS]; double x, y; + int id = m->p2; + int valid_id = id >= 0 && id < MAX_TOUCH_POINTS; + + if (valid_id && m->p1 == 0) { + pan_start_x[id] = m->p3; + pan_start_y[id] = m->p4; + pan_started[id] = 0; + } + if (valid_id && g_touch_points[id].surface && + m->p1 == 1 && last_valid[id] && !pan_started[id]) { + int dx = m->p3 - pan_start_x[id]; + int dy = m->p4 - pan_start_y[id]; + if (dx * dx + dy * dy >= 400) + pan_started[id] = 1; + } + if (valid_id && g_touch_points[id].surface && + m->p1 == 1 && pan_started[id] && last_valid[id] && + (m->p3 != last_x[id] || m->p4 != last_y[id])) { + int ow, oh; + vkp_output_size(&ow, &oh); + if (ow > 0 && oh > 0 && + vkp_zoom_pan_cursor((double)m->p3 * ow / INPUT_SPACE_W, + (double)m->p4 * oh / INPUT_SPACE_H)) + schedule_render(); + } + input_output_to_scene(m->p3, m->p4, &x, &y); - if (m->p1 == 0) touch_down(m->p2, x, y); - else if (m->p1 == 1) touch_motion(m->p2, x, y); - else if (m->p1 == 2) touch_up(m->p2, x, y); - else if (m->p1 == 3) touch_cancel_all(); + if (m->p1 == 0) { + if (valid_id) { + last_x[id] = m->p3; + last_y[id] = m->p4; + last_valid[id] = 1; + } + touch_down(id, x, y); + } else if (m->p1 == 1) { + if (valid_id) { + last_x[id] = m->p3; + last_y[id] = m->p4; + last_valid[id] = 1; + } + touch_motion(id, x, y); + } else if (m->p1 == 2) { + touch_up(id, x, y); + if (valid_id) { + last_valid[id] = 0; + pan_started[id] = 0; + } + } else if (m->p1 == 3) { + touch_cancel_all(); + memset(last_valid, 0, sizeof(last_valid)); + memset(pan_started, 0, sizeof(pan_started)); + } publish_query_state(); } @@ -4067,12 +4153,20 @@ static int on_input_readable(int fd, uint32_t mask, void *data) { case 11: axis_event(m.p1, m.p2, 0); break; case 12: axis_event(m.p1, m.p2, 1); break; case 13: deliver_pen(&m); break; + case 14: + atomic_store(&g_zoom_request_pending, 1); + break; case 20: stream_take(); break; case 21: if (!m.p1) stream_forget_all(); schedule_render(); break; case 22: schedule_render(); break; default: deliver_pointer(&m); break; } } + if (atomic_exchange(&g_zoom_request_pending, 0)) { + int zoom_percent = atomic_load(&g_zoom_request_percent); + vk_present_set_zoom((float)zoom_percent / 100.0f); + schedule_render(); + } if (atomic_exchange(&g_output_refresh_pending, 0) && atomic_load(&g_output_refresh_mhz) != g_output_announced_refresh_mhz) { output_notify_mode(); @@ -4096,6 +4190,23 @@ void droiddeck_wayland_set_scale_mode(int mode, int alignment) { (void)n; } +void droiddeck_wayland_set_zoom(int zoom_percent) { + if (zoom_percent < 100) zoom_percent = 100; + if (zoom_percent > 300) zoom_percent = 300; + if (g_input_pipe[1] < 0) { + vk_present_set_zoom((float)zoom_percent / 100.0f); + return; + } + atomic_store(&g_zoom_request_percent, zoom_percent); + atomic_store(&g_zoom_request_pending, 1); + struct input_msg m = { 14, zoom_percent, 0, 0, 0 }; + ssize_t n; + do { + n = write(g_input_pipe[1], &m, sizeof(m)); + } while (n < 0 && errno == EINTR); + (void)n; +} + void droiddeck_wayland_send_pointer(int action, int x, int y) { if (g_input_pipe[1] < 0) return; struct input_msg m = { 0, action, x, y, 0 }; diff --git a/app/src/main/cpp/waylandcomp/src/vk_present.c b/app/src/main/cpp/waylandcomp/src/vk_present.c index 77da32baf7..9ca0e1d7c3 100644 --- a/app/src/main/cpp/waylandcomp/src/vk_present.c +++ b/app/src/main/cpp/waylandcomp/src/vk_present.c @@ -268,13 +268,16 @@ static pthread_cond_t g_req_condition = PTHREAD_COND_INITIALIZER; static volatile int g_mode = VKP_MODE_STRETCH, g_align = VKP_ALIGN_CENTER; +static volatile float g_zoom = 1.0f; static struct { int scene_w, scene_h, out_w, out_h, mode, align; float kx, ky, off_x, off_y; + float base_kx, base_ky, base_off_x, base_off_y, zoom; int rx, ry, rw, rh; int valid; } g_map; +static pthread_mutex_t g_map_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t g_game_picture_lock = PTHREAD_MUTEX_INITIALIZER; static float g_game_picture_rect[4]; static int g_game_picture_placed; @@ -429,8 +432,21 @@ int vkp_completion_unknown(void) { return g_dev_state == -3; } void vk_present_set_scale_mode(int mode, int alignment) { if (mode < VKP_MODE_OFF || mode > VKP_MODE_INTEGER) mode = VKP_MODE_FIT; if (alignment < VKP_ALIGN_CENTER || alignment > VKP_ALIGN_PICTURE_RIGHT) alignment = VKP_ALIGN_CENTER; + pthread_mutex_lock(&g_map_lock); g_mode = mode; g_align = alignment; + pthread_mutex_unlock(&g_map_lock); +} + +void vk_present_set_zoom(float zoom) { + if (!(zoom >= 1.0f)) zoom = 1.0f; + if (zoom > 3.0f) zoom = 3.0f; + zoom = 1.0f + roundf((zoom - 1.0f) * 4.0f) * 0.25f; + pthread_mutex_lock(&g_map_lock); + if (g_zoom != zoom) { + g_zoom = zoom; + } + pthread_mutex_unlock(&g_map_lock); } static const char *mode_name(int m) { @@ -456,13 +472,18 @@ static const char *align_name(int a) { } static void update_map(int scene_w, int scene_h) { + pthread_mutex_lock(&g_map_lock); int mode = g_mode, align = g_align; + float zoom = g_zoom; int W = (int)g_extent.width, H = (int)g_extent.height; if (g_map.valid && g_map.scene_w == scene_w && g_map.scene_h == scene_h && g_map.out_w == W && - g_map.out_h == H && g_map.mode == mode && g_map.align == align) + g_map.out_h == H && g_map.mode == mode && g_map.align == align && g_map.zoom == zoom) { + pthread_mutex_unlock(&g_map_lock); return; + } + g_map.valid = 0; g_map.scene_w = scene_w; g_map.scene_h = scene_h; g_map.out_w = W; g_map.out_h = H; - g_map.mode = mode; g_map.align = align; + g_map.mode = mode; g_map.align = align; g_map.zoom = zoom; int half = H / 2; switch (align) { @@ -495,6 +516,82 @@ static void update_map(int scene_w, int scene_h) { else if (align == VKP_ALIGN_PICTURE_BOTTOM) g_map.off_y = H - scene_h * g_map.ky; else if (align == VKP_ALIGN_PICTURE_LEFT) g_map.off_x = 0; else if (align == VKP_ALIGN_PICTURE_RIGHT) g_map.off_x = W - scene_w * g_map.kx; + + g_map.base_kx = g_map.kx; + g_map.base_ky = g_map.ky; + g_map.base_off_x = g_map.off_x; + g_map.base_off_y = g_map.off_y; + + if (!(g_map.base_kx > 0.0f) || !(g_map.base_ky > 0.0f) || + !isfinite(g_map.base_kx) || !isfinite(g_map.base_ky) || + !isfinite(g_map.base_off_x) || !isfinite(g_map.base_off_y)) { + pthread_mutex_lock(&g_game_picture_lock); + g_game_picture_placed = 0; + pthread_mutex_unlock(&g_game_picture_lock); + pthread_mutex_unlock(&g_map_lock); + return; + } + + if (zoom > 1.0f) { + float cx = (float)g_map.rx + (float)g_map.rw * 0.5f; + float cy = (float)g_map.ry + (float)g_map.rh * 0.5f; + float image_w, image_h; + + g_map.kx = g_map.base_kx * zoom; + g_map.ky = g_map.base_ky * zoom; + image_w = scene_w * g_map.kx; + image_h = scene_h * g_map.ky; + + g_map.off_x = cx + (g_map.base_off_x - cx) * zoom; + g_map.off_y = cy + (g_map.base_off_y - cy) * zoom; + + if (image_w >= g_map.rw) { + float min_x = (float)g_map.rx + g_map.rw - image_w; + if (g_map.off_x < min_x) g_map.off_x = min_x; + if (g_map.off_x > g_map.rx) g_map.off_x = (float)g_map.rx; + } else { + g_map.off_x = (float)g_map.rx + (g_map.rw - image_w) * 0.5f; + } + + if (image_h >= g_map.rh) { + float min_y = (float)g_map.ry + g_map.rh - image_h; + if (g_map.off_y < min_y) g_map.off_y = min_y; + if (g_map.off_y > g_map.ry) g_map.off_y = (float)g_map.ry; + } else { + g_map.off_y = (float)g_map.ry + (g_map.rh - image_h) * 0.5f; + } + } + + if (zoom > 1.0f && + (!(g_map.kx > 0.0f) || !(g_map.ky > 0.0f) || + !isfinite(g_map.kx) || !isfinite(g_map.ky) || + !isfinite(g_map.off_x) || !isfinite(g_map.off_y))) { + if (g_map.base_kx > 0.0f && g_map.base_ky > 0.0f && + isfinite(g_map.base_kx) && isfinite(g_map.base_ky) && + isfinite(g_map.base_off_x) && isfinite(g_map.base_off_y)) { + g_map.kx = g_map.base_kx; + g_map.ky = g_map.base_ky; + g_map.off_x = g_map.base_off_x; + g_map.off_y = g_map.base_off_y; + } else { + pthread_mutex_lock(&g_game_picture_lock); + g_game_picture_placed = 0; + pthread_mutex_unlock(&g_game_picture_lock); + pthread_mutex_unlock(&g_map_lock); + return; + } + } + + if (!(g_map.kx > 0.0f) || !(g_map.ky > 0.0f) || + !isfinite(g_map.kx) || !isfinite(g_map.ky) || + !isfinite(g_map.off_x) || !isfinite(g_map.off_y)) { + pthread_mutex_lock(&g_game_picture_lock); + g_game_picture_placed = 0; + pthread_mutex_unlock(&g_game_picture_lock); + pthread_mutex_unlock(&g_map_lock); + return; + } + g_map.valid = 1; pthread_mutex_lock(&g_game_picture_lock); g_game_picture_placed = mode == VKP_MODE_INTEGER || align == VKP_ALIGN_PICTURE_TOP || align == VKP_ALIGN_PICTURE_BOTTOM || align == VKP_ALIGN_PICTURE_LEFT || align == VKP_ALIGN_PICTURE_RIGHT; @@ -507,6 +604,7 @@ static void update_map(int scene_w, int scene_h) { mode_name(mode), align_name(align), scene_w, scene_h, (int)(scene_w * g_map.kx + 0.5f), (int)(scene_h * g_map.ky + 0.5f), (int)g_map.off_x, (int)g_map.off_y, W, H); + pthread_mutex_unlock(&g_map_lock); } int vkp_game_picture_rect(float rect[4]) { @@ -518,16 +616,26 @@ int vkp_game_picture_rect(float rect[4]) { } int vkp_output_to_scene(double ox, double oy, double *sx, double *sy) { - if (!g_map.valid || g_map.kx <= 0 || g_map.ky <= 0) return 0; + pthread_mutex_lock(&g_map_lock); + if (!g_map.valid || g_map.kx <= 0 || g_map.ky <= 0) { + pthread_mutex_unlock(&g_map_lock); + return 0; + } *sx = (ox - g_map.off_x) / g_map.kx; *sy = (oy - g_map.off_y) / g_map.ky; + pthread_mutex_unlock(&g_map_lock); return 1; } int vkp_scene_to_output(double sx, double sy, double *ox, double *oy) { - if (!g_map.valid || g_map.kx <= 0 || g_map.ky <= 0) return 0; + pthread_mutex_lock(&g_map_lock); + if (!g_map.valid || g_map.kx <= 0 || g_map.ky <= 0) { + pthread_mutex_unlock(&g_map_lock); + return 0; + } *ox = sx * g_map.kx + g_map.off_x; *oy = sy * g_map.ky + g_map.off_y; + pthread_mutex_unlock(&g_map_lock); return 1; } @@ -536,6 +644,99 @@ void vkp_output_size(int *w, int *h) { *h = (int)g_extent.height; } +int vkp_zoom_pan_cursor(double ox, double oy) { + double cursor_x, cursor_y; + float next_x, next_y; + float image_w, image_h; + int changed; + + pthread_mutex_lock(&g_map_lock); + if (!g_map.valid || g_map.zoom != g_zoom || g_map.mode != g_mode || + g_map.align != g_align || g_zoom <= 1.0f || g_zoom > 3.0f || + g_map.scene_w <= 0 || g_map.scene_h <= 0 || + g_map.rw <= 0 || g_map.rh <= 0 || + g_map.base_kx <= 0.0f || g_map.base_ky <= 0.0f || + g_map.kx <= 0.0f || g_map.ky <= 0.0f || + !isfinite(g_map.base_kx) || !isfinite(g_map.base_ky) || + !isfinite(g_map.kx) || !isfinite(g_map.ky) || + !isfinite(g_map.off_x) || !isfinite(g_map.off_y)) { + pthread_mutex_unlock(&g_map_lock); + return 0; + } + + if (!isfinite(ox) || !isfinite(oy)) { + pthread_mutex_unlock(&g_map_lock); + return 0; + } + + cursor_x = (ox - g_map.off_x) / g_map.kx; + cursor_y = (oy - g_map.off_y) / g_map.ky; + + if (cursor_x < 0.0) cursor_x = 0.0; + if (cursor_y < 0.0) cursor_y = 0.0; + if (cursor_x > g_map.scene_w - 1) cursor_x = g_map.scene_w - 1; + if (cursor_y > g_map.scene_h - 1) cursor_y = g_map.scene_h - 1; + + next_x = g_map.off_x; + next_y = g_map.off_y; + image_w = g_map.scene_w * g_map.kx; + image_h = g_map.scene_h * g_map.ky; + + if (image_w > g_map.rw) { + float left = ((float)g_map.rx - g_map.off_x) / g_map.kx; + float right = ((float)(g_map.rx + g_map.rw) - g_map.off_x) / g_map.kx; + float margin = (right - left) * 0.2f; + + if (cursor_x < left + margin) + next_x += (float)(left + margin - cursor_x) * g_map.kx * 0.5f; + else if (cursor_x > right - margin) + next_x -= (float)(cursor_x - (right - margin)) * g_map.kx * 0.5f; + + float min_x = (float)g_map.rx + g_map.rw - image_w; + if (next_x < min_x) next_x = min_x; + if (next_x > g_map.rx) next_x = (float)g_map.rx; + } + + if (image_h > g_map.rh) { + float top = ((float)g_map.ry - g_map.off_y) / g_map.ky; + float bottom = ((float)(g_map.ry + g_map.rh) - g_map.off_y) / g_map.ky; + float margin = (bottom - top) * 0.2f; + + if (cursor_y < top + margin) + next_y += (float)(top + margin - cursor_y) * g_map.ky * 0.5f; + else if (cursor_y > bottom - margin) + next_y -= (float)(cursor_y - (bottom - margin)) * g_map.ky * 0.5f; + + float min_y = (float)g_map.ry + g_map.rh - image_h; + if (next_y < min_y) next_y = min_y; + if (next_y > g_map.ry) next_y = (float)g_map.ry; + } + + if (!isfinite(next_x) || !isfinite(next_y)) { + pthread_mutex_unlock(&g_map_lock); + return 0; + } + + changed = fabsf(next_x - g_map.off_x) >= 0.5f || + fabsf(next_y - g_map.off_y) >= 0.5f; + if (!changed) { + pthread_mutex_unlock(&g_map_lock); + return 0; + } + + g_map.off_x = next_x; + g_map.off_y = next_y; + + pthread_mutex_lock(&g_game_picture_lock); + g_game_picture_rect[0] = g_map.off_x; + g_game_picture_rect[1] = g_map.off_y; + g_game_picture_rect[2] = g_map.off_x + g_map.scene_w * g_map.kx; + g_game_picture_rect[3] = g_map.off_y + g_map.scene_h * g_map.ky; + pthread_mutex_unlock(&g_game_picture_lock); + pthread_mutex_unlock(&g_map_lock); + return 1; +} + static void init_black_image(void); static int has_ext(VkExtensionProperties *e, uint32_t n, const char *name) { diff --git a/app/src/main/cpp/waylandcomp/src/vk_present.h b/app/src/main/cpp/waylandcomp/src/vk_present.h index 69af7dca23..bc35ac8b49 100644 --- a/app/src/main/cpp/waylandcomp/src/vk_present.h +++ b/app/src/main/cpp/waylandcomp/src/vk_present.h @@ -20,6 +20,8 @@ enum vkp_align { VKP_ALIGN_CENTER = 0, VKP_ALIGN_TOP = 1, VKP_ALIGN_BOTTOM = 2, VKP_ALIGN_PICTURE_TOP = 3, VKP_ALIGN_PICTURE_BOTTOM = 4, VKP_ALIGN_PICTURE_LEFT = 5, VKP_ALIGN_PICTURE_RIGHT = 6 }; void vk_present_set_scale_mode(int mode, int alignment); +void vk_present_set_zoom(float zoom); +int vkp_zoom_pan_cursor(double ox, double oy); int vkp_game_picture_rect(float rect[4]); int vkp_output_to_scene(double ox, double oy, double *sx, double *sy); int vkp_scene_to_output(double sx, double sy, double *ox, double *oy); diff --git a/app/src/main/cpp/waylandcomp/src/waylandcomp_jni.c b/app/src/main/cpp/waylandcomp/src/waylandcomp_jni.c index 308332f9b1..d070b8fd6f 100644 --- a/app/src/main/cpp/waylandcomp/src/waylandcomp_jni.c +++ b/app/src/main/cpp/waylandcomp/src/waylandcomp_jni.c @@ -22,6 +22,7 @@ extern int droiddeck_wayland_run(void); extern void droiddeck_wayland_set_scale_mode(int mode, int alignment); +extern void droiddeck_wayland_set_zoom(int zoom_percent); extern void droiddeck_wayland_send_pointer(int action, int x, int y); extern void droiddeck_wayland_send_touch(int action, int pointer_id, int x, int y); extern void droiddeck_wayland_send_pen(int flags, int x, int y); @@ -511,6 +512,15 @@ Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeSetScaleMode(JNIEnv __android_log_print(ANDROID_LOG_INFO, TAG, "scale mode %d alignment %d", mode, alignment); } +JNIEXPORT void JNICALL +Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeSetZoom(JNIEnv *env, jclass clazz, jfloat zoom) { + (void)env; + (void)clazz; + if (!(zoom >= 1.0f)) zoom = 1.0f; + if (zoom > 3.0f) zoom = 3.0f; + droiddeck_wayland_set_zoom((int)(zoom * 100.0f + 0.5f)); +} + JNIEXPORT jboolean JNICALL Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeGamePictureRect(JNIEnv *env, jclass clazz, jfloatArray out) { diff --git a/app/src/main/java/com/droiddeck/launcher/SessionActivity.kt b/app/src/main/java/com/droiddeck/launcher/SessionActivity.kt index da291701f4..11fd6b86f2 100644 --- a/app/src/main/java/com/droiddeck/launcher/SessionActivity.kt +++ b/app/src/main/java/com/droiddeck/launcher/SessionActivity.kt @@ -179,6 +179,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde private var quickButtons by mutableStateOf>(emptyMap()) private var picturePosition by mutableStateOf("center") private var integerScaling by mutableStateOf(false) + private var gameZoom by mutableStateOf(SessionState.gameZoom) private var avoidNotch = false private fun applyNotchInset(insets: android.view.WindowInsets? = window.decorView.rootWindowInsets) { @@ -265,6 +266,16 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde InputCommand.KEYBOARD -> if (role == InputRole.PRIMARY || secondScreenPresentation?.showKeyboard() != true) togglePcKeyboard() InputCommand.STEAM -> tapSteamButton() InputCommand.QUICK_ACCESS -> tapQam() + InputCommand.GAME_ZOOM_IN -> { + gameZoom = (gameZoom + 0.25f).coerceAtMost(3.0f) + SessionState.gameZoom = gameZoom + runCatching { WaylandCompositor.nativeSetZoom(gameZoom) } + } + InputCommand.GAME_ZOOM_OUT -> { + gameZoom = (gameZoom - 0.25f).coerceAtLeast(1.0f) + SessionState.gameZoom = gameZoom + runCatching { WaylandCompositor.nativeSetZoom(gameZoom) } + } } } } @@ -1154,6 +1165,17 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde isFocusableInTouchMode = true defaultFocusHighlightEnabled = false setContent { + androidx.compose.runtime.LaunchedEffect(SessionState.running, SessionState.sessionId) { + if (SessionState.running) { + gameZoom = SessionState.gameZoom + runCatching { WaylandCompositor.nativeSetZoom(gameZoom) } + } else { + gameZoom = 1.0f + SessionState.gameZoom = 1.0f + runCatching { WaylandCompositor.nativeSetZoom(1.0f) } + } + } + val activeEffectsProfileId = currentScreenEffectsProfileId() val effectsEditorTarget = if (drawerOpen) screenEffectsTarget else null val effectsEditorProfileId = activeEffectsProfileId.takeIf { @@ -1221,6 +1243,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde CursorOverlay({ cursorPos }, cursorVisible && (!cursorHidden || onlyPcKeyboardOpen()) && !bottomOutputActive, resources.displayMetrics.density, cursorImage, cursorHotX, cursorHotY, cursorImageScale) + if (memoryHud.text.isNotEmpty()) HudText(memoryHud.text, hudColor, hudOpacity) if (bottomOutputActive && !loading.visible) SwappedTopPanel() val phonePanel = glassesOutputActive && !loading.visible && !drawerOpen && !pcKeyboardOpen @@ -1596,6 +1619,13 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde onHudReset = { hudConfig = DroidDeckHudConfig.reset(this@SessionActivity); hud.applyConfig() }, onHudOrderReset = { hudConfig = DroidDeckHudConfig.clearOrder(this@SessionActivity); hud.applyConfig() }, onHudExport = { exportHudDiagnostics() }, + gameZoomAvailable = SessionState.running, + gameZoom = gameZoom, + onGameZoom = { value -> + gameZoom = value.coerceIn(1.0f, 3.0f) + SessionState.gameZoom = gameZoom + runCatching { WaylandCompositor.nativeSetZoom(gameZoom) } + }, integerScaling = integerScaling, onIntegerScaling = { enabled -> SessionPrefs.setIntegerScaling(this@SessionActivity, enabled) diff --git a/app/src/main/java/com/droiddeck/launcher/input/InputProfile.kt b/app/src/main/java/com/droiddeck/launcher/input/InputProfile.kt index f17076e7ca..e988c39d92 100644 --- a/app/src/main/java/com/droiddeck/launcher/input/InputProfile.kt +++ b/app/src/main/java/com/droiddeck/launcher/input/InputProfile.kt @@ -21,7 +21,7 @@ enum class InputControl(val id: String, val label: String, val dimensions: Int = } } -enum class InputCommand { MENU, KEYBOARD, STEAM, QUICK_ACCESS } +enum class InputCommand { MENU, KEYBOARD, STEAM, QUICK_ACCESS, GAME_ZOOM_IN, GAME_ZOOM_OUT } sealed interface InputAction { data class Native(val target: InputControl? = null) : InputAction diff --git a/app/src/main/java/com/droiddeck/launcher/session/SessionService.kt b/app/src/main/java/com/droiddeck/launcher/session/SessionService.kt index 4bb27642e6..18b3d5b4e8 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/SessionService.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/SessionService.kt @@ -420,6 +420,7 @@ class SessionService : Service() { val gen = synchronized(SessionState.startLock) { synchronized(stopLock) { SessionState.steamClientArch = null + SessionState.gameZoom = 1.0f SessionState.running = true ++sessionGen } diff --git a/app/src/main/java/com/droiddeck/launcher/session/SessionState.kt b/app/src/main/java/com/droiddeck/launcher/session/SessionState.kt index 92255febec..ac62bde46c 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/SessionState.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/SessionState.kt @@ -47,6 +47,9 @@ object SessionState { @Volatile var running = false + /** Zoom level retained across activity recreation for the active session. */ + @Volatile + var gameZoom = 1.0f @Volatile var activityDisplayId = 0 @Volatile diff --git a/app/src/main/java/com/droiddeck/launcher/ui/InputBindingWidgets.kt b/app/src/main/java/com/droiddeck/launcher/ui/InputBindingWidgets.kt index a8eb95b347..23302a090c 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/InputBindingWidgets.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/InputBindingWidgets.kt @@ -33,6 +33,8 @@ internal fun commandLabel(command: InputCommand) = stringResource(when (command) InputCommand.KEYBOARD -> R.string.input_command_keyboard InputCommand.STEAM -> R.string.input_command_steam InputCommand.QUICK_ACCESS -> R.string.input_command_qam + InputCommand.GAME_ZOOM_IN -> R.string.input_command_zoom_in + InputCommand.GAME_ZOOM_OUT -> R.string.input_command_zoom_out }) @Composable diff --git a/app/src/main/java/com/droiddeck/launcher/ui/SessionOverlay.kt b/app/src/main/java/com/droiddeck/launcher/ui/SessionOverlay.kt index 296040787b..ae00595556 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/SessionOverlay.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/SessionOverlay.kt @@ -258,6 +258,9 @@ class DrawerActions( val upscaleSharpness: Int = 75, val integerScaling: Boolean = false, val onIntegerScaling: (Boolean) -> Unit = {}, + val gameZoomAvailable: Boolean = false, + val gameZoom: Float = 1.0f, + val onGameZoom: (Float) -> Unit = {}, val effects: ScreenEffects = ScreenEffects.OFF, val screenEffectsTarget: String = "auto", val screenEffectsTargets: List> = emptyList(), @@ -665,6 +668,45 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont SessionDrawerPage.HUD -> DroidDeckHudSettings(host, a) { key -> focus.track(page, key) } SessionDrawerPage.DISPLAY -> { SettingsGroup(stringResource(R.string.drawer_page_display)) { + if (a.gameZoomAvailable) SettingsRow( + stringResource(R.string.game_zoom_title), + stringResource(R.string.game_zoom_hint), + ) { + Row( + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.spacedBy(4.dp), + ) { + val zoomOutEnabled = a.gameZoom > 1.0f + val zoomInEnabled = a.gameZoom < 3.0f + val zoomResetEnabled = a.gameZoom > 1.0f + val zoomOut = { a.onGameZoom((a.gameZoom - 0.25f).coerceAtLeast(1.0f)) } + val zoomIn = { a.onGameZoom((a.gameZoom + 0.25f).coerceAtMost(3.0f)) } + val zoomReset = { a.onGameZoom(1.0f) } + + OutlinedButton( + onClick = zoomOut, + enabled = zoomOutEnabled, + modifier = focus.track(page, "game-zoom-out").width(42.dp) + .controllerConfirm(enabled = zoomOutEnabled, onClick = zoomOut), + contentPadding = PaddingValues(horizontal = 4.dp, vertical = 0.dp), + ) { Text("−") } + Text("${(a.gameZoom * 100.0f).toInt()}%", fontSize = 12.sp) + OutlinedButton( + onClick = zoomIn, + enabled = zoomInEnabled, + modifier = focus.track(page, "game-zoom-in").width(42.dp) + .controllerConfirm(enabled = zoomInEnabled, onClick = zoomIn), + contentPadding = PaddingValues(horizontal = 4.dp, vertical = 0.dp), + ) { Text("+") } + OutlinedButton( + onClick = zoomReset, + enabled = zoomResetEnabled, + modifier = focus.track(page, "game-zoom-reset").width(48.dp) + .controllerConfirm(enabled = zoomResetEnabled, onClick = zoomReset), + contentPadding = PaddingValues(horizontal = 2.dp, vertical = 0.dp), + ) { Text("1×") } + } + } val fgOpen = host.open == "fg" val offLabel = stringResource(R.string.frame_gen_off) val fgLabel = FrameGen.label(LocalContext.current, a.frameGen) diff --git a/app/src/main/java/com/droiddeck/launcher/wayland/WaylandCompositor.java b/app/src/main/java/com/droiddeck/launcher/wayland/WaylandCompositor.java index 4e824f6dba..afe0df226f 100644 --- a/app/src/main/java/com/droiddeck/launcher/wayland/WaylandCompositor.java +++ b/app/src/main/java/com/droiddeck/launcher/wayland/WaylandCompositor.java @@ -371,6 +371,7 @@ public final class WaylandCompositor { public static native void nativeHdrNoteHeadroomRequest(float ratio); public static native void nativeSetScaleMode(int fullscreenMode, int screenAlignment); + public static native void nativeSetZoom(float zoom); public static native void nativeSetUpscaler(int mode); diff --git a/app/src/main/res/values-ar/input_zoom_strings.xml b/app/src/main/res/values-ar/input_zoom_strings.xml new file mode 100644 index 0000000000..c96953f664 --- /dev/null +++ b/app/src/main/res/values-ar/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + تكبير عرض اللعبة + تصغير عرض اللعبة + \ No newline at end of file diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 41e7b0f1f7..84d4fc1e30 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -4305,4 +4305,6 @@ أغلق Steam أولاً أوقف تنزيل Steam مؤقتًا أولاً تثبّت هذه اللعبة إصدار Linux الخاص بها. ثبّتها من Steam. + تكبير اللعبة + اضبط تكبير اللعبة من 100% إلى 300% diff --git a/app/src/main/res/values-b+es+419/input_zoom_strings.xml b/app/src/main/res/values-b+es+419/input_zoom_strings.xml new file mode 100644 index 0000000000..b3a9fa6ce7 --- /dev/null +++ b/app/src/main/res/values-b+es+419/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + Aumentar el zoom del juego + Reducir el zoom del juego + \ No newline at end of file diff --git a/app/src/main/res/values-bg/input_zoom_strings.xml b/app/src/main/res/values-bg/input_zoom_strings.xml new file mode 100644 index 0000000000..22cd636040 --- /dev/null +++ b/app/src/main/res/values-bg/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + Увеличаване на мащаба на играта + Намаляване на мащаба на играта + \ No newline at end of file diff --git a/app/src/main/res/values-bg/strings.xml b/app/src/main/res/values-bg/strings.xml index f7e4f83944..84a2d916ec 100644 --- a/app/src/main/res/values-bg/strings.xml +++ b/app/src/main/res/values-bg/strings.xml @@ -4145,4 +4145,6 @@ Първо затворете Steam Първо поставете на пауза изтеглянето от Steam Тази игра инсталира версията си за Linux. Инсталирайте я от Steam. + Мащабиране на играта + Регулирайте увеличението на играта от 100% до 300% diff --git a/app/src/main/res/values-cs/input_zoom_strings.xml b/app/src/main/res/values-cs/input_zoom_strings.xml new file mode 100644 index 0000000000..a5fb0ad850 --- /dev/null +++ b/app/src/main/res/values-cs/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + Zvětšit přiblížení hry + Zmenšit přiblížení hry + \ No newline at end of file diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index fa3e3c0adc..d18f09faa1 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -4225,4 +4225,6 @@ Nejprve zavřete Steam Nejprve pozastavte stahování ze Steamu Tato hra instaluje svou verzi pro Linux. Nainstalujte ji ze Steamu. + Přiblížení hry + Nastavte zvětšení hry od 100 % do 300 % diff --git a/app/src/main/res/values-da/input_zoom_strings.xml b/app/src/main/res/values-da/input_zoom_strings.xml new file mode 100644 index 0000000000..3e09248776 --- /dev/null +++ b/app/src/main/res/values-da/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + Forøg spillets zoom + Formindsk spillets zoom + \ No newline at end of file diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index be75ef09c6..48e476a0a6 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -4145,4 +4145,6 @@ Luk Steam først Sæt Steam-downloaden på pause først Dette spil installerer sin Linux-version. Installer det fra Steam. + Spilzoom + Juster spillets forstørrelse fra 100 % til 300 % diff --git a/app/src/main/res/values-de/input_zoom_strings.xml b/app/src/main/res/values-de/input_zoom_strings.xml new file mode 100644 index 0000000000..1abf75bd99 --- /dev/null +++ b/app/src/main/res/values-de/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + Spielzoom vergrößern + Spielzoom verkleinern + \ No newline at end of file diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 3488b58e01..cee30dc25d 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -4145,4 +4145,6 @@ Schließe zuerst Steam Pausiere zuerst den Steam-Download Dieses Spiel installiert seine Linux-Version. Installiere es über Steam. + Spielzoom + Spielvergrößerung von 100 % bis 300 % anpassen diff --git a/app/src/main/res/values-el/input_zoom_strings.xml b/app/src/main/res/values-el/input_zoom_strings.xml new file mode 100644 index 0000000000..2600c24f56 --- /dev/null +++ b/app/src/main/res/values-el/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + Αύξηση ζουμ παιχνιδιού + Μείωση ζουμ παιχνιδιού + \ No newline at end of file diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 0eee9609ef..b3f81ca591 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -4145,4 +4145,6 @@ Κλείστε πρώτα το Steam Θέστε πρώτα σε παύση τη λήψη του Steam Αυτό το παιχνίδι εγκαθιστά την έκδοσή του για Linux. Εγκαταστήστε το από το Steam. + Ζουμ παιχνιδιού + Ρυθμίστε τη μεγέθυνση του παιχνιδιού από 100% έως 300% diff --git a/app/src/main/res/values-es/input_zoom_strings.xml b/app/src/main/res/values-es/input_zoom_strings.xml new file mode 100644 index 0000000000..b3a9fa6ce7 --- /dev/null +++ b/app/src/main/res/values-es/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + Aumentar el zoom del juego + Reducir el zoom del juego + \ No newline at end of file diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 3ad2ed95f8..2d2a4244a4 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -4185,4 +4185,6 @@ Cierra Steam primero Pausa primero la descarga de Steam Este juego instala su versión para Linux. Instálalo desde Steam. + Zoom del juego + Ajusta la ampliación del juego del 100 % al 300 % diff --git a/app/src/main/res/values-fi/input_zoom_strings.xml b/app/src/main/res/values-fi/input_zoom_strings.xml new file mode 100644 index 0000000000..497213995a --- /dev/null +++ b/app/src/main/res/values-fi/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + Suurenna pelin zoomausta + Pienennä pelin zoomausta + \ No newline at end of file diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index d15dd0f149..7a11c6eaa2 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -4145,4 +4145,6 @@ Sulje Steam ensin Keskeytä Steam-lataus ensin Tämä peli asentaa Linux-versionsa. Asenna se Steamista. + Pelin zoomaus + Säädä pelin suurennusta välillä 100–300 % diff --git a/app/src/main/res/values-fr/input_zoom_strings.xml b/app/src/main/res/values-fr/input_zoom_strings.xml new file mode 100644 index 0000000000..be77bcaf05 --- /dev/null +++ b/app/src/main/res/values-fr/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + Augmenter le zoom du jeu + Réduire le zoom du jeu + \ No newline at end of file diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 136b893d15..4326efc5a5 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -4184,4 +4184,6 @@ Fermez d\'abord Steam Mettez d\'abord en pause le téléchargement Steam Ce jeu installe sa version Linux. Installez-le depuis Steam. + Zoom du jeu + Réglez le grossissement du jeu de 100 % à 300 % diff --git a/app/src/main/res/values-hi/input_zoom_strings.xml b/app/src/main/res/values-hi/input_zoom_strings.xml new file mode 100644 index 0000000000..c4d12e84e1 --- /dev/null +++ b/app/src/main/res/values-hi/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + गेम ज़ूम बढ़ाएँ + गेम ज़ूम घटाएँ + \ No newline at end of file diff --git a/app/src/main/res/values-hi/strings.xml b/app/src/main/res/values-hi/strings.xml index 64125494a5..325e643f0d 100644 --- a/app/src/main/res/values-hi/strings.xml +++ b/app/src/main/res/values-hi/strings.xml @@ -4145,4 +4145,6 @@ पहले Steam बंद करें पहले Steam डाउनलोड रोकें यह गेम अपना Linux संस्करण इंस्टॉल करता है। इसे Steam से इंस्टॉल करें। + गेम ज़ूम + गेम का ज़ूम 100% से 300% तक समायोजित करें diff --git a/app/src/main/res/values-hu/input_zoom_strings.xml b/app/src/main/res/values-hu/input_zoom_strings.xml new file mode 100644 index 0000000000..743e49fd58 --- /dev/null +++ b/app/src/main/res/values-hu/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + Játék nagyítása + Játék kicsinyítése + \ No newline at end of file diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index eab624a92c..977f9c68a4 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -4145,4 +4145,6 @@ Előbb zárd be a Steamet Előbb szüneteltesd a Steam-letöltést Ez a játék a Linux-verzióját telepíti. Telepítsd a Steamből. + Játék nagyítása + A játék nagyításának beállítása 100% és 300% között diff --git a/app/src/main/res/values-in/input_zoom_strings.xml b/app/src/main/res/values-in/input_zoom_strings.xml new file mode 100644 index 0000000000..dd4cb60c5f --- /dev/null +++ b/app/src/main/res/values-in/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + Perbesar zoom game + Perkecil zoom game + \ No newline at end of file diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml index 2ab5c77951..de40e848c0 100644 --- a/app/src/main/res/values-in/strings.xml +++ b/app/src/main/res/values-in/strings.xml @@ -4115,4 +4115,6 @@ Tutup Steam terlebih dahulu Jeda unduhan Steam terlebih dahulu Game ini memasang versi Linux-nya. Pasang dari Steam. + Zoom game + Sesuaikan pembesaran game dari 100% hingga 300% diff --git a/app/src/main/res/values-it/input_zoom_strings.xml b/app/src/main/res/values-it/input_zoom_strings.xml new file mode 100644 index 0000000000..124ed96d1b --- /dev/null +++ b/app/src/main/res/values-it/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + Aumenta lo zoom del gioco + Riduci lo zoom del gioco + \ No newline at end of file diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 0b74e3e788..8c0ea88499 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -4184,4 +4184,6 @@ Chiudi prima Steam Metti prima in pausa il download di Steam Questo gioco installa la sua versione Linux. Installalo da Steam. + Zoom del gioco + Regola l\'ingrandimento del gioco dal 100% al 300% diff --git a/app/src/main/res/values-ja/input_zoom_strings.xml b/app/src/main/res/values-ja/input_zoom_strings.xml new file mode 100644 index 0000000000..1d82a23541 --- /dev/null +++ b/app/src/main/res/values-ja/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + ゲームのズームを拡大 + ゲームのズームを縮小 + \ No newline at end of file diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 74b7308fa8..be2b3f88a8 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -4115,4 +4115,6 @@ 先に Steam を閉じてください 先に Steam のダウンロードを一時停止してください このゲームは Linux 版をインストールします。Steam からインストールしてください。 + ゲームズーム + ゲームの拡大率を100%から300%の間で調整します diff --git a/app/src/main/res/values-ko/input_zoom_strings.xml b/app/src/main/res/values-ko/input_zoom_strings.xml new file mode 100644 index 0000000000..3011ee320d --- /dev/null +++ b/app/src/main/res/values-ko/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + 게임 확대 + 게임 축소 + \ No newline at end of file diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index 0c8a99abfe..3e01fad6aa 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -4115,4 +4115,6 @@ 먼저 Steam을 닫으세요 먼저 Steam 다운로드를 일시 중지하세요 이 게임은 Linux 버전을 설치합니다. Steam에서 설치하세요. + 게임 확대 + 게임 확대율을 100%에서 300%까지 조정합니다 diff --git a/app/src/main/res/values-ms/input_zoom_strings.xml b/app/src/main/res/values-ms/input_zoom_strings.xml new file mode 100644 index 0000000000..b95bb1d04a --- /dev/null +++ b/app/src/main/res/values-ms/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + Besarkan zum permainan + Kecilkan zum permainan + \ No newline at end of file diff --git a/app/src/main/res/values-ms/strings.xml b/app/src/main/res/values-ms/strings.xml index 8754e6605b..ed95fc2b84 100644 --- a/app/src/main/res/values-ms/strings.xml +++ b/app/src/main/res/values-ms/strings.xml @@ -4115,4 +4115,6 @@ Tutup Steam dahulu Jeda muat turun Steam dahulu Permainan ini memasang versi Linuxnya. Pasang daripada Steam. + Zum permainan + Laraskan pembesaran permainan daripada 100% hingga 300% diff --git a/app/src/main/res/values-nb/input_zoom_strings.xml b/app/src/main/res/values-nb/input_zoom_strings.xml new file mode 100644 index 0000000000..44773d82e5 --- /dev/null +++ b/app/src/main/res/values-nb/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + Øk spillzoom + Reduser spillzoom + \ No newline at end of file diff --git a/app/src/main/res/values-nb/strings.xml b/app/src/main/res/values-nb/strings.xml index 580b3a3616..9857e2440c 100644 --- a/app/src/main/res/values-nb/strings.xml +++ b/app/src/main/res/values-nb/strings.xml @@ -4145,4 +4145,6 @@ Lukk Steam først Sett Steam-nedlastingen på pause først Dette spillet installerer Linux-versjonen sin. Installer det fra Steam. + Spillzoom + Juster spillforstørrelsen fra 100 % til 300 % diff --git a/app/src/main/res/values-nl/input_zoom_strings.xml b/app/src/main/res/values-nl/input_zoom_strings.xml new file mode 100644 index 0000000000..813a289b53 --- /dev/null +++ b/app/src/main/res/values-nl/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + Gamezoom vergroten + Gamezoom verkleinen + \ No newline at end of file diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 3ddd3a2e68..90abb15137 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -4145,4 +4145,6 @@ Sluit eerst Steam Pauzeer eerst de Steam-download Deze game installeert zijn Linux-versie. Installeer hem via Steam. + Gamezoom + Pas de spelvergroting aan van 100% tot 300% diff --git a/app/src/main/res/values-pl/input_zoom_strings.xml b/app/src/main/res/values-pl/input_zoom_strings.xml new file mode 100644 index 0000000000..00a3bca314 --- /dev/null +++ b/app/src/main/res/values-pl/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + Zwiększ powiększenie gry + Zmniejsz powiększenie gry + \ No newline at end of file diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index e55e3e728a..4b75546761 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -4225,4 +4225,6 @@ Najpierw zamknij Steam Najpierw wstrzymaj pobieranie ze Steam Ta gra instaluje swoją wersję dla Linuksa. Zainstaluj ją ze Steama. + Powiększenie gry + Dostosuj powiększenie gry w zakresie od 100% do 300% diff --git a/app/src/main/res/values-pt-rPT/input_zoom_strings.xml b/app/src/main/res/values-pt-rPT/input_zoom_strings.xml new file mode 100644 index 0000000000..c19cb15a1f --- /dev/null +++ b/app/src/main/res/values-pt-rPT/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + Aumentar o zoom do jogo + Diminuir o zoom do jogo + \ No newline at end of file diff --git a/app/src/main/res/values-pt-rPT/strings.xml b/app/src/main/res/values-pt-rPT/strings.xml index a63f9ca015..7b4a1207d1 100644 --- a/app/src/main/res/values-pt-rPT/strings.xml +++ b/app/src/main/res/values-pt-rPT/strings.xml @@ -4184,4 +4184,6 @@ Feche primeiro o Steam Coloque primeiro em pausa a transferência do Steam Este jogo instala a sua versão para Linux. Instale-o a partir do Steam. + Zoom do jogo + Ajuste a ampliação do jogo de 100% a 300% diff --git a/app/src/main/res/values-pt/input_strings.xml b/app/src/main/res/values-pt/input_strings.xml index 5847aa3ac4..501f635363 100644 --- a/app/src/main/res/values-pt/input_strings.xml +++ b/app/src/main/res/values-pt/input_strings.xml @@ -22,6 +22,8 @@ Mostrar teclado Abrir o menu do Steam Abrir o acesso rápido do Steam + Aumentar zoom do jogo + Diminuir zoom do jogo Remover controle Adicionar controle Botões específicos do dispositivo diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index beb36c5003..a09f4dfe39 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -2532,6 +2532,8 @@ Manter proporções Esticar para a tela Escala de imagem + Ajuste a ampliação do jogo de 100% a 300% + Zoom do jogo Filtro de escala Compartilhado entre Steam e Área de trabalho. Aplicado na hora. Compartilhado entre Steam e Área de trabalho. diff --git a/app/src/main/res/values-ro/input_zoom_strings.xml b/app/src/main/res/values-ro/input_zoom_strings.xml new file mode 100644 index 0000000000..275f3563d8 --- /dev/null +++ b/app/src/main/res/values-ro/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + Mărește zoomul jocului + Micșorează zoomul jocului + \ No newline at end of file diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml index eea97a453e..32f55fe1be 100644 --- a/app/src/main/res/values-ro/strings.xml +++ b/app/src/main/res/values-ro/strings.xml @@ -4185,4 +4185,6 @@ Închide mai întâi Steam Pune mai întâi pe pauză descărcarea Steam Acest joc își instalează versiunea pentru Linux. Instalează-l din Steam. + Zoom joc + Reglați mărirea jocului între 100% și 300% diff --git a/app/src/main/res/values-ru/input_zoom_strings.xml b/app/src/main/res/values-ru/input_zoom_strings.xml new file mode 100644 index 0000000000..e5c6c303e6 --- /dev/null +++ b/app/src/main/res/values-ru/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + Увеличить масштаб игры + Уменьшить масштаб игры + \ No newline at end of file diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index f90c95f28a..23ee3124fc 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -4226,4 +4226,6 @@ Сначала закройте Steam Сначала приостановите загрузку Steam Эта игра устанавливает свою версию для Linux. Установите её из Steam. + Масштаб игры + Настройте увеличение игры от 100% до 300% diff --git a/app/src/main/res/values-sv/input_zoom_strings.xml b/app/src/main/res/values-sv/input_zoom_strings.xml new file mode 100644 index 0000000000..ddf9701d11 --- /dev/null +++ b/app/src/main/res/values-sv/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + Öka spelzoom + Minska spelzoom + \ No newline at end of file diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 5efff6defd..5aafdf9c38 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -4145,4 +4145,6 @@ Stäng Steam först Pausa Steam-nedladdningen först Det här spelet installerar sin Linux-version. Installera det från Steam. + Spelzoom + Justera spelförstoringen från 100 % till 300 % diff --git a/app/src/main/res/values-th/input_zoom_strings.xml b/app/src/main/res/values-th/input_zoom_strings.xml new file mode 100644 index 0000000000..c22c370488 --- /dev/null +++ b/app/src/main/res/values-th/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + เพิ่มการซูมเกม + ลดการซูมเกม + \ No newline at end of file diff --git a/app/src/main/res/values-th/strings.xml b/app/src/main/res/values-th/strings.xml index 2a6703bcb1..ec38850755 100644 --- a/app/src/main/res/values-th/strings.xml +++ b/app/src/main/res/values-th/strings.xml @@ -4115,4 +4115,6 @@ ปิด Steam ก่อน หยุดการดาวน์โหลด Steam ชั่วคราวก่อน เกมนี้ติดตั้งเวอร์ชัน Linux ของตัวเอง ให้ติดตั้งจาก Steam + ซูมเกม + ปรับการขยายเกมตั้งแต่ 100% ถึง 300% diff --git a/app/src/main/res/values-tr/input_zoom_strings.xml b/app/src/main/res/values-tr/input_zoom_strings.xml new file mode 100644 index 0000000000..f786107728 --- /dev/null +++ b/app/src/main/res/values-tr/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + Oyun yakınlaştırmasını artır + Oyun yakınlaştırmasını azalt + \ No newline at end of file diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 68e7c29a2b..444f2d39e6 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -4145,4 +4145,6 @@ Önce Steam\'i kapatın Önce Steam indirmesini duraklatın Bu oyun Linux sürümünü yükler. Steam\'den yükleyin. + Oyun yakınlaştırma + Oyun yakınlaştırmasını %100 ile %300 arasında ayarlayın diff --git a/app/src/main/res/values-uk/input_zoom_strings.xml b/app/src/main/res/values-uk/input_zoom_strings.xml new file mode 100644 index 0000000000..608fb8f973 --- /dev/null +++ b/app/src/main/res/values-uk/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + Збільшити масштаб гри + Зменшити масштаб гри + \ No newline at end of file diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index d755474c4c..95f470b86c 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -4225,4 +4225,6 @@ Спочатку закрийте Steam Спочатку призупиніть завантаження Steam Ця гра встановлює свою версію для Linux. Установіть її зі Steam. + Масштаб гри + Налаштуйте збільшення гри від 100% до 300% diff --git a/app/src/main/res/values-vi/input_zoom_strings.xml b/app/src/main/res/values-vi/input_zoom_strings.xml new file mode 100644 index 0000000000..16dbcd0dcf --- /dev/null +++ b/app/src/main/res/values-vi/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + Tăng thu phóng trò chơi + Giảm thu phóng trò chơi + \ No newline at end of file diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml index a2f9c8274d..632bc75003 100644 --- a/app/src/main/res/values-vi/strings.xml +++ b/app/src/main/res/values-vi/strings.xml @@ -4115,4 +4115,6 @@ Hãy đóng Steam trước Hãy tạm dừng tải xuống Steam trước Trò chơi này cài bản dành cho Linux. Hãy cài từ Steam. + Thu phóng trò chơi + Điều chỉnh độ phóng đại trò chơi từ 100% đến 300% diff --git a/app/src/main/res/values-zh-rCN/input_zoom_strings.xml b/app/src/main/res/values-zh-rCN/input_zoom_strings.xml new file mode 100644 index 0000000000..cda779567a --- /dev/null +++ b/app/src/main/res/values-zh-rCN/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + 放大游戏画面 + 缩小游戏画面 + \ No newline at end of file diff --git a/app/src/main/res/values-zh-rHK/input_zoom_strings.xml b/app/src/main/res/values-zh-rHK/input_zoom_strings.xml new file mode 100644 index 0000000000..44fe64edb2 --- /dev/null +++ b/app/src/main/res/values-zh-rHK/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + 放大遊戲畫面 + 縮小遊戲畫面 + \ No newline at end of file diff --git a/app/src/main/res/values-zh-rTW/input_zoom_strings.xml b/app/src/main/res/values-zh-rTW/input_zoom_strings.xml new file mode 100644 index 0000000000..44fe64edb2 --- /dev/null +++ b/app/src/main/res/values-zh-rTW/input_zoom_strings.xml @@ -0,0 +1,5 @@ + + + 放大遊戲畫面 + 縮小遊戲畫面 + \ No newline at end of file diff --git a/app/src/main/res/values/input_strings.xml b/app/src/main/res/values/input_strings.xml index bc18c561a7..69e35ec0e3 100644 --- a/app/src/main/res/values/input_strings.xml +++ b/app/src/main/res/values/input_strings.xml @@ -21,6 +21,8 @@ Show keyboard Open Steam menu Open Steam quick access + Increase game zoom + Decrease game zoom Remove control Add control Device-specific buttons diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 49d7b80ceb..606e625431 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2795,6 +2795,8 @@ Keep proportions Stretch to display Image scaling + Adjust game magnification from 100% to 300% + Game zoom Integer scaling Uses the largest whole-number scale that fits. May crop screen edges. If the source is larger than the output, fractional scaling fits the full image. Resolution is configured separately. Fit diff --git a/app/src/test/java/com/droiddeck/launcher/input/InputProfilesTest.kt b/app/src/test/java/com/droiddeck/launcher/input/InputProfilesTest.kt index e5fc41f09a..1751c6dd54 100644 --- a/app/src/test/java/com/droiddeck/launcher/input/InputProfilesTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/input/InputProfilesTest.kt @@ -50,6 +50,8 @@ class InputProfilesTest { @Test fun bindingsAndDeviceKeysRoundTripWithoutAffectingOtherProfile() { val game = InputProfile.defaults(InputProfile.GAME) .withBinding(InputRole.SECONDARY, InputControl.A, InputAction.Keys(listOf(29, 30))) + .withBinding(InputRole.PRIMARY, InputControl.Y, InputAction.Command(InputCommand.GAME_ZOOM_IN)) + .withBinding(InputRole.PRIMARY, InputControl.B, InputAction.Command(InputCommand.GAME_ZOOM_OUT)) .copy(keys = listOf(PhysicalInputBinding(PhysicalInputKey("1:2:descriptor", "Thor", 131, 59), InputAction.Command(InputCommand.MENU)))) InputProfiles.save(context, game) assertEquals(game, InputProfiles.read(context, InputProfile.GAME)) diff --git a/tools/tests/pen_pointer_harness.c b/tools/tests/pen_pointer_harness.c index 01dd5b45b9..cec9cf72bf 100644 --- a/tools/tests/pen_pointer_harness.c +++ b/tools/tests/pen_pointer_harness.c @@ -52,6 +52,16 @@ static int vkp_output_to_scene(double ox, double oy, double *x, double *y) { (void)ox; (void)oy; (void)x; (void)y; return 0; } +static int vkp_scene_to_output(double sx, double sy, double *ox, double *oy) { + (void)sx; (void)sy; (void)ox; (void)oy; + return 0; +} + +static int vkp_zoom_pan_cursor(double ox, double oy) { + (void)ox; (void)oy; + return 0; +} + static struct surface *toplevel_at(double x, double y) { (void)y; return x < 1000 ? &a : &b; @@ -124,7 +134,8 @@ static void hover_away(void) { assert(!g_grab); pen(PEN_IN, 1500); assert(nevents == 2); - left(0, &pointer_a, &surface_a); focus(1, &pointer_b, &surface_b); + left(0, &pointer_a, &surface_a); + focus(1, &pointer_b, &surface_b); } int main(int argc, char **argv) { @@ -151,7 +162,8 @@ int main(int argc, char **argv) { } else if (!strcmp(c, "swap")) { pen(PEN_IN | PEN_RIGHT, 600); assert(nevents == 2 && g_grab == &a); - button(0, PRESS, BTN_RIGHT); button(1, RELEASE, BTN_LEFT); + button(0, PRESS, BTN_RIGHT); + button(1, RELEASE, BTN_LEFT); pen(PEN_IN | PEN_RIGHT, 1500); assert(nevents == 0 && g_grab == &a); pen(PEN_IN, 1500); diff --git a/tools/tests/test_output_refresh.py b/tools/tests/test_output_refresh.py index 96817b2f4f..e931c4b187 100644 --- a/tools/tests/test_output_refresh.py +++ b/tools/tests/test_output_refresh.py @@ -45,6 +45,8 @@ static int g_input_pipe[2] = {-1, -1}; static atomic_int g_output_refresh_mhz = 60000; static atomic_int g_output_refresh_pending; static atomic_int g_panel_rates_pending; +static atomic_int g_zoom_request_percent = 100; +static atomic_int g_zoom_request_pending; static int g_output_announced_refresh_mhz = 60000; static int g_output_w = 1920, g_output_h = 1080; static int flushes, resizes, pointers, ticks; @@ -77,6 +79,7 @@ static void on_vsync(int64_t ns) { assert(ns > 0); ticks++; } static void vk_present_set_scale_mode(int mode, int alignment) { scale_changes++; scale_mode = mode; scale_alignment = alignment; } +static void vk_present_set_zoom(float zoom) { (void)zoom; } static void schedule_render(void) { renders++; } static void refresh_notify_rates(void) { rate_notifies++; } '''