diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2013-02-28 15:03:04 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2013-03-18 10:21:58 +0100 |
commit | c12aeb860c63ba83190f962e2f0a1c5fe18ad3a6 (patch) | |
tree | 4ff23dade55c45cee495d330ad2a2c0d305e760d /ui/gtk.c | |
parent | da229ef3b3c5709b01d62e7a6e213b31bca33d16 (diff) | |
download | qemu-c12aeb860c63ba83190f962e2f0a1c5fe18ad3a6.zip qemu-c12aeb860c63ba83190f962e2f0a1c5fe18ad3a6.tar.gz qemu-c12aeb860c63ba83190f962e2f0a1c5fe18ad3a6.tar.bz2 |
console: rework DisplaySurface handling [dcl/ui side]
Replace the dpy_gfx_resize and dpy_gfx_setdata DisplayChangeListener
callbacks with a dpy_gfx_switch callback which notifies the ui code
when the framebuffer backing storage changes.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui/gtk.c')
-rw-r--r-- | ui/gtk.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -266,8 +266,9 @@ static void gd_refresh(DisplayChangeListener *dcl, vga_hw_update(); } -static void gd_resize(DisplayChangeListener *dcl, - DisplayState *ds) +static void gd_switch(DisplayChangeListener *dcl, + DisplayState *ds, + DisplaySurface *surface) { GtkDisplayState *s = container_of(dcl, GtkDisplayState, dcl); cairo_format_t kind; @@ -738,7 +739,7 @@ static void gd_menu_zoom_in(GtkMenuItem *item, void *opaque) s->scale_x += .25; s->scale_y += .25; - gd_resize(&s->dcl, s->ds); + gd_switch(&s->dcl, s->ds, s->ds->surface); } static void gd_menu_zoom_out(GtkMenuItem *item, void *opaque) @@ -754,7 +755,7 @@ static void gd_menu_zoom_out(GtkMenuItem *item, void *opaque) s->scale_x = MAX(s->scale_x, .25); s->scale_y = MAX(s->scale_y, .25); - gd_resize(&s->dcl, s->ds); + gd_switch(&s->dcl, s->ds, s->ds->surface); } static void gd_menu_zoom_fixed(GtkMenuItem *item, void *opaque) @@ -764,7 +765,7 @@ static void gd_menu_zoom_fixed(GtkMenuItem *item, void *opaque) s->scale_x = 1.0; s->scale_y = 1.0; - gd_resize(&s->dcl, s->ds); + gd_switch(&s->dcl, s->ds, s->ds->surface); } static void gd_menu_zoom_fit(GtkMenuItem *item, void *opaque) @@ -778,7 +779,7 @@ static void gd_menu_zoom_fit(GtkMenuItem *item, void *opaque) s->free_scale = FALSE; } - gd_resize(&s->dcl, s->ds); + gd_switch(&s->dcl, s->ds, s->ds->surface); gdk_drawable_get_size(gtk_widget_get_window(s->drawing_area), &ww, &wh); gtk_widget_queue_draw_area(s->drawing_area, 0, 0, ww, wh); @@ -1287,7 +1288,7 @@ static void gd_create_menus(GtkDisplayState *s) static const DisplayChangeListenerOps dcl_ops = { .dpy_name = "gtk", .dpy_gfx_update = gd_update, - .dpy_gfx_resize = gd_resize, + .dpy_gfx_switch = gd_switch, .dpy_refresh = gd_refresh, }; |