summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2020-12-01 16:40:30 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2020-12-01 16:40:30 +0400
commitb0651e424a7bf44f02e17b074015218180699371 (patch)
treee17d132eebc221358ebf785d4f9afbe71bad1997
parent1068e4d0e39f3d8f3390102863a02eaed7ee81b1 (diff)
Revert "spice-widget: add an API to get guest display size"
This reverts commit 18dfbb9e7974d153a1758aef58208591111de80e. The motivation behind the new API isn't clear enough. The guest display size can be retrieved through the "width" and "height" properties of the associated display channel. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
-rw-r--r--src/map-file1
-rw-r--r--src/spice-glib-sym-file1
-rw-r--r--src/spice-widget.c19
-rw-r--r--src/spice-widget.h1
-rw-r--r--tools/spicy.c3
5 files changed, 2 insertions, 23 deletions
diff --git a/src/map-file b/src/map-file
index 8ceaeb1..bb85702 100644
--- a/src/map-file
+++ b/src/map-file
@@ -33,7 +33,6 @@ spice_display_channel_gl_draw_done;
spice_display_get_gl_scanout;
spice_display_get_grab_keys;
spice_display_get_pixbuf;
-spice_display_get_preferred_size;
spice_display_get_primary;
spice_display_get_type;
spice_display_gl_draw_done;
diff --git a/src/spice-glib-sym-file b/src/spice-glib-sym-file
index a8bfe1d..2cc80aa 100644
--- a/src/spice-glib-sym-file
+++ b/src/spice-glib-sym-file
@@ -29,7 +29,6 @@ spice_display_channel_get_primary
spice_display_channel_get_type
spice_display_channel_gl_draw_done
spice_display_get_gl_scanout
-spice_display_get_preferred_size
spice_display_get_primary
spice_display_gl_draw_done
spice_file_transfer_task_cancel
diff --git a/src/spice-widget.c b/src/spice-widget.c
index eaf9e91..c39af82 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -3588,22 +3588,3 @@ GdkPixbuf *spice_display_get_pixbuf(SpiceDisplay *display)
return pixbuf;
}
-
-/**
- * spice_display_get_preferred_size:
- * @display: a #SpiceDisplay
- * @width: the preferred width of the display, in physical pixel
- * @height: the preferred height of the display, in physical pixel
- *
- * Get the preferred width and height of the display.
- **/
-void spice_display_get_preferred_size(SpiceDisplay *display, int *width, int *height)
-{
- SpiceDisplayPrivate *d = display->priv;
-
- if (width)
- *width = d->area.width;
-
- if (height)
- *height = d->area.height;
-}
diff --git a/src/spice-widget.h b/src/spice-widget.h
index ead5d7c..e0b1fb3 100644
--- a/src/spice-widget.h
+++ b/src/spice-widget.h
@@ -79,7 +79,6 @@ SpiceGrabSequence *spice_display_get_grab_keys(SpiceDisplay *display);
void spice_display_send_keys(SpiceDisplay *display, const guint *keyvals,
int nkeyvals, SpiceDisplayKeyEvent kind);
GdkPixbuf *spice_display_get_pixbuf(SpiceDisplay *display);
-void spice_display_get_preferred_size(SpiceDisplay *display, int *width, int *height);
G_END_DECLS
diff --git a/tools/spicy.c b/tools/spicy.c
index 437a298..8ca62f9 100644
--- a/tools/spicy.c
+++ b/tools/spicy.c
@@ -587,7 +587,8 @@ static void menu_cb_resize_to(GtkAction *action G_GNUC_UNUSED,
spin_x = gtk_spin_button_new_with_range(0, G_MAXINT, 10);
spin_y = gtk_spin_button_new_with_range(0, G_MAXINT, 10);
- spice_display_get_preferred_size(SPICE_DISPLAY(win->spice), &width, &height);
+ gtk_widget_get_preferred_width(win->spice, NULL, &width);
+ gtk_widget_get_preferred_height(win->spice, NULL, &height);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin_width), width);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin_height), height);