mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice-gtk
synced 2026-02-03 20:30:35 +00:00
SpiceWidget: limit scope of 'area' variable
'area' was being set within the 'else' branch, but was not actually used. So just move the declaration of 'area' within the if statement where it is actually used. This potentially avoids "set-but-not-used" warnings when GDK_WINDOWING_X11 is not defined.
This commit is contained in:
parent
32c59ee473
commit
ea1f4c9ce6
@ -1195,7 +1195,6 @@ static gboolean do_color_convert(SpiceDisplay *display, GdkRectangle *r)
|
||||
static void set_egl_enabled(SpiceDisplay *display, bool enabled)
|
||||
{
|
||||
SpiceDisplayPrivate *d = display->priv;
|
||||
GtkWidget *area;
|
||||
|
||||
if (egl_enabled(d) == enabled)
|
||||
return;
|
||||
@ -1205,12 +1204,11 @@ static void set_egl_enabled(SpiceDisplay *display, bool enabled)
|
||||
/* even though the function is marked as deprecated, it's the
|
||||
* only way I found to prevent glitches when the window is
|
||||
* resized. */
|
||||
area = gtk_stack_get_child_by_name(d->stack, "draw-area");
|
||||
GtkWidget *area = gtk_stack_get_child_by_name(d->stack, "draw-area");
|
||||
gtk_widget_set_double_buffered(GTK_WIDGET(area), !enabled);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
area = gtk_stack_get_child_by_name(d->stack, "gl-area");
|
||||
gtk_stack_set_visible_child_name(d->stack,
|
||||
enabled ? "gl-area" : "draw-area");
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user