Mon Jan 10 14:47:33 PST 2000 Michael Jennings <mej@eterm.org>

Fixed the problem with menus in auto mode.


SVN revision: 1884
This commit is contained in:
Michael Jennings 2000-01-10 09:41:12 +00:00
parent 653e879909
commit 8654a43109
5 changed files with 26 additions and 11 deletions

View File

@ -3013,3 +3013,8 @@ Fri Jan 7 20:11:48 PST 2000 Michael Jennings <mej@eterm.org>
font configuration in the default theme files.
-------------------------------------------------------------------------------
Mon Jan 10 14:47:33 PST 2000 Michael Jennings <mej@eterm.org>
Fixed the problem with menus in auto mode.
-------------------------------------------------------------------------------

View File

@ -844,7 +844,8 @@ menu_draw(menu_t * menu)
menu_set_font(menu, etfonts[def_font_idx]);
}
gcvalue.foreground = PixColors[menuTextColor];
XChangeGC(Xdisplay, menu->gc, GCForeground, &gcvalue);
gcvalue.graphics_exposures = False;
XChangeGC(Xdisplay, menu->gc, GCForeground | GCGraphicsExposures, &gcvalue);
if (!menu->w) {
unsigned short longest;
@ -872,11 +873,19 @@ menu_draw(menu_t * menu)
/* Size and render menu window */
XResizeWindow(Xdisplay, menu->win, menu->w, menu->h);
render_simage(images[image_menu].norm, menu->win, menu->w, menu->h, image_menu, 0);
menu->bg = images[image_menu].norm->pmap->pixmap;
if (image_mode_is(image_menu, MODE_AUTO)) {
pixmap_t *pmap = images[image_menu].norm->pmap;
if (pmap->pixmap != None) {
XFreePixmap(Xdisplay, pmap->pixmap);
}
pmap->pixmap = XCreatePixmap(Xdisplay, menu->win, width, height, Xdepth);
paste_simage(images[image_menu].norm, image_menu, pmap->pixmap, 0, 0, width, height);
enl_ipc_sync();
} else {
render_simage(images[image_menu].norm, menu->win, menu->w, menu->h, image_menu, 0);
}
menu->bg = images[image_menu].norm->pmap->pixmap;
/* Size and render selected item window */
XResizeWindow(Xdisplay, menu->swin, menu->w - 2 * MENU_HGAP, menu->fheight + MENU_VGAP);

View File

@ -369,13 +369,13 @@ check_image_ipc(unsigned char reset)
}
void
paste_simage(simage_t *simg, unsigned char which, Window win, unsigned short x, unsigned short y, unsigned short w, unsigned short h)
paste_simage(simage_t *simg, unsigned char which, Drawable d, unsigned short x, unsigned short y, unsigned short w, unsigned short h)
{
ASSERT(simg != NULL);
REQUIRE(win != None);
REQUIRE(d != None);
D_PIXMAP(("paste_simage(%8p, %s, 0x%08x, %hd, %hd, %hd, %hd) called.\n", simg, get_image_type(which), (int) win, x, y, w, h));
D_PIXMAP(("paste_simage(%8p, %s, 0x%08x, %hd, %hd, %hd, %hd) called.\n", simg, get_image_type(which), (int) d, x, y, w, h));
if ((images[which].mode & MODE_AUTO) && (images[which].mode & ALLOW_AUTO)) {
char buff[255], *reply;
@ -395,7 +395,7 @@ paste_simage(simage_t *simg, unsigned char which, Window win, unsigned short x,
D_PIXMAP((" -> iclass == \"%s\", state == \"%s\"\n", NONULL(iclass), NONULL(state)));
if (iclass) {
snprintf(buff, sizeof(buff), "imageclass %s apply_copy 0x%x %s %hd %hd", iclass, (int) win, state, w, h);
snprintf(buff, sizeof(buff), "imageclass %s apply_copy 0x%x %s %hd %hd", iclass, (int) d, state, w, h);
reply = enl_send_and_wait(buff);
if (strstr(reply, "Error")) {
print_error("Enlightenment didn't seem to like something about my syntax. Disallowing \"auto\" mode for this image.\n");
@ -405,7 +405,7 @@ paste_simage(simage_t *simg, unsigned char which, Window win, unsigned short x,
GC gc;
XGCValues gcvalues;
gc = XCreateGC(Xdisplay, win, 0, &gcvalues);
gc = XCreateGC(Xdisplay, d, 0, &gcvalues);
pmap = (Pixmap) strtoul(reply, (char **) NULL, 0);
mask = (Pixmap) strtoul(PWord(2, reply), (char **) NULL, 0);
FREE(reply);
@ -416,7 +416,7 @@ paste_simage(simage_t *simg, unsigned char which, Window win, unsigned short x,
}
XSetClipMask(Xdisplay, gc, mask);
XSetClipOrigin(Xdisplay, gc, x, y);
XCopyArea(Xdisplay, pmap, win, gc, 0, 0, w, h, x, y);
XCopyArea(Xdisplay, pmap, d, gc, 0, 0, w, h, x, y);
snprintf(buff, sizeof(buff), "imageclass %s free_pixmap 0x%08x", iclass, (int) pmap);
enl_ipc_send(buff);
XFreeGC(Xdisplay, gc);
@ -446,7 +446,7 @@ paste_simage(simage_t *simg, unsigned char which, Window win, unsigned short x,
if (simg->iml->bmod) {
Imlib_set_image_blue_modifier(imlib_id, simg->iml->im, simg->iml->bmod);
}
Imlib_paste_image(imlib_id, simg->iml->im, win, x, y, w, h);
Imlib_paste_image(imlib_id, simg->iml->im, (Window) d, x, y, w, h);
}
}

View File

@ -166,7 +166,7 @@ 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);
extern void reset_simage(simage_t *, unsigned long);
extern void paste_simage(simage_t *, unsigned char, Window, unsigned short, unsigned short, unsigned short, unsigned short);
extern void paste_simage(simage_t *, unsigned char, Drawable, unsigned short, unsigned short, unsigned short, unsigned short);
extern void redraw_image(unsigned char);
extern void redraw_images_by_mode(unsigned char);
extern void render_simage(simage_t *, Window, unsigned short, unsigned short, unsigned char, renderop_t);

View File

@ -1001,6 +1001,7 @@ process_csi_seq(void)
#if defined (ENABLE_DISPLAY_ANSWER)
case 7:
tt_write((unsigned char *) display_name, strlen(display_name));
tt_write("\n", 1);
break;
#endif
case 8: