imlib2 fixed, i forgot when the window size changes we totally destroy the pixmap...
[monky] / src / imlib2.c
index 1670b8f..0ffce8c 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Please see COPYING for details
  *
- * Copyright (c) 2005-2009 Brenden Matthews, et. al.
+ * Copyright (c) 2005-2010 Brenden Matthews, et. al.
  * All rights reserved.
  *
  * This program is free software: you can redistribute it and/or modify
@@ -87,7 +87,8 @@ void cimlib_cleanup(void)
 
 Imlib_Context context;
 
-void cimlib_init(Display *disp, Window drawable, Visual *visual, Colormap
+
+void cimlib_init(Display *disp, Drawable drawable, Visual *visual, Colormap
                colourmap)
 {
        image_list_start = image_list_end = NULL;
@@ -109,7 +110,7 @@ void cimlib_deinit(void)
 {
        cimlib_cleanup();
        cache_size_set = 0;
-       imlib_context_disconnect_display();
+//     imlib_context_disconnect_display();
        imlib_context_pop();
        imlib_context_free(context);
 }
@@ -230,8 +231,8 @@ void cimlib_render(int x, int y, int width, int height)
        time_t now;
 
        if (!image_list_start) return; /* are we actually drawing anything? */
-
-       /* cheque if it's time to flush our cache */
+        fprintf(stderr, PACKAGE_NAME": cimlib_render start\n");
+       /* check if it's time to flush our cache */
        now = time(NULL);
        if (cimlib_cache_flush_interval && now - cimlib_cache_flush_interval > cimlib_cache_flush_last) {
                int size = imlib_get_cache_size();
@@ -240,7 +241,6 @@ void cimlib_render(int x, int y, int width, int height)
                cimlib_cache_flush_last = now;
                DBGP("Flushing Imlib2 cache (%li)\n", now);
        }
-
        /* take all the little rectangles to redraw and merge them into
         * something sane for rendering */
        buffer = imlib_create_image(width, height);
@@ -251,16 +251,12 @@ void cimlib_render(int x, int y, int width, int height)
        imlib_context_set_blend(1);
        /* turn alpha channel on */
        imlib_image_set_has_alpha(1);
-
        cimlib_draw_all(&clip_x, &clip_y, &clip_x2, &clip_y2);
-
        /* set the buffer image as our current image */
        imlib_context_set_image(buffer);
-
        /* setup our clip rect */
        if (clip_x == INT_MAX) clip_x = 0;
        if (clip_y == INT_MAX) clip_y = 0;
-
        /* render the image at 0, 0 */
        imlib_render_image_part_on_drawable_at_size(clip_x, clip_y, clip_x2 - clip_x,
                        clip_y2 - clip_y, x + clip_x, y + clip_y, clip_x2 - clip_x,