ui/gtk-egl: apply scale factor when calculating window's dimension
PATCH 1/1 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 <[email protected]>
Signed-off-by Dongwon Kim <[email protected]>
--- ui/gtk-egl.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
ui/gtk-egl.c +8 -6
@@ -69,15 +69,16 @@ void gd_egl_draw(VirtualConsole *vc)#ifdef CONFIG_GBM QemuDmaBuf *dmabuf = vc->gfx.guest_fb.dmabuf;#endif -int ww, wh; +int ww, wh, ws;if (!vc->gfx.gls) {return ; } window =gtk_widget_get_window (vc->gfx.drawing_area); - ww =gdk_window_get_width (window); - wh =gdk_window_get_height (window); + ws =gdk_window_get_scale_factor (window); + ww =gdk_window_get_width (window) * ws; + wh =gdk_window_get_height (window) * ws;if (vc->gfx.scanout_mode) {#ifdef CONFIG_GBM
@@ -312,7 +313,7 @@ void gd_egl_scanout_flush(DisplayChangeListener *dcl, {VirtualConsole *vc =container_of (dcl, VirtualConsole, gfx.dcl);GdkWindow *window; -int ww, wh; +int ww, wh, ws;if (!vc->gfx.scanout_mode) {return ;
@@ -325,8 +326,9 @@ void gd_egl_scanout_flush(DisplayChangeListener *dcl, vc->gfx.esurface, vc->gfx.ectx); window =gtk_widget_get_window (vc->gfx.drawing_area); - ww =gdk_window_get_width (window); - wh =gdk_window_get_height (window); + ws =gdk_window_get_scale_factor (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);if (vc->gfx.cursor_fb.texture) { egl_texture_blit(vc->gfx.gls, &vc->gfx.win_fb, &vc->gfx.guest_fb,
Signature · 1 line
2.20.1
Quoted 6 lines · Dongwon Kim
Scale factor needs to be applied when calculating width/height of the GTK windows.
Cc Marc-André Lureau <[email protected]>Signed-off-by Dongwon Kim <[email protected]>
Reviewed-by Marc-André Lureau <[email protected]>
Quoted 53 lines
--- ui/gtk-egl.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)ui/gtk-egl.c +8
-7@@ -69,15 +69,16 @@ void gd_egl_draw(VirtualConsole *vc)#ifdef CONFIG_GBM QemuDmaBuf *dmabuf = vc->gfx.guest_fb.dmabuf;#endif -int ww, wh; +int ww, wh, ws;if (!vc->gfx.gls) {return ; } window =gtk_widget_get_window (vc->gfx.drawing_area); - ww =gdk_window_get_width (window); - wh =gdk_window_get_height (window); + ws =gdk_window_get_scale_factor (window); + ww =gdk_window_get_width (window) * ws; + wh =gdk_window_get_height (window) * ws;if (vc->gfx.scanout_mode) {#ifdef CONFIG_GBM @@ -312,7 +313,7 @@ void gd_egl_scanout_flush(DisplayChangeListener *dcl, {VirtualConsole *vc =container_of (dcl, VirtualConsole, gfx.dcl);GdkWindow *window; -int ww, wh; +int ww, wh, ws;if (!vc->gfx.scanout_mode) {return ;@@ -325,8 +326,9 @@ void gd_egl_scanout_flush(DisplayChangeListener *dcl, vc->gfx.esurface, vc->gfx.ectx); window =gtk_widget_get_window (vc->gfx.drawing_area); - ww =gdk_window_get_width (window); - wh =gdk_window_get_height (window); + ws =gdk_window_get_scale_factor (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);if (vc->gfx.cursor_fb.texture) { egl_texture_blit(vc->gfx.gls, &vc->gfx.win_fb, &vc->gfx.guest_fb, --2.20.1
Signature · 1 line
Marc-André Lureau