Tue Jan 4 14:13:48 PST 2000 Michael Jennings <mej@eterm.org>
Some minor optimizations I did while looking into a bug report. SVN revision: 1842
This commit is contained in:
parent
d7aae78488
commit
7830619d07
|
@ -2997,3 +2997,8 @@ Mon Jan 3 19:36:16 PST 2000 Michael Jennings <mej@eterm.org>
|
|||
tracking code to provide more information.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Tue Jan 4 14:13:48 PST 2000 Michael Jennings <mej@eterm.org>
|
||||
|
||||
Some minor optimizations I did while looking into a bug report.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
|
|
@ -252,7 +252,7 @@ handle_property_notify(event_t * ev)
|
|||
/* Pixmap is unchanged */
|
||||
return 1;
|
||||
}
|
||||
redraw_all_images();
|
||||
redraw_images_by_mode(MODE_TRANS | MODE_VIEWPORT);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -265,7 +265,7 @@ handle_property_notify(event_t * ev)
|
|||
/* Pixmap is unchanged */
|
||||
return 1;
|
||||
}
|
||||
redraw_all_images();
|
||||
redraw_images_by_mode(MODE_TRANS | MODE_VIEWPORT);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -275,7 +275,7 @@ handle_property_notify(event_t * ev)
|
|||
D_EVENTS(("handle_property_notify(): 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) {
|
||||
redraw_all_images();
|
||||
redraw_images_by_mode(MODE_AUTO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
21
src/pixmap.c
21
src/pixmap.c
|
@ -476,6 +476,20 @@ redraw_image(unsigned char which) {
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
redraw_images_by_mode(unsigned char mode) {
|
||||
|
||||
if (mode == MODE_SOLID) {
|
||||
redraw_all_images();
|
||||
} else {
|
||||
if (image_mode_is(image_bg, mode)) {
|
||||
render_simage(images[image_bg].current, TermWin.vt, TermWin_TotalWidth(), TermWin_TotalHeight(), image_bg, 0);
|
||||
scr_touch();
|
||||
}
|
||||
scrollbar_draw(mode);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
copy_buffer_pixmap(unsigned char mode, unsigned long fill, unsigned short width, unsigned short height)
|
||||
{
|
||||
|
@ -1249,7 +1263,7 @@ get_desktop_pixmap(void)
|
|||
Pixmap p;
|
||||
Atom prop, type, prop2;
|
||||
int format;
|
||||
static Pixmap color_pixmap = None;
|
||||
static Pixmap color_pixmap = None, orig_desktop_pixmap = None;
|
||||
unsigned long length, after;
|
||||
unsigned char *data;
|
||||
|
||||
|
@ -1278,12 +1292,13 @@ get_desktop_pixmap(void)
|
|||
p = *((Pixmap *) data);
|
||||
if (p != None) {
|
||||
D_PIXMAP((" Found pixmap 0x%08x\n", p));
|
||||
if (desktop_pixmap == p) {
|
||||
if (orig_desktop_pixmap == p) {
|
||||
D_PIXMAP(("get_desktop_pixmap(): Desktop pixmap is unchanged.\n"));
|
||||
return ((Pixmap) 1);
|
||||
} else {
|
||||
D_PIXMAP(("get_desktop_pixmap(): Desktop pixmap has changed. Updating desktop_pixmap\n"));
|
||||
free_desktop_pixmap();
|
||||
orig_desktop_pixmap = p;
|
||||
if (need_colormod(images[image_bg].current->iml)) {
|
||||
int px, py;
|
||||
unsigned int pw, ph, pb, pd;
|
||||
|
@ -1307,9 +1322,11 @@ get_desktop_pixmap(void)
|
|||
}
|
||||
XFreeGC(Xdisplay, gc);
|
||||
desktop_pixmap_is_mine = 1;
|
||||
D_PIXMAP(("get_desktop_pixmap() returning 0x%08x\n", (unsigned int) desktop_pixmap));
|
||||
return (desktop_pixmap);
|
||||
} else {
|
||||
desktop_pixmap_is_mine = 0;
|
||||
D_PIXMAP(("get_desktop_pixmap() returning 0x%08x\n", (unsigned int) p));
|
||||
return (desktop_pixmap = p);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -168,6 +168,7 @@ 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 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);
|
||||
extern const char *search_path(const char *, const char *, const char *);
|
||||
extern unsigned short load_image(const char *, short);
|
||||
|
|
|
@ -1881,7 +1881,7 @@ xterm_seq(int op, const char *str)
|
|||
break;
|
||||
}
|
||||
get_desktop_pixmap();
|
||||
redraw_all_images();
|
||||
redraw_images_by_mode(MODE_TRANS | MODE_VIEWPORT);
|
||||
break;
|
||||
#endif
|
||||
case 10:
|
||||
|
@ -1950,7 +1950,7 @@ xterm_seq(int op, const char *str)
|
|||
case 24:
|
||||
nstr = (char *) strsep(&tnstr, ";");
|
||||
FOREACH_IMAGE(if (!image_mode_is(idx, MODE_VIEWPORT) && image_mode_is(idx, ALLOW_VIEWPORT)) {image_set_mode(idx, MODE_VIEWPORT);});
|
||||
redraw_all_images();
|
||||
redraw_images_by_mode(MODE_VIEWPORT);
|
||||
break;
|
||||
case 25:
|
||||
nstr = (char *) strsep(&tnstr, ";");
|
||||
|
|
|
@ -569,7 +569,7 @@ void
|
|||
handle_move(int x, int y)
|
||||
{
|
||||
if (image_mode_any(MODE_TRANS | MODE_VIEWPORT)) {
|
||||
redraw_all_images();
|
||||
redraw_images_by_mode(MODE_TRANS | MODE_VIEWPORT);
|
||||
}
|
||||
TermWin.x = x;
|
||||
TermWin.y = y;
|
||||
|
|
Loading…
Reference in New Issue