Tue May 2 16:56:47 PDT 2000 Michael Jennings <mej@eterm.org>

After getting sick of hearing people whining about the obscure error
	messages that resulted from trying to build without pixmap support, I
	hacked it until it at least built without it.  I also added warnings
	to configure.in so that people would know if that happened.

	It's still not very happy running that way, which is something I need
	to fix.  But hopefully it will stop the whining.

	Yeah, right. =P


SVN revision: 2590
This commit is contained in:
Michael Jennings 2000-05-02 23:46:08 +00:00
parent afda3ff59a
commit 4bb04764b3
14 changed files with 142 additions and 55 deletions

View File

@ -3530,3 +3530,16 @@ Thu Apr 27 19:54:28 PDT 2000 Michael Jennings <mej@eterm.org>
people without shared library dependencies working.
-------------------------------------------------------------------------------
Tue May 2 16:56:47 PDT 2000 Michael Jennings <mej@eterm.org>
After getting sick of hearing people whining about the obscure error
messages that resulted from trying to build without pixmap support, I
hacked it until it at least built without it. I also added warnings
to configure.in so that people would know if that happened.
It's still not very happy running that way, which is something I need
to fix. But hopefully it will stop the whining.
Yeah, right. =P
-------------------------------------------------------------------------------

View File

@ -287,6 +287,10 @@ AC_ARG_WITH(imlib,
AC_MSG_RESULT(no)
GRLIBS=""
USE_IMLIB=0
AC_WARN(*** Pixmap support has been disabled at your request. This ***)
AC_WARN(*** is generally a bad idea since it really doesn't save ***)
AC_WARN(*** much memory. And the developers almost never test that ***)
AC_WARN(*** configuration. So I'd reconsider if I were you.... ***)
fi, AC_MSG_RESULT(yes)
USE_IMLIB=1
)
@ -299,6 +303,10 @@ if test $USE_IMLIB -eq 1 ; then
AC_DEFINE(PIXMAP_SUPPORT)
AC_DEFINE(BACKING_STORE)
,
AC_WARN(*** Pixmap support has been disabled because Imlib2 was not found ***)
AC_WARN(*** or could not be linked. Eterm should still work, but it will ***)
AC_WARN(*** not be very happy. Check config.log for more detailed ***)
AC_WARN(*** information on why my attempt to link with Imlib2 failed. ***)
, $SUBLIBS $X_LIBS $GRLIBS)
fi
@ -722,6 +730,8 @@ if test -z "$GRLIBS"; then
mv doc/Makefile.new doc/Makefile
fi
test $USE_IMLIB = 0 && GRLIBS="*** WARNING: Pixmap support disabled! ***"
echo "
$PACKAGE $VERSION
Configuration:

View File

@ -373,6 +373,7 @@ button_calc_size(buttonbar_t *bbar, button_t *button)
button->h += bord->top + bord->bottom;
}
}
#ifdef PIXMAP_SUPPORT
if (button->icon) {
unsigned short b = 0;
@ -393,6 +394,7 @@ button_calc_size(buttonbar_t *bbar, button_t *button)
}
D_BBAR((" -> Final icon dimensions are %hux%hu\n", button->icon_w, button->icon_h));
}
#endif
D_BBAR((" -> Set button to %dx%d at %d, %d and icon to %dx%d\n", button->w, button->h, button->x, button->y, button->icon_w, button->icon_h));
}

View File

@ -160,9 +160,11 @@ event_init_primary_dispatcher(void)
event_data_add_mywin(&primary_data, TermWin.parent);
event_data_add_mywin(&primary_data, TermWin.vt);
#ifdef PIXMAP_SUPPORT
if (desktop_window != None) {
event_data_add_parent(&primary_data, desktop_window);
}
#endif
}
unsigned char
@ -227,6 +229,7 @@ handle_property_notify(event_t * ev)
D_EVENTS(("handle_property_notify(ev [%8p] on window 0x%08x)\n", ev, ev->xany.window));
#ifdef PIXMAP_OFFSET
if (background_is_trans()) {
if ((ev->xany.window == TermWin.parent) || (ev->xany.window == Xroot)) {
prop = XInternAtom(Xdisplay, "_WIN_WORKSPACE", True);
@ -267,12 +270,15 @@ handle_property_notify(event_t * ev)
}
}
}
#endif
if ((ev->xany.window == Xroot) && (image_mode_any(MODE_AUTO))) {
prop = XInternAtom(Xdisplay, "ENLIGHTENMENT_COMMS", True);
D_EVENTS(("On the root window. prop (ENLIGHTENMENT_COMMS) == 0x%08x, ev->xproperty.atom == 0x%08x\n", (int) prop, (int) ev->xproperty.atom));
if ((prop != None) && (ev->xproperty.atom == prop)) {
if ((enl_ipc_get_win()) != None) {
#ifdef PIXMAP_SUPPORT
redraw_images_by_mode(MODE_AUTO);
#endif
}
}
}
@ -554,13 +560,15 @@ handle_expose(event_t * ev)
D_EVENTS(("handle_expose(ev [%8p] on window 0x%08x)\n", ev, ev->xany.window));
REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0);
if (ev->xany.window == TermWin.vt) {
if (buffer_pixmap == None) {
if (refresh_type == NO_REFRESH) {
refresh_type = FAST_REFRESH;
}
scr_expose(ev->xexpose.x, ev->xexpose.y, ev->xexpose.width, ev->xexpose.height);
if (ev->xany.window == TermWin.vt
#ifdef PIXMAP_SUPPORT
&& buffer_pixmap == None
#endif
) {
if (refresh_type == NO_REFRESH) {
refresh_type = FAST_REFRESH;
}
scr_expose(ev->xexpose.x, ev->xexpose.y, ev->xexpose.width, ev->xexpose.height);
} else {
XEvent unused_xevent;
@ -568,11 +576,6 @@ handle_expose(event_t * ev)
while (XCheckTypedWindowEvent(Xdisplay, ev->xany.window, Expose, &unused_xevent));
while (XCheckTypedWindowEvent(Xdisplay, ev->xany.window, GraphicsExpose, &unused_xevent));
}
#if 0
if (desktop_window != None) {
XSelectInput(Xdisplay, desktop_window, PropertyChangeMask);
}
#endif
PROF_DONE(handle_expose);
PROF_TIME(handle_expose);
return 1;

View File

@ -2466,15 +2466,18 @@ parse_imageclasses(char *buff, void *state)
return NULL;
}
#ifdef PIXMAP_SUPPORT
if (!BEG_STRCASECMP(buff, "icon ")) {
#ifdef PIXMAP_SUPPORT
RESET_AND_ASSIGN(rs_icon, Word(2, buff));
#else
print_warning("Pixmap support was not compiled in, ignoring \"icon\" attribute");
#endif
} else if (!BEG_STRCASECMP(buff, "path ")) {
RESET_AND_ASSIGN(rs_path, Word(2, buff));
} else if (!BEG_STRCASECMP(buff, "anim ")) {
# ifdef BACKGROUND_CYCLING_SUPPORT
#ifdef BACKGROUND_CYCLING_SUPPORT
char *tmp = PWord(2, buff);
if (tmp) {
@ -2482,18 +2485,14 @@ parse_imageclasses(char *buff, void *state)
} else {
print_error("Parse error in file %s, line %lu: Invalid parameter list \"\" for attribute anim", file_peek_path(), file_peek_line());
}
# else
#else
print_warning("Support for the anim attribute was not compiled in, ignoring");
# endif
#endif
} else {
print_error("Parse error in file %s, line %lu: Attribute \"%s\" is not valid "
"within context imageclasses", file_peek_path(), file_peek_line(), buff);
}
#else
print_warning("Pixmap support was not compiled in, ignoring entire context");
file_poke_skip(1);
#endif
return state;
}
@ -2502,7 +2501,6 @@ parse_image(char *buff, void *state)
{
int idx;
#ifdef PIXMAP_SUPPORT
if (*buff == CONF_BEGIN_CHAR) {
int *tmp;
@ -2678,6 +2676,7 @@ parse_image(char *buff, void *state)
FREE(fg);
FREE(bg);
#ifdef PIXMAP_SUPPORT
} else if (!BEG_STRCASECMP(buff, "file ")) {
char *filename = PWord(2, buff);
@ -2780,6 +2779,7 @@ parse_image(char *buff, void *state)
print_error("Parse error in file %s, line %lu: Color must be either \"image\", \"red\", \"green\", or \"blue\"", file_peek_path(), file_peek_line());
return NULL;
}
#endif
} else if (!BEG_STRCASECMP(buff, "border ")) {
if (idx < 0) {
@ -2869,11 +2869,6 @@ parse_image(char *buff, void *state)
"within context image", file_peek_path(), file_peek_line(), buff);
}
return ((void *) state);
#else
print_warning("Pixmap support was not compiled in, ignoring entire context");
file_poke_skip(1);
return NULL;
#endif
}
static void *
@ -3712,11 +3707,13 @@ post_parse(void)
images[i].mode = MODE_IMAGE & ALLOW_IMAGE;
}
images[i].current = images[i].norm;
#ifdef PIXMAP_SUPPORT
if (rs_pixmaps[i]) {
reset_simage(images[i].norm, RESET_ALL_SIMG);
load_image(rs_pixmaps[i], images[i].norm);
FREE(rs_pixmaps[i]); /* These are created by StrDup() */
}
#endif
if (images[i].selected) {
/* If we have a bevel but no border, use the bevel as a border. */
if (images[i].selected->iml->bevel && !(images[i].selected->iml->border)) {
@ -3798,6 +3795,7 @@ post_parse(void)
/* Update buttonbar sizes based on new imageclass info. */
bbar_resize_all(-1);
#ifdef PIXMAP_SUPPORT
/* Support the deprecated forms by converting the syntax to the new system */
if (rs_shade != 0) {
char buff[10];
@ -3894,6 +3892,7 @@ post_parse(void)
}
FREE(rs_cmod_blue);
}
#endif
if (Options & Opt_reverseVideo) {
char *tmp;
@ -4144,12 +4143,14 @@ save_config(char *path, unsigned char save_theme)
if (save_theme) {
fprintf(fp, " begin imageclasses\n");
fprintf(fp, " path \"%s\"\n", rs_path);
#ifdef PIXMAP_SUPPORT
if (rs_icon != NULL) {
fprintf(fp, " icon %s\n", rs_icon);
}
if (rs_anim_delay) {
/* FIXME: Do something here! */
}
#endif
for (i = 0; i < image_max; i++) {
fprintf(fp, " begin image\n");
switch (i) {
@ -4196,13 +4197,16 @@ save_config(char *path, unsigned char save_theme)
/* Now save each state. */
simg = images[i].norm;
#ifdef PIXMAP_SUPPORT
if (simg->iml->im) {
imlib_context_set_image(simg->iml->im);
}
#endif
fprintf(fp, " state normal\n");
if (simg->fg || simg->bg) {
fprintf(fp, " color 0x%08x 0x%08x\n", (unsigned int) simg->fg, (unsigned int) simg->bg);
}
#ifdef PIXMAP_SUPPORT
if (simg->iml->im) {
fprintf(fp, " file %s\n", NONULL(imlib_image_get_filename()));
}
@ -4233,6 +4237,7 @@ save_config(char *path, unsigned char save_theme)
if (simg->iml->bmod) {
fprintf(fp, " colormod blue 0x%02x 0x%02x 0x%02x\n", simg->iml->bmod->brightness, simg->iml->bmod->contrast, simg->iml->bmod->gamma);
}
#endif
if (simg->iml->border) {
fprintf(fp, " border %hu %hu %hu %hu\n", simg->iml->border->left, simg->iml->border->right, simg->iml->border->top, simg->iml->border->bottom);
}
@ -4246,13 +4251,16 @@ save_config(char *path, unsigned char save_theme)
/* Selected state */
if (images[i].selected != images[i].norm) {
simg = images[i].selected;
#ifdef PIXMAP_SUPPORT
if (simg->iml->im) {
imlib_context_set_image(simg->iml->im);
}
#endif
fprintf(fp, " state selected\n");
if (simg->fg || simg->bg) {
fprintf(fp, " color 0x%08x 0x%08x\n", (unsigned int) simg->fg, (unsigned int) simg->bg);
}
#ifdef PIXMAP_SUPPORT
if (simg->iml->im) {
fprintf(fp, " file %s\n", NONULL(imlib_image_get_filename()));
}
@ -4283,6 +4291,7 @@ save_config(char *path, unsigned char save_theme)
if (simg->iml->bmod) {
fprintf(fp, " colormod blue 0x%02x 0x%02x 0x%02x\n", simg->iml->bmod->brightness, simg->iml->bmod->contrast, simg->iml->bmod->gamma);
}
#endif
if (simg->iml->border) {
fprintf(fp, " border %hu %hu %hu %hu\n", simg->iml->border->left, simg->iml->border->right, simg->iml->border->top, simg->iml->border->bottom);
}
@ -4297,13 +4306,16 @@ save_config(char *path, unsigned char save_theme)
/* Clicked state */
if (images[i].clicked != images[i].norm) {
simg = images[i].clicked;
#ifdef PIXMAP_SUPPORT
if (simg->iml->im) {
imlib_context_set_image(simg->iml->im);
}
#endif
fprintf(fp, " state clicked\n");
if (simg->fg || simg->bg) {
fprintf(fp, " color 0x%08x 0x%08x\n", (unsigned int) simg->fg, (unsigned int) simg->bg);
}
#ifdef PIXMAP_SUPPORT
if (simg->iml->im) {
fprintf(fp, " file %s\n", NONULL(imlib_image_get_filename()));
}
@ -4334,6 +4346,7 @@ save_config(char *path, unsigned char save_theme)
if (simg->iml->bmod) {
fprintf(fp, " colormod blue 0x%02x 0x%02x 0x%02x\n", simg->iml->bmod->brightness, simg->iml->bmod->contrast, simg->iml->bmod->gamma);
}
#endif
if (simg->iml->border) {
fprintf(fp, " border %hu %hu %hu %hu\n", simg->iml->border->left, simg->iml->border->right, simg->iml->border->top, simg->iml->border->bottom);
}
@ -4348,13 +4361,16 @@ save_config(char *path, unsigned char save_theme)
/* Disabled state */
if (images[i].disabled != images[i].norm) {
simg = images[i].disabled;
#ifdef PIXMAP_SUPPORT
if (simg->iml->im) {
imlib_context_set_image(simg->iml->im);
}
#endif
fprintf(fp, " state disabled\n");
if (simg->fg || simg->bg) {
fprintf(fp, " color 0x%08x 0x%08x\n", (unsigned int) simg->fg, (unsigned int) simg->bg);
}
#ifdef PIXMAP_SUPPORT
if (simg->iml->im) {
fprintf(fp, " file %s\n", NONULL(imlib_image_get_filename()));
}
@ -4385,6 +4401,7 @@ save_config(char *path, unsigned char save_theme)
if (simg->iml->bmod) {
fprintf(fp, " colormod blue 0x%02x 0x%02x 0x%02x\n", simg->iml->bmod->brightness, simg->iml->bmod->contrast, simg->iml->bmod->gamma);
}
#endif
if (simg->iml->border) {
fprintf(fp, " border %hu %hu %hu %hu\n", simg->iml->border->left, simg->iml->border->right, simg->iml->border->top, simg->iml->border->bottom);
}

View File

@ -57,10 +57,14 @@ static const char cvs_ident[] = "$Id$";
static Imlib_Border bord_none = { 0, 0, 0, 0 };
static colormod_t cmod_none = { 256, 256, 256 };
# ifdef PIXMAP_OFFSET
Pixmap desktop_pixmap = None, viewport_pixmap = None;
Pixmap buffer_pixmap = None;
Window desktop_window = None;
unsigned char desktop_pixmap_is_mine = 0;
# endif
#endif
image_t images[image_max] =
{
{None, 0, 0, NULL, NULL, NULL, NULL, NULL},
@ -79,9 +83,6 @@ image_t images[image_max] =
{None, 0, 0, NULL, NULL, NULL, NULL, NULL}
};
#endif
#ifdef PIXMAP_SUPPORT
static const char *get_iclass_name(unsigned char);
static void copy_buffer_pixmap(unsigned char mode, unsigned long fill, unsigned short width, unsigned short height);
@ -119,6 +120,7 @@ image_mode_any(unsigned char mode)
return ismode;
}
#ifdef PIXMAP_SUPPORT
unsigned short
parse_pixmap_ops(char *str)
{

View File

@ -31,27 +31,28 @@
/************ Macros and Definitions ************/
#ifdef PIXMAP_SUPPORT
# define background_is_image() ((buffer_pixmap) || (images[image_bg].current && images[image_bg].current->iml && images[image_bg].current->iml->im))
# define background_is_trans() (images[image_bg].mode & MODE_TRANS)
# define background_is_image() ((buffer_pixmap) || (images[image_bg].current && images[image_bg].current->iml && images[image_bg].current->iml->im))
# define background_is_trans() (images[image_bg].mode & MODE_TRANS)
# define background_is_viewport() (images[image_bg].mode & MODE_VIEWPORT)
# define background_is_auto() (images[image_bg].mode & MODE_AUTO)
# define background_is_pixmap() (background_is_image() || background_is_trans() || background_is_viewport() || background_is_auto())
# define background_is_auto() (images[image_bg].mode & MODE_AUTO)
# define background_is_pixmap() (background_is_image() || (images[image_bg].mode & (MODE_TRANS | MODE_VIEWPORT | MODE_AUTO)))
# define delete_simage(simg) do { \
imlib_free_pixmap_and_mask((simg)->pmap->pixmap); \
imlib_context_set_image((simg)->iml->im); \
imlib_free_image_and_decache(); \
(simg)->pmap->pixmap = None; (simg)->iml->im = NULL; \
} while (0)
# define CONVERT_SHADE(s) (0xff - (((s) * 0xff) / 100))
# define CONVERT_SHADE(s) (0xff - (((s) * 0xff) / 100))
# define CONVERT_TINT_RED(t) (((t) & 0xff0000) >> 16)
# define CONVERT_TINT_GREEN(t) (((t) & 0x00ff00) >> 8)
# define CONVERT_TINT_BLUE(t) ((t) & 0x0000ff)
#else
# define background_is_image() NOP
# define background_is_trans() NOP
# define background_is_viewport() NOP
# define background_is_auto() NOP
# define get_image_type_string(t) NOP
# define background_is_image() (0)
# define background_is_trans() (0)
# define background_is_viewport() (0)
# define background_is_auto() (0)
# define background_is_pixmap() (0)
# define get_image_type_string(t) ((char *) "")
# define delete_simage(simg) NOP
#endif
#define PIXMAP_EXT NULL
@ -183,10 +184,23 @@ extern Pixmap desktop_pixmap, viewport_pixmap, buffer_pixmap;
extern Window desktop_window;
/************ Function Prototypes ************/
#ifndef PIXMAP_SUPPORT
# define render_simage(s, win, w, h, which, r) NOP
# define free_simage(s) NOP
# define create_simage() ((simage_t *) NULL)
# define load_image(f, s) ((unsigned char) 0)
# define check_image_ipc(w) ((unsigned char) 0)
# define redraw_image(w) NOP
# define redraw_images_by_mode(w) NOP
# define paste_simage(s, which, d, x, y, w, h) NOP
# define set_icon_pixmap(f, h) NOP
#endif
_XFUNCPROTOBEGIN
extern const char *get_image_type(unsigned char);
extern unsigned char image_mode_any(unsigned char);
#ifdef PIXMAP_SUPPORT
extern unsigned short parse_pixmap_ops(char *);
extern unsigned short set_pixmap_scale(const char *, pixmap_t *);
extern unsigned char check_image_ipc(unsigned char);
@ -205,15 +219,16 @@ extern void render_simage(simage_t *, Window, unsigned short, unsigned short, un
extern const char *search_path(const char *, const char *, const char *);
extern unsigned char load_image(const char *, simage_t *);
extern void free_desktop_pixmap(void);
#ifdef PIXMAP_OFFSET
# ifdef PIXMAP_OFFSET
extern unsigned char need_colormod(imlib_t *);
extern void colormod_trans(Pixmap, imlib_t *, GC, unsigned short, unsigned short);
extern unsigned char update_desktop_info(int *, int *);
extern Window get_desktop_window(void);
extern Pixmap get_desktop_pixmap(void);
#endif
# endif
extern void shaped_window_apply_mask(Drawable, Pixmap);
extern void set_icon_pixmap(char *, XWMHints *);
#endif
_XFUNCPROTOEND

View File

@ -43,7 +43,7 @@ typedef struct {
# define PROF_INIT(f) NOP
# define PROF_DONE(f) NOP
# define PROF_TIME(f) NOP
# define PROF_FUNC(f, c) NOP
# define PROF_FUNC(f, c) c;
#endif /* ENABLE_PROFILE */
#endif /* _PROFILE_H */

View File

@ -1013,13 +1013,9 @@ scr_erase_screen(int mode)
rend_t ren;
long gcmask;
XGCValues gcvalue;
Drawable draw_buffer;
Pixmap pmap = None;
D_SCREEN(("scr_erase_screen(%d) at screen row: %d\n", mode, screen.row));
REFRESH_ZERO_SCROLLBACK;
RESET_CHSTAT;
row_offset = TermWin.saveLines;
#ifdef PIXMAP_SUPPORT
Drawable draw_buffer;
if (buffer_pixmap) {
draw_buffer = buffer_pixmap;
@ -1027,6 +1023,13 @@ scr_erase_screen(int mode)
} else {
draw_buffer = TermWin.vt;
}
#endif
D_SCREEN(("scr_erase_screen(%d) at screen row: %d\n", mode, screen.row));
REFRESH_ZERO_SCROLLBACK;
RESET_CHSTAT;
row_offset = TermWin.saveLines;
switch (mode) {
case 0: /* erase to end of screen */
@ -1590,7 +1593,6 @@ scr_refresh(int type)
XGCValues gcvalue; /* Graphics Context values */
char buf[MAX_COLS + 1];
register char *buffer = buf;
Drawable draw_buffer;
Pixmap pmap = images[image_bg].current->pmap->pixmap;
int (*draw_string) (), (*draw_image_string) ();
register int low_x = 99999, low_y = 99999, high_x = 0, high_y = 0;
@ -1601,6 +1603,15 @@ scr_refresh(int type)
register int nrows = TermWin.nrow;
register int ncols = TermWin.ncol;
#endif
#ifdef PIXMAP_SUPPORT
Drawable draw_buffer;
if (buffer_pixmap) {
draw_buffer = buffer_pixmap;
} else {
draw_buffer = TermWin.vt;
}
#endif
PROF_INIT(scr_refresh);
@ -1618,12 +1629,6 @@ scr_refresh(int type)
if (type == NO_REFRESH)
return;
if (buffer_pixmap) {
draw_buffer = buffer_pixmap;
} else {
draw_buffer = TermWin.vt;
}
row_offset = TermWin.saveLines - TermWin.view_start;
fprop = TermWin.fprop;

View File

@ -42,6 +42,10 @@
* CLEAR_CHARS: clear <num> chars starting from pixel position <x,y>
* ERASE_ROWS : set <num> rows starting from row <row> to the foreground color
*/
#ifndef PIXMAP_SUPPORT
# define buffer_pixmap (0)
# define draw_buffer (TermWin.vt)
#endif
#define CLEAR_ROWS(row, num) do {if (buffer_pixmap) {XCopyArea(Xdisplay, pmap, buffer_pixmap, TermWin.gc, Col2Pixel(0), Row2Pixel(row), TermWin.width, Height2Pixel(num), \
Col2Pixel(0), Row2Pixel(row));} XClearArea(Xdisplay, TermWin.vt, Col2Pixel(0), Row2Pixel(row), TermWin.width, Height2Pixel(num), 0);} while (0)
#define CLEAR_CHARS(x, y, num) ((buffer_pixmap) \

View File

@ -563,9 +563,11 @@ scrollbar_draw_anchor(unsigned char image_state, unsigned char force_modes) {
imlib_t *iml = images[image_st].current->iml, *siml = images[image_sa].current->iml;
if (image_mode_is(image_st, MODE_IMAGE) && iml->im) {
#ifdef PIXMAP_SUPPORT
imlib_context_set_image(iml->im);
tw = imlib_image_get_width();
th = imlib_image_get_height();
#endif
} else if (siml->bevel) {
tw = scrollbar_anchor_width() - (siml->bevel->edges->left + siml->bevel->edges->right);
th = scrollbar_anchor_width() - (siml->bevel->edges->top + siml->bevel->edges->bottom);

View File

@ -129,10 +129,12 @@ eterm_bootstrap(int argc, char *argv[])
} else {
cmap = Xcmap;
}
#ifdef PIXMAP_SUPPORT
imlib_context_set_display(Xdisplay);
imlib_context_set_visual(Xvisual);
imlib_context_set_colormap(cmap);
imlib_context_set_dither_mask(0);
#endif
get_modifiers(); /* Set up modifier masks before parsing config files. */

View File

@ -1815,12 +1815,14 @@ xterm_seq(int op, const char *str)
} else if (!strcasecmp(color, "blue")) {
FREE(iml->bmod);
}
# ifdef PIXMAP_OFFSET
if (image_mode_is(which, MODE_TRANS) && (desktop_pixmap != None)) {
free_desktop_pixmap();
} else if (image_mode_is(which, MODE_VIEWPORT) && (viewport_pixmap != None)) {
XFreePixmap(Xdisplay, viewport_pixmap);
viewport_pixmap = None; /* Force the re-read */
}
# endif
changed = 1;
continue;
}
@ -1829,12 +1831,14 @@ xterm_seq(int op, const char *str)
}
D_CMD(("Modifying the %s attribute of the %s color modifier of the %s image to be %s\n", mod, color, get_image_type(which), valptr));
changed = 1;
# ifdef PIXMAP_OFFSET
if (image_mode_is(which, MODE_TRANS) && (desktop_pixmap != None)) {
free_desktop_pixmap();
} else if (image_mode_is(which, MODE_VIEWPORT) && (viewport_pixmap != None)) {
XFreePixmap(Xdisplay, viewport_pixmap);
viewport_pixmap = None; /* Force the re-read */
}
# endif
if (!strcasecmp(color, "image")) {
imlib_t *iml = images[which].current->iml;
@ -2023,6 +2027,7 @@ xterm_seq(int op, const char *str)
}
break;
case 3:
# ifdef PIXMAP_OFFSET
get_desktop_window();
if (desktop_window == None) {
FOREACH_IMAGE(if (image_mode_is(idx, MODE_TRANS)) {image_set_mode(idx, MODE_IMAGE); image_allow_mode(idx, ALLOW_IMAGE);});
@ -2030,6 +2035,7 @@ xterm_seq(int op, const char *str)
}
get_desktop_pixmap();
redraw_images_by_mode(MODE_TRANS | MODE_VIEWPORT);
# endif
break;
#endif
case 10:

View File

@ -17,6 +17,8 @@ static const char cvs_ident[] = "$Id$";
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef PIXMAP_SUPPORT
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
@ -88,11 +90,12 @@ set_pixmap_property(Pixmap p)
XSetCloseDownMode(Xdisplay, RetainPermanent);
XFlush(Xdisplay);
}
#endif
int
main(int argc, char *argv[])
{
#ifdef PIXMAP_SUPPORT
unsigned char scale = 0, center = 0, fit = 0;
char *displayname = NULL;
char *fname = NULL;
@ -234,5 +237,8 @@ main(int argc, char *argv[])
XClearWindow(Xdisplay, Xroot);
XFlush(Xdisplay);
}
#else
fprintf(stderr, "Eterm was built without pixmap support, so Esetroot is fairly useless. Sorry.\n");
#endif
return 0;
}