+2005-05-17 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkdrawable-x11.c (gdk_x11_ref_cairo_surface):
+ Update to changed cairo interface.
+
+ * gdk/x11/gdkdrawable-x11.[ch]:
+ Add _gdk_x11_drawable_update_size()
+
+ * gdk/x11/gdkwindow-x11.c (gdk_window_resize)
+ (gdk_window_move_resize)
+ * gdk/x11/gdkevents-x11.c (gdk_event_translate):
+ Call _gdk_x11_drawable_update_size().
+
2005-05-17 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktextview.c (cursor_blinks): Don't blink the cursor
+2005-05-17 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkdrawable-x11.c (gdk_x11_ref_cairo_surface):
+ Update to changed cairo interface.
+
+ * gdk/x11/gdkdrawable-x11.[ch]:
+ Add _gdk_x11_drawable_update_size()
+
+ * gdk/x11/gdkwindow-x11.c (gdk_window_resize)
+ (gdk_window_move_resize)
+ * gdk/x11/gdkevents-x11.c (gdk_event_translate):
+ Call _gdk_x11_drawable_update_size().
+
2005-05-17 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktextview.c (cursor_blinks): Don't blink the cursor
+2005-05-17 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkdrawable-x11.c (gdk_x11_ref_cairo_surface):
+ Update to changed cairo interface.
+
+ * gdk/x11/gdkdrawable-x11.[ch]:
+ Add _gdk_x11_drawable_update_size()
+
+ * gdk/x11/gdkwindow-x11.c (gdk_window_resize)
+ (gdk_window_move_resize)
+ * gdk/x11/gdkevents-x11.c (gdk_event_translate):
+ Call _gdk_x11_drawable_update_size().
+
2005-05-17 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktextview.c (cursor_blinks): Don't blink the cursor
}
}
+/**
+ * _gdk_x11_drawable_update_size:
+ * @drawable: a #GdkDrawableImplX11.
+ *
+ * Updates the state of the drawable (in particular the drawable's
+ * cairo surface) when its size has changed.
+ **/
+void
+_gdk_x11_drawable_update_size (GdkDrawable *drawable)
+{
+ GdkDrawableImplX11 *impl = GDK_DRAWABLE_IMPL_X11 (drawable);
+
+ if (impl->cairo_surface)
+ {
+ int width, height;
+
+ gdk_drawable_get_size (drawable, &width, &height);
+ cairo_xlib_surface_set_size (impl->cairo_surface, width, height);
+ }
+}
+
static void
try_pixmap (Display *xdisplay,
int screen,
if (!impl->cairo_surface)
{
GdkVisual *visual = NULL;
+ int width, height;
visual = gdk_drawable_get_visual (drawable);
+ gdk_drawable_get_size (drawable, &width, &height);
+
if (visual)
- impl->cairo_surface = cairo_xlib_surface_create_with_visual (GDK_SCREEN_XDISPLAY (impl->screen),
- impl->xid,
- GDK_VISUAL_XVISUAL (visual));
- else if (gdk_drawable_get_depth (drawable) == 1)
impl->cairo_surface = cairo_xlib_surface_create (GDK_SCREEN_XDISPLAY (impl->screen),
impl->xid,
- CAIRO_FORMAT_A1);
+ GDK_VISUAL_XVISUAL (visual),
+ width, height);
+ else if (gdk_drawable_get_depth (drawable) == 1)
+ impl->cairo_surface = cairo_xlib_surface_create_for_bitmap (GDK_SCREEN_XDISPLAY (impl->screen),
+ impl->xid,
+ width, height);
else
{
g_warning ("Using Cairo rendering requires the drawable argument to\n"
return NULL;
}
- if (GDK_IS_PIXMAP_IMPL_X11 (drawable))
- {
- GdkPixmapImplX11 *pix_impl = GDK_PIXMAP_IMPL_X11 (drawable);
- cairo_xlib_surface_set_size (impl->cairo_surface, pix_impl->width, pix_impl->height);
- }
-
cairo_surface_set_user_data (impl->cairo_surface, &gdk_x11_cairo_key,
drawable, gdk_x11_cairo_surface_destroy);
}
/* Note that the following take GdkDrawableImplX11, not the wrapper drawable */
void _gdk_x11_drawable_finish (GdkDrawable *drawable);
+void _gdk_x11_drawable_update_size (GdkDrawable *drawable);
#ifdef __cplusplus
}
window_private->y = event->configure.y;
window_impl->width = xevent->xconfigure.width;
window_impl->height = xevent->xconfigure.height;
+
+ _gdk_x11_drawable_update_size (window_private->impl);
+
if (window_private->resize_count >= 1)
{
window_private->resize_count -= 1;
{
_gdk_window_move_resize_child (window, private->x, private->y,
width, height);
+ _gdk_x11_drawable_update_size (private->impl);
}
else
{
{
impl->width = width;
impl->height = height;
+ _gdk_x11_drawable_update_size (private->impl);
}
else
{
private->resize_count += 1;
}
}
+
+ _gdk_x11_drawable_update_size (private->impl);
}
}
if (GDK_WINDOW_TYPE (private) == GDK_WINDOW_CHILD)
{
_gdk_window_move_resize_child (window, x, y, width, height);
+ _gdk_x11_drawable_update_size (private->impl);
}
else
{
private->y = y;
impl->width = width;
impl->height = height;
+
+ _gdk_x11_drawable_update_size (private->impl);
}
else
{