mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
ui/gtk-egl: apply scale factor when calculating window's dimension
Scale factor needs to be applied when calculating width/height of the GTK windows. Cc: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Dongwon Kim <dongwon.kim@intel.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20231012222643.13996-1-dongwon.kim@intel.com>
This commit is contained in:
parent
6f189a08c1
commit
47fd6ab1e3
1 changed files with 8 additions and 6 deletions
14
ui/gtk-egl.c
14
ui/gtk-egl.c
|
@ -69,15 +69,16 @@ void gd_egl_draw(VirtualConsole *vc)
|
||||||
#ifdef CONFIG_GBM
|
#ifdef CONFIG_GBM
|
||||||
QemuDmaBuf *dmabuf = vc->gfx.guest_fb.dmabuf;
|
QemuDmaBuf *dmabuf = vc->gfx.guest_fb.dmabuf;
|
||||||
#endif
|
#endif
|
||||||
int ww, wh;
|
int ww, wh, ws;
|
||||||
|
|
||||||
if (!vc->gfx.gls) {
|
if (!vc->gfx.gls) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
window = gtk_widget_get_window(vc->gfx.drawing_area);
|
window = gtk_widget_get_window(vc->gfx.drawing_area);
|
||||||
ww = gdk_window_get_width(window);
|
ws = gdk_window_get_scale_factor(window);
|
||||||
wh = gdk_window_get_height(window);
|
ww = gdk_window_get_width(window) * ws;
|
||||||
|
wh = gdk_window_get_height(window) * ws;
|
||||||
|
|
||||||
if (vc->gfx.scanout_mode) {
|
if (vc->gfx.scanout_mode) {
|
||||||
#ifdef CONFIG_GBM
|
#ifdef CONFIG_GBM
|
||||||
|
@ -319,7 +320,7 @@ void gd_egl_scanout_flush(DisplayChangeListener *dcl,
|
||||||
{
|
{
|
||||||
VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);
|
VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);
|
||||||
GdkWindow *window;
|
GdkWindow *window;
|
||||||
int ww, wh;
|
int ww, wh, ws;
|
||||||
|
|
||||||
if (!vc->gfx.scanout_mode) {
|
if (!vc->gfx.scanout_mode) {
|
||||||
return;
|
return;
|
||||||
|
@ -332,8 +333,9 @@ void gd_egl_scanout_flush(DisplayChangeListener *dcl,
|
||||||
vc->gfx.esurface, vc->gfx.ectx);
|
vc->gfx.esurface, vc->gfx.ectx);
|
||||||
|
|
||||||
window = gtk_widget_get_window(vc->gfx.drawing_area);
|
window = gtk_widget_get_window(vc->gfx.drawing_area);
|
||||||
ww = gdk_window_get_width(window);
|
ws = gdk_window_get_scale_factor(window);
|
||||||
wh = gdk_window_get_height(window);
|
ww = gdk_window_get_width(window) * ws;
|
||||||
|
wh = gdk_window_get_height(window) * ws;
|
||||||
egl_fb_setup_default(&vc->gfx.win_fb, ww, wh);
|
egl_fb_setup_default(&vc->gfx.win_fb, ww, wh);
|
||||||
if (vc->gfx.cursor_fb.texture) {
|
if (vc->gfx.cursor_fb.texture) {
|
||||||
egl_texture_blit(vc->gfx.gls, &vc->gfx.win_fb, &vc->gfx.guest_fb,
|
egl_texture_blit(vc->gfx.gls, &vc->gfx.win_fb, &vc->gfx.guest_fb,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue