From d2a4ef5bebec426798e15cc3d215f12a3681ceb0 Mon Sep 17 00:00:00 2001 From: Michael Jennings Date: Mon, 18 Sep 2000 01:38:22 +0000 Subject: [PATCH] Sun Sep 17 18:54:26 PDT 2000 Michael Jennings Fixed XErrors caused by calling XTranslateCoordinates with a pixmap. This was visible using the glass theme. SVN revision: 3522 --- ChangeLog | 6 ++++++ src/buttons.c | 12 ++++++------ src/menus.c | 2 +- src/pixmap.c | 9 ++++----- src/pixmap.h | 18 +++++++++--------- src/scrollbar.c | 3 ++- themes/trans/theme.cfg.in | 3 --- 7 files changed, 28 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3c4a7cf..0a69dd4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3909,3 +3909,9 @@ Sun Sep 17 17:29:26 PDT 2000 Michael Jennings Got rid of the useless backing_store option. ------------------------------------------------------------------------------- +Sun Sep 17 18:54:26 PDT 2000 Michael Jennings + + Fixed XErrors caused by calling XTranslateCoordinates with a pixmap. + This was visible using the glass theme. + +------------------------------------------------------------------------------- diff --git a/src/buttons.c b/src/buttons.c index 4eaee07..6b4a78e 100644 --- a/src/buttons.c +++ b/src/buttons.c @@ -622,7 +622,7 @@ bbar_select_button(buttonbar_t *bbar, button_t *button) { bbar->current = button; if (image_mode_is(image_button, MODE_MASK)) { - paste_simage(images[image_button].selected, image_button, bbar->win, button->x, button->y, button->w, button->h); + paste_simage(images[image_button].selected, image_button, bbar->win, bbar->win, button->x, button->y, button->w, button->h); } else { Pixel p1, p2; @@ -636,7 +636,7 @@ bbar_select_button(buttonbar_t *bbar, button_t *button) enl_ipc_sync(); } if (button->icon) { - paste_simage(button->icon, image_max, bbar->win, button->icon_x, button->icon_y, button->icon_w, button->icon_h); + paste_simage(button->icon, image_max, bbar->win, bbar->win, button->icon_x, button->icon_y, button->icon_w, button->icon_h); } if (button->len) { XSetForeground(Xdisplay, bbar->gc, images[image_bbar].selected->fg); @@ -657,7 +657,7 @@ bbar_click_button(buttonbar_t *bbar, button_t *button) { bbar->current = button; if (image_mode_is(image_button, MODE_MASK)) { - paste_simage(images[image_button].clicked, image_button, bbar->win, button->x, button->y, button->w, button->h); + paste_simage(images[image_button].clicked, image_button, bbar->win, bbar->win, button->x, button->y, button->w, button->h); } else { draw_shadow_from_colors(bbar->win, PixColors[menuBottomShadowColor], PixColors[menuTopShadowColor], button->x, button->y, button->w, button->h, 2); } @@ -665,7 +665,7 @@ bbar_click_button(buttonbar_t *bbar, button_t *button) enl_ipc_sync(); } if (button->icon) { - paste_simage(button->icon, image_max, bbar->win, button->icon_x, button->icon_y, button->icon_w, button->icon_h); + paste_simage(button->icon, image_max, bbar->win, bbar->win, button->icon_x, button->icon_y, button->icon_w, button->icon_h); } if (button->len) { XSetForeground(Xdisplay, bbar->gc, images[image_bbar].clicked->fg); @@ -801,7 +801,7 @@ bbar_draw(buttonbar_t *bbar, unsigned char image_state, unsigned char force_mode XSetForeground(Xdisplay, bbar->gc, images[image_bbar].current->fg); for (button = bbar->buttons; button; button = button->next) { if (button->icon) { - paste_simage(button->icon, image_max, bbar->bg, button->icon_x, button->icon_y, button->icon_w, button->icon_h); + paste_simage(button->icon, image_max, bbar->win, bbar->bg, button->icon_x, button->icon_y, button->icon_w, button->icon_h); } if (button->len) { draw_string(bbar, bbar->bg, bbar->gc, button->text_x, button->text_y, button->text, button->len); @@ -809,7 +809,7 @@ bbar_draw(buttonbar_t *bbar, unsigned char image_state, unsigned char force_mode } for (button = bbar->rbuttons; button; button = button->next) { if (button->icon) { - paste_simage(button->icon, image_max, bbar->bg, button->icon_x, button->icon_y, button->icon_w, button->icon_h); + paste_simage(button->icon, image_max, bbar->win, bbar->bg, button->icon_x, button->icon_y, button->icon_w, button->icon_h); } if (button->len) { draw_string(bbar, bbar->bg, bbar->gc, button->text_x, button->text_y, button->text, button->len); diff --git a/src/menus.c b/src/menus.c index a893767..32cf530 100644 --- a/src/menus.c +++ b/src/menus.c @@ -1084,7 +1084,7 @@ menu_draw(menu_t *menu) switch (item->type) { case MENUITEM_SUBMENU: if (image_mode_is(image_submenu, MODE_MASK)) { - paste_simage(images[image_submenu].norm, image_submenu, menu->bg, item->x, item->y, item->w - MENU_VGAP, item->h); + paste_simage(images[image_submenu].norm, image_submenu, menu->win, menu->bg, item->x, item->y, item->w - MENU_VGAP, item->h); } else { draw_arrow_from_colors(menu->bg, PixColors[menuTopShadowColor], PixColors[menuBottomShadowColor], item->x + item->w - 3 * MENU_HGAP, item->y + (item->h - MENU_VGAP) / 2, MENU_VGAP, 2, DRAW_ARROW_RIGHT); diff --git a/src/pixmap.c b/src/pixmap.c index e9a857b..186f266 100644 --- a/src/pixmap.c +++ b/src/pixmap.c @@ -638,7 +638,7 @@ create_viewport_pixmap(simage_t *simg, Drawable d, int x, int y, unsigned short } void -paste_simage(simage_t *simg, unsigned char which, Drawable d, unsigned short x, unsigned short y, unsigned short w, unsigned short h) +paste_simage(simage_t *simg, unsigned char which, Window win, Drawable d, unsigned short x, unsigned short y, unsigned short w, unsigned short h) { Pixmap pmap = None, mask = None; GC gc; @@ -646,7 +646,7 @@ paste_simage(simage_t *simg, unsigned char which, Drawable d, unsigned short x, ASSERT(simg != NULL); REQUIRE(d != None); - 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)); + D_PIXMAP(("paste_simage(%8p, %s, 0x%08x, 0x%08x, %hd, %hd, %hd, %hd) called.\n", simg, get_image_type(which), (int) win, (int) d, x, y, w, h)); if (which != image_max) { if (image_mode_is(which, MODE_AUTO) && image_mode_is(which, ALLOW_AUTO)) { @@ -698,8 +698,7 @@ paste_simage(simage_t *simg, unsigned char which, Drawable d, unsigned short x, Pixmap p; gc = LIBMEJ_X_CREATE_GC(0, NULL); - /* FIXME: The conditional on the next line works, but it's a hack. Worth fixing? :-) */ - p = create_trans_pixmap(simg, which, ((which == image_st) ? scrollbar.sa_win : d), x, y, w, h); + p = create_trans_pixmap(simg, which, win, x, y, w, h); XCopyArea(Xdisplay, p, d, gc, 0, 0, w, h, x, y); LIBMEJ_X_FREE_PIXMAP(p); LIBMEJ_X_FREE_GC(gc); @@ -707,7 +706,7 @@ paste_simage(simage_t *simg, unsigned char which, Drawable d, unsigned short x, Pixmap p; gc = LIBMEJ_X_CREATE_GC(0, NULL); - p = create_viewport_pixmap(simg, d, x, y, w, h); + p = create_viewport_pixmap(simg, win, x, y, w, h); if (simg->iml->bevel != NULL) { bevel_pixmap(p, w, h, simg->iml->bevel->edges, simg->iml->bevel->up); } diff --git a/src/pixmap.h b/src/pixmap.h index b9036ae..4fd904a 100644 --- a/src/pixmap.h +++ b/src/pixmap.h @@ -198,14 +198,14 @@ extern Window desktop_window; /************ Function Prototypes ************/ #ifndef PIXMAP_SUPPORT -# 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 +# 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, win, d, x, y, w, h) NOP +# define set_icon_pixmap(f, h) NOP #endif _XFUNCPROTOBEGIN @@ -227,7 +227,7 @@ extern void reset_colormod(colormod_t *); extern void free_colormod(colormod_t *); extern Pixmap create_trans_pixmap(simage_t *, unsigned char, Drawable, int, int, unsigned short, unsigned short); extern Pixmap create_viewport_pixmap(simage_t *, Drawable, int, int, unsigned short, unsigned short); -extern void paste_simage(simage_t *, unsigned char, Drawable, unsigned short, unsigned short, unsigned short, unsigned short); +extern void paste_simage(simage_t *, unsigned char, Window, Drawable, unsigned short, unsigned short, unsigned short, unsigned short); extern void redraw_image(unsigned char); extern void redraw_images_by_mode(unsigned char); #endif diff --git a/src/scrollbar.c b/src/scrollbar.c index a0c2847..a0ff818 100644 --- a/src/scrollbar.c +++ b/src/scrollbar.c @@ -589,7 +589,8 @@ scrollbar_draw_anchor(unsigned char image_state, unsigned char force_modes) { UPPER_BOUND(th, scrollbar_anchor_height() >> 1); D_SCROLLBAR(("Thumb width/height has been calculated at %hux%hu.\n", tw, th)); if ((tw > 0) && (th > 0)) { - paste_simage(images[image_st].current, image_st, images[image_sa].current->pmap->pixmap, (scrollbar_anchor_width() - tw) >> 1, (scrollbar_anchor_height() - th) >> 1, tw, th); + paste_simage(images[image_st].current, image_st, scrollbar.sa_win, images[image_sa].current->pmap->pixmap, + (scrollbar_anchor_width() - tw) >> 1, (scrollbar_anchor_height() - th) >> 1, tw, th); XSetWindowBackgroundPixmap(Xdisplay, scrollbar.sa_win, images[image_sa].current->pmap->pixmap); XClearWindow(Xdisplay, scrollbar.sa_win); } diff --git a/themes/trans/theme.cfg.in b/themes/trans/theme.cfg.in index 4d169fd..d00d985 100644 --- a/themes/trans/theme.cfg.in +++ b/themes/trans/theme.cfg.in @@ -359,9 +359,6 @@ begin main # If true, Eterm will run with no window borders. borderless true -# If true, Eterm will use save-unders. - backing_store true - end toggles begin keyboard