aboutsummaryrefslogtreecommitdiff
path: root/ui/gtk.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2013-02-28 15:03:04 +0100
committerGerd Hoffmann <kraxel@redhat.com>2013-03-18 10:21:58 +0100
commitc12aeb860c63ba83190f962e2f0a1c5fe18ad3a6 (patch)
tree4ff23dade55c45cee495d330ad2a2c0d305e760d /ui/gtk.c
parentda229ef3b3c5709b01d62e7a6e213b31bca33d16 (diff)
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.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/ui/gtk.c b/ui/gtk.c
index b21a94a335..967a36cc4e 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -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,
};