repo: rxvt-unicode-sixel action: commit revision: path_from: revision_from: dac529cbb5c6be4941339a82a90d35bd084168c0: path_to: revision_to:
commit dac529cbb5c6be4941339a82a90d35bd084168c0 Author: Emanuele GiaquintaDate: Fri Jan 28 00:20:47 2011 +0000 Change 'have_image' boolean to a flag. diff --git a/src/background.C b/src/background.C
--- a/src/background.C
+++ b/src/background.C
@@ -101,7 +101,7 @@ rxvt_term::bg_window_size_sensitive ()
# endif
# ifdef BG_IMAGE_FROM_FILE
- if (have_image)
+ if (bg_flags & BG_IS_FROM_FILE)
{
if (bg_flags & BG_IS_SIZE_SENSITIVE)
return true;
@@ -120,7 +120,7 @@ rxvt_term::bg_window_position_sensitive ()
# endif
# ifdef BG_IMAGE_FROM_FILE
- if (have_image)
+ if (bg_flags & BG_IS_FROM_FILE)
{
if (bg_flags & BG_ROOT_ALIGN)
return true;
@@ -870,8 +870,7 @@ rxvt_term::bg_set_file (const char *file)
if (original_asim)
safe_asimage_destroy (original_asim);
original_asim = image;
- bg_flags |= BG_CLIENT_RENDER;
- have_image = true;
+ bg_flags |= BG_IS_FROM_FILE | BG_CLIENT_RENDER;
return true;
}
# endif
@@ -883,7 +882,7 @@ rxvt_term::bg_set_file (const char *file)
if (pixbuf)
g_object_unref (pixbuf);
pixbuf = image;
- have_image = true;
+ bg_flags |= BG_IS_FROM_FILE;
return true;
}
# endif
@@ -1352,7 +1351,7 @@ rxvt_term::bg_render ()
# endif
# ifdef BG_IMAGE_FROM_FILE
- if (have_image
+ if ((bg_flags & BG_IS_FROM_FILE)
|| (tr_flags & BG_EFFECTS_FLAGS))
{
if (render_image (tr_flags))
diff --git a/src/rxvt.h b/src/rxvt.h
--- a/src/rxvt.h
+++ b/src/rxvt.h
@@ -1140,6 +1140,7 @@ struct rxvt_term : zero_initialized, rxvt_vars, rxvt_screen
BG_IS_TRANSPARENT = 1 << 10,
BG_NEEDS_REFRESH = 1 << 11,
BG_IS_SIZE_SENSITIVE = 1 << 12,
+ BG_IS_FROM_FILE = 1 << 13,
};
unsigned int bg_flags;
@@ -1147,7 +1148,6 @@ struct rxvt_term : zero_initialized, rxvt_vars, rxvt_screen
# ifdef BG_IMAGE_FROM_FILE
void get_image_geometry (int image_width, int image_height, int &w, int &h, int &x, int &y);
bool render_image (unsigned long tr_flags);
- bool have_image;
enum {
noScale = 0,
-----END OF PAGE-----