[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 03/19] ui/gtk-egl: fix scaling for cursor position in scanout mode
|
From: |
marcandre . lureau |
|
Subject: |
[PULL 03/19] ui/gtk-egl: fix scaling for cursor position in scanout mode |
|
Date: |
Sun, 28 May 2023 17:20:00 +0400 |
From: Erico Nunes <ernunes@redhat.com>
vc->gfx.w and vc->gfx.h are not updated appropriately in this code path,
which leads to a different scaling factor for rendering the cursor on
some edge cases (e.g. the focus has left and re-entered the gtk window).
This can be reproduced using vhost-user-gpu with the gtk ui on the x11
backend.
Use the surface dimensions which are already updated accordingly.
Signed-off-by: Erico Nunes <ernunes@redhat.com>
Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20230320160856.364319-2-ernunes@redhat.com>
---
ui/gtk-egl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c
index 557668e418..19130041bc 100644
--- a/ui/gtk-egl.c
+++ b/ui/gtk-egl.c
@@ -88,8 +88,8 @@ void gd_egl_draw(VirtualConsole *vc)
#endif
gd_egl_scanout_flush(&vc->gfx.dcl, 0, 0, vc->gfx.w, vc->gfx.h);
- vc->gfx.scale_x = (double)ww / vc->gfx.w;
- vc->gfx.scale_y = (double)wh / vc->gfx.h;
+ vc->gfx.scale_x = (double)ww / surface_width(vc->gfx.ds);
+ vc->gfx.scale_y = (double)wh / surface_height(vc->gfx.ds);
glFlush();
#ifdef CONFIG_GBM
--
2.40.1
- [PULL 00/19] Ui patches, marcandre . lureau, 2023/05/28
- [PULL 01/19] ui/gtk: fix passing y0_top parameter to scanout, marcandre . lureau, 2023/05/28
- [PULL 03/19] ui/gtk-egl: fix scaling for cursor position in scanout mode,
marcandre . lureau <=
- [PULL 02/19] ui/gtk: use widget size for cursor motion event, marcandre . lureau, 2023/05/28
- [PULL 04/19] ui/sdl2: fix surface_gl_update_texture: Assertion 'gls' failed, marcandre . lureau, 2023/05/28
- [PULL 05/19] ui/dbus: fix compilation when GBM && !OPENGL, marcandre . lureau, 2023/05/28
- [PULL 06/19] win32: wrap socket close() with an exception handler, marcandre . lureau, 2023/05/28
- [PULL 07/19] virtio-gpu: add a FIXME for virtio_gpu_load(), marcandre . lureau, 2023/05/28
- [PULL 08/19] gtk: add gl-area support on win32, marcandre . lureau, 2023/05/28
- [PULL 09/19] ui/dbus: add a FIXME about texture/dmabuf scanout handling, marcandre . lureau, 2023/05/28
- [PULL 10/19] ui/sdl2: Grab Alt+Tab also in fullscreen mode, marcandre . lureau, 2023/05/28
- [PULL 11/19] ui/sdl2: Grab Alt+F4 also under Windows, marcandre . lureau, 2023/05/28
- [PULL 12/19] ui/sdl2: disable SDL_HINT_GRAB_KEYBOARD on Windows, marcandre . lureau, 2023/05/28