mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/virt-viewer
synced 2026-01-08 21:14:16 +00:00
spice: if zoom-level is changed, resize guest, even in fullscreen
This commit is contained in:
parent
dc59eeb3b8
commit
323d85d18a
@ -250,6 +250,20 @@ virt_viewer_display_spice_size_allocate(VirtViewerDisplaySpice *self,
|
||||
self->priv->auto_resize = AUTO_RESIZE_NEVER;
|
||||
}
|
||||
|
||||
static void
|
||||
zoom_level_changed(VirtViewerDisplaySpice *self,
|
||||
GParamSpec *pspec G_GNUC_UNUSED,
|
||||
VirtViewerApp *app G_GNUC_UNUSED)
|
||||
{
|
||||
GtkAllocation allocation;
|
||||
|
||||
if (self->priv->auto_resize != AUTO_RESIZE_NEVER)
|
||||
return;
|
||||
|
||||
gtk_widget_get_allocation(GTK_WIDGET(self), &allocation);
|
||||
virt_viewer_display_spice_resize(self, &allocation, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
enable_accel_changed(VirtViewerApp *app,
|
||||
GParamSpec *pspec G_GNUC_UNUSED,
|
||||
@ -338,6 +352,8 @@ virt_viewer_display_spice_new(VirtViewerSessionSpice *session,
|
||||
G_CALLBACK(enable_accel_changed), self, 0);
|
||||
virt_viewer_signal_connect_object(self, "notify::fullscreen",
|
||||
G_CALLBACK(fullscreen_changed), app, 0);
|
||||
virt_viewer_signal_connect_object(self, "notify::zoom-level",
|
||||
G_CALLBACK(zoom_level_changed), app, 0);
|
||||
fullscreen_changed(self, NULL, app);
|
||||
enable_accel_changed(app, NULL, self);
|
||||
|
||||
|
||||
@ -566,6 +566,7 @@ void virt_viewer_display_set_zoom_level(VirtViewerDisplay *display,
|
||||
priv->zoom_level = zoom;
|
||||
|
||||
virt_viewer_display_queue_resize(display);
|
||||
g_object_notify(G_OBJECT(display), "zoom-level");
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user