diff options
author | Mike Gilbert <floppym@gentoo.org> | 2021-12-24 16:44:35 -0500 |
---|---|---|
committer | Mike Gilbert <floppym@gentoo.org> | 2021-12-24 19:02:15 -0500 |
commit | 65870053ec411056eefe286d150b3707bc68d539 (patch) | |
tree | 3bdb19803a3d43dc52a0a0a0b352cf7ceaf13928 /net-misc/spice-gtk/files | |
parent | dev-libs/libgusb: drop 0.3.7 (diff) | |
download | gentoo-65870053ec411056eefe286d150b3707bc68d539.tar.gz gentoo-65870053ec411056eefe286d150b3707bc68d539.tar.bz2 gentoo-65870053ec411056eefe286d150b3707bc68d539.zip |
net-misc/spice-gtk: drop 0.37-r3, 0.38-r2, 0.38-r3
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
Diffstat (limited to 'net-misc/spice-gtk/files')
-rw-r--r-- | net-misc/spice-gtk/files/spice-gtk-0.37-adjust-to-window-scaling.patch | 132 |
1 files changed, 0 insertions, 132 deletions
diff --git a/net-misc/spice-gtk/files/spice-gtk-0.37-adjust-to-window-scaling.patch b/net-misc/spice-gtk/files/spice-gtk-0.37-adjust-to-window-scaling.patch deleted file mode 100644 index 504cb7c4848b..000000000000 --- a/net-misc/spice-gtk/files/spice-gtk-0.37-adjust-to-window-scaling.patch +++ /dev/null @@ -1,132 +0,0 @@ -From 262c84081fbd3cfc3d92e6ae9a60a780549d6c2f Mon Sep 17 00:00:00 2001 -From: Snir Sheriber <ssheribe@redhat.com> -Date: Thu, 28 Feb 2019 11:44:34 +0200 -Subject: [PATCH] Adjust to window scaling - -When GDK_SCALE is != 1 and egl is used, the image presented does not -fit to the window (scale of 2 is often used with hidpi monitors). -Usually this is not a problem since all components are adjusted by -gdk/gtk but with egl, pixel-based data is not being scaled. In this -case window's scale value can be used in order to determine whether -to use a pixel resource with higher resolution data. - -In order to reproduce the problem set spice with virgl/Intel-vGPU -and run spice-gtk with GDK_SCALE=2 - -This issue was also reported at freedesktop gitlab repo: -https://gitlab.freedesktop.org/spice/spice-gtk/issues/99 - -Signed-off-by: Snir Sheriber <ssheribe@redhat.com> -Acked-by: Victor Toso <victortoso@redhat.com> ---- - src/spice-widget-egl.c | 7 ++++--- - src/spice-widget.c | 27 +++++++++++++++++++-------- - 2 files changed, 23 insertions(+), 11 deletions(-) - -diff --git a/src/spice-widget-egl.c b/src/spice-widget-egl.c -index 43fccd7..7bae4e5 100644 ---- a/src/spice-widget-egl.c -+++ b/src/spice-widget-egl.c -@@ -360,9 +360,9 @@ gboolean spice_egl_realize_display(SpiceDisplay *display, GdkWindow *win, GError - DISPLAY_DEBUG(display, "egl realize"); - if (!spice_widget_init_egl_win(display, win, err)) - return FALSE; -- -- spice_egl_resize_display(display, gdk_window_get_width(win), -- gdk_window_get_height(win)); -+ gint scale_factor = gtk_widget_get_scale_factor(GTK_WIDGET(display)); -+ spice_egl_resize_display(display, gdk_window_get_width(win) * scale_factor, -+ gdk_window_get_height(win) * scale_factor); - - return TRUE; - } -@@ -426,6 +426,7 @@ void spice_egl_unrealize_display(SpiceDisplay *display) - #endif - } - -+/* w and h should be adjusted to gdk scaling */ - G_GNUC_INTERNAL - void spice_egl_resize_display(SpiceDisplay *display, int w, int h) - { -diff --git a/src/spice-widget.c b/src/spice-widget.c -index 1f2a154..a9ba1f1 100644 ---- a/src/spice-widget.c -+++ b/src/spice-widget.c -@@ -1382,7 +1382,8 @@ static void set_egl_enabled(SpiceDisplay *display, bool enabled) - } - - if (enabled && d->egl.context_ready) { -- spice_egl_resize_display(display, d->ww, d->wh); -+ gint scale_factor = gtk_widget_get_scale_factor(GTK_WIDGET(display)); -+ spice_egl_resize_display(display, d->ww * scale_factor, d->wh * scale_factor); - } - - d->egl.enabled = enabled; -@@ -1978,11 +1979,14 @@ static void transform_input(SpiceDisplay *display, - SpiceDisplayPrivate *d = display->priv; - int display_x, display_y, display_w, display_h; - double is; -+ gint scale_factor = 1; - - spice_display_get_scaling(display, NULL, - &display_x, &display_y, - &display_w, &display_h); -- -+ if (egl_enabled(d)) { -+ scale_factor = gtk_widget_get_scale_factor(GTK_WIDGET(display)); -+ } - /* For input we need a different scaling factor in order to - be able to reach the full width of a display. For instance, consider - a display of 100 pixels showing in a window 10 pixels wide. The normal -@@ -1998,7 +2002,7 @@ static void transform_input(SpiceDisplay *display, - coordinates in the inverse direction (window -> display) as the fb size - (display -> window). - */ -- is = (double)(d->area.width-1) / (double)(display_w-1); -+ is = ((double)(d->area.width-1) / (double)(display_w-1)) * scale_factor; - - window_x -= display_x; - window_y -= display_y; -@@ -2183,8 +2187,10 @@ static void size_allocate(GtkWidget *widget, GtkAllocation *conf, gpointer data) - d->wh = conf->height; - recalc_geometry(widget); - #if HAVE_EGL -- if (egl_enabled(d)) -- spice_egl_resize_display(display, conf->width, conf->height); -+ if (egl_enabled(d)) { -+ gint scale_factor = gtk_widget_get_scale_factor(widget); -+ spice_egl_resize_display(display, conf->width * scale_factor, conf->height * scale_factor); -+ } - #endif - } - -@@ -2942,10 +2948,14 @@ void spice_display_get_scaling(SpiceDisplay *display, - int ww, wh; - int x, y, w, h; - double s; -+ gint scale_factor = 1; - - if (gtk_widget_get_realized (GTK_WIDGET(display))) { -- ww = gtk_widget_get_allocated_width(GTK_WIDGET(display)); -- wh = gtk_widget_get_allocated_height(GTK_WIDGET(display)); -+ if (egl_enabled(d)) { -+ scale_factor = gtk_widget_get_scale_factor(GTK_WIDGET(display)); -+ } -+ ww = gtk_widget_get_allocated_width(GTK_WIDGET(display)) * scale_factor; -+ wh = gtk_widget_get_allocated_height(GTK_WIDGET(display)) * scale_factor; - } else { - ww = fbw; - wh = fbh; -@@ -3091,7 +3101,8 @@ void spice_display_widget_gl_scanout(SpiceDisplay *display) - g_clear_error(&err); - } - -- spice_egl_resize_display(display, d->ww, d->wh); -+ gint scale_factor = gtk_widget_get_scale_factor(GTK_WIDGET(display)); -+ spice_egl_resize_display(display, d->ww * scale_factor, d->wh * scale_factor); - } - #endif - --- -2.21.0 - |