diff --git a/ChangeLog b/ChangeLog index 476c97b..0403f3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2494,3 +2494,9 @@ Fri Sep 24 13:05:40 PDT 1999 Michael Jennings would hang if you had anything in auto mode and restarted E. ------------------------------------------------------------------------------- +Tue Sep 28 14:18:44 PDT 1999 Michael Jennings + + Several fixes here, some of which I forgot to commit a couple days + ago. Oopsie. =) + +------------------------------------------------------------------------------- diff --git a/src/Makefile.am b/src/Makefile.am index 63493bd..4448e42 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -12,7 +12,7 @@ Eterm_SOURCES = main.c Eterm_DEPENDENCIES = libEterm.la Eterm_LDFLAGS = -rpath $(libdir):$(pkglibdir) -INCLUDES = -I. -I$(top_srcdir)/libmej -I.. -I$(includedir) -I$(prefix)/include $(X_CFLAGS) +INCLUDES = -I. -I$(top_srcdir) -I$(top_srcdir)/libmej -I.. -I$(includedir) -I$(prefix)/include $(X_CFLAGS) LDADD = libEterm.la $(top_builddir)/libmej/libmej.la -L$(libdir) -L$(prefix)/lib $(LIBS) $(GRLIBS) $(X_LIBS) EXTRA_DIST = actions.h command.h debug.h e.h eterm_utmp.h events.h feature.h font.h graphics.h grkelot.h grx.h main.h menus.h misc.h \ diff --git a/src/command.c b/src/command.c index 4883ba6..c3923a7 100644 --- a/src/command.c +++ b/src/command.c @@ -1775,13 +1775,13 @@ static void xim_get_area(XRectangle *preedit_rect, XRectangle *status_rect, XRectangle *needed_rect) { - preedit_rect->x = needed_rect->width + (scrollbar_visible() && !(Options & Opt_scrollBar_right) ? (scrollBar.width) : 0); + preedit_rect->x = needed_rect->width + (scrollbar_visible() && !(Options & Opt_scrollBar_right) ? (scrollbar_trough_width()) : 0); preedit_rect->y = Height2Pixel(TermWin.nrow - 1); - preedit_rect->width = Width2Pixel(TermWin.ncol + 1) - needed_rect->width + (!(Options & Opt_scrollBar_right) ? (scrollBar.width) : 0); + preedit_rect->width = Width2Pixel(TermWin.ncol + 1) - needed_rect->width + (!(Options & Opt_scrollBar_right) ? (scrollbar_trough_width()) : 0); preedit_rect->height = Height2Pixel(1); - status_rect->x = (scrollbar_visible() && !(Options & Opt_scrollBar_right)) ? (scrollBar.width) : 0; + status_rect->x = (scrollbar_visible() && !(Options & Opt_scrollBar_right)) ? (scrollbar_trough_width()) : 0; status_rect->y = Height2Pixel(TermWin.nrow - 1); status_rect->width = needed_rect->width ? needed_rect->width : Width2Pixel(TermWin.ncol + 1); diff --git a/src/command.h b/src/command.h index 339bb20..c0887eb 100644 --- a/src/command.h +++ b/src/command.h @@ -53,7 +53,6 @@ # define DndLink 7 #endif -# define menuBar_esc 10 # define scrollBar_esc 30 /* Motif window hints */ diff --git a/src/e.h b/src/e.h index 20df943..f8dadab 100644 --- a/src/e.h +++ b/src/e.h @@ -50,6 +50,7 @@ extern void enl_query_for_image(unsigned char); extern void eterm_ipc_parse(char *); extern void eterm_ipc_send(char *); extern char *eterm_ipc_get(void); +extern char *enl_send_and_wait(char *); extern void eterm_handle_winop(char *); _XFUNCPROTOEND diff --git a/src/events.c b/src/events.c index 9071234..96255e6 100644 --- a/src/events.c +++ b/src/events.c @@ -57,7 +57,7 @@ unsigned char keypress_exit = 0; event_master_t event_master; event_dispatcher_data_t primary_data; mouse_button_state_t button_state = -{0, 0, 0, 0, 0, 0, 0}; +{0, 0, 0, 0, 0, 0, 0, 0}; /********** The Event Handling Subsystem **********/ void @@ -504,6 +504,7 @@ handle_button_press(event_t * ev) XSetInputFocus(Xdisplay, Xroot, RevertToNone, CurrentTime); } if (action_dispatch(ev, 0)) { + button_state.ignore_release = 1; return 1; } @@ -565,6 +566,11 @@ handle_button_release(event_t * ev) D_EVENTS(("handle_button_release(ev [0x%08x] on window 0x%08x)\n", ev, ev->xany.window)); + if (button_state.ignore_release == 1) { + button_state.ignore_release = 0; + return 0; + } + REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0); button_state.mouse_offset = 0; button_state.report_mode = (button_state.bypass_keystate ? 0 : ((PrivateModes & PrivMode_mouse_report) ? 1 : 0)); @@ -596,17 +602,11 @@ handle_button_release(event_t * ev) switch (ev->xbutton.button) { case Button1: case Button3: -#if defined(CTRL_CLICK_RAISE) || defined(CTRL_CLICK_MENU) - if (!(ev->xbutton.state & ControlMask)) -#endif - selection_make(ev->xbutton.time); + selection_make(ev->xbutton.time); break; case Button2: -#ifdef CTRL_CLICK_SCROLLBAR - if (!(ev->xbutton.state & ControlMask)) -#endif - selection_request(ev->xbutton.time, ev->xbutton.x, ev->xbutton.y); + selection_request(ev->xbutton.time, ev->xbutton.x, ev->xbutton.y); break; case Button4: scr_page(UP, (ev->xbutton.state & ShiftMask) ? 1 : 5); diff --git a/src/events.h b/src/events.h index 1270272..793d8da 100644 --- a/src/events.h +++ b/src/events.h @@ -80,6 +80,7 @@ typedef struct { typedef struct { unsigned short clicks, bypass_keystate, report_mode, mouse_offset; Time button_press, last_button_press, activate_time; + unsigned char ignore_release; } mouse_button_state_t; /************ Variables ************/ diff --git a/src/feature.h b/src/feature.h index 85a7629..083835b 100644 --- a/src/feature.h +++ b/src/feature.h @@ -192,21 +192,6 @@ /* #define SCROLLBAR_INITIAL_DELAY 40 */ /* #define SCROLLBAR_CONTINUOUS_DELAY 2 */ -/* An alternative placement of the menubar shadow */ -/* #define MENUBAR_SHADOW_IN */ - -/* An alternative placement of the menu shadow */ -#define MENU_SHADOW_IN - -/* Allow Ctrl+Button1 in a window to raise and steal focus */ -#define CTRL_CLICK_RAISE - -/* Allow Ctrl+Button2 in a window to toggle the scrollbar */ -#define CTRL_CLICK_SCROLLBAR - -/* Allow Ctrl+Button3 in a window to toggle the menubar */ -#define CTRL_CLICK_MENU - /********************* Multi-lingual support options *********************/ /* Allow option/attribute for Meta to set the 8th bit */ @@ -297,8 +282,8 @@ # define FONT4 "13x26" #else /* MULTI_CHARSET */ # define FONT0 "fixed" -# define FONT1 "6x10" -# define FONT2 "6x13" +# define FONT1 "5x7" +# define FONT2 "6x10" # define FONT3 "7x14" # define FONT4 "8x13" #endif /* MULTI_CHARSET */ @@ -331,7 +316,7 @@ inline void *memmove(void *, const void *, size_t); /* COLORTERM, TERM environment variables */ #ifdef MULTI_CHARSET # define TERMENV "kterm" -# define COLORTERMENV "Kterm" +# define COLORTERMENV "Eterm" #else # define TERMENV "xterm" # define COLORTERMENV "Eterm" diff --git a/src/font.h b/src/font.h index b42dfbd..39b6c60 100644 --- a/src/font.h +++ b/src/font.h @@ -65,10 +65,10 @@ typedef struct font_struct { /************ Variables ************/ extern unsigned char font_change_count; extern const char *def_fontName[]; -extern const char *rs_font[NFONTS]; +extern char *rs_font[NFONTS]; # ifdef MULTI_CHARSET extern const char *def_mfontName[]; -extern const char *rs_mfont[NFONTS]; +extern char *rs_mfont[NFONTS]; # endif /************ Function Prototypes ************/ diff --git a/src/options.c b/src/options.c index d9b16e5..5e071bd 100644 --- a/src/options.c +++ b/src/options.c @@ -200,11 +200,11 @@ char *rs_preeditType = NULL; #endif char *rs_name = NULL; #ifndef NO_BOLDFONT -const char *rs_boldFont = NULL; +char *rs_boldFont = NULL; #endif -const char *rs_font[NFONTS]; +char *rs_font[NFONTS]; #ifdef MULTI_CHARSET -const char *rs_mfont[NFONTS]; +char *rs_mfont[NFONTS]; #endif #ifdef PRINTPIPE char *rs_print_pipe = NULL; @@ -782,16 +782,6 @@ version(void) #else printf(" -SCROLLBAR_BUTTON_CONTINUAL_SCROLLING"); #endif -#ifdef MENU_SHADOW_IN - printf(" +MENU_SHADOW_IN"); -#else - printf(" -MENU_SHADOW_IN"); -#endif -#ifdef CTRL_CLICK_RAISE - printf(" +CTRL_CLICK_RAISE"); -#else - printf(" -CTRL_CLICK_RAISE"); -#endif #ifdef META8_OPTION printf(" +META8_OPTION"); #else @@ -2470,6 +2460,8 @@ parse_image(char *buff) images[idx].mode = (MODE_VIEWPORT | ALLOW_VIEWPORT); } else if (!BEG_STRCASECMP(mode, "auto ")) { images[idx].mode = (MODE_AUTO | ALLOW_AUTO); + } else if (!BEG_STRCASECMP(mode, "solid ")) { + images[idx].mode = MODE_SOLID; } else { print_error("Parse error in file %s, line %lu: Invalid mode \"%s\"", file_peek_path(), file_peek_line(), mode); } @@ -2485,6 +2477,7 @@ parse_image(char *buff) images[idx].mode |= ALLOW_VIEWPORT; } else if (!BEG_STRCASECMP("auto", allow)) { images[idx].mode |= ALLOW_AUTO; + } else if (!BEG_STRCASECMP("solid", allow)) { } else { print_error("Parse error in file %s, line %lu: Invalid mode \"%s\"", file_peek_path(), file_peek_line(), allow); } diff --git a/src/options.h b/src/options.h index a83007b..4f55486 100644 --- a/src/options.h +++ b/src/options.h @@ -242,7 +242,7 @@ extern char *rs_pixmapScale; extern char *rs_config_file; extern unsigned int rs_line_space; #ifndef NO_BOLDFONT -extern const char *rs_boldFont; +extern char *rs_boldFont; #endif #ifdef PRINTPIPE extern char *rs_print_pipe; diff --git a/src/screen.c b/src/screen.c index 1833c46..c0f2b20 100644 --- a/src/screen.c +++ b/src/screen.c @@ -29,6 +29,7 @@ static const char cvs_ident[] = "$Id$"; #include "mem.h" #include "graphics.h" #include "screen.h" +#include "scrollbar.h" #include "options.h" #ifdef PIXMAP_SUPPORT # include "pixmap.h" @@ -3181,6 +3182,8 @@ debug_colors(void) void xim_get_position(XPoint *pos) { pos->x = Col2Pixel(screen.col); + if (scrollbar_visible() && !(Options & Opt_scrollBar_right)) + pos->x += scrollbar_trough_width(); pos->y = Height2Pixel(screen.row) + TermWin.font->ascent + TermWin.internalBorder; } diff --git a/src/term.c b/src/term.c index 3cfc22f..a30edf2 100644 --- a/src/term.c +++ b/src/term.c @@ -297,11 +297,11 @@ lookup_key(XEvent * ev) #ifdef KEYSYM_ATTRIBUTE if (!(shft | ctrl) && KeySym_map[keysym - 0xFF00] != NULL) { - const unsigned char *kbuf; + const unsigned char *tmpbuf; unsigned int len; - kbuf = (KeySym_map[keysym - 0xFF00]); - len = *kbuf++; + tmpbuf = (KeySym_map[keysym - 0xFF00]); + len = *tmpbuf++; /* escape prefix */ if (meta @@ -313,7 +313,7 @@ lookup_key(XEvent * ev) tt_write(&ch, 1); } - tt_write(kbuf, len); + tt_write(tmpbuf, len); LK_RET(); } else #endif @@ -348,7 +348,7 @@ lookup_key(XEvent * ev) #endif case XK_Home: - len = strlen(strcpy(kbuf, KS_HOME)); + len = strlen(strcpy(kbuf, KS_HOME)); break; #ifdef XK_KP_Left diff --git a/themes/Eterm/theme.cfg.in b/themes/Eterm/theme.cfg.in index 4b1b8aa..df9ca72 100644 --- a/themes/Eterm/theme.cfg.in +++ b/themes/Eterm/theme.cfg.in @@ -83,8 +83,8 @@ begin main # not been set and Eterm cannot map the foreground color to one of the # high-intensity colors (8-15). font 0 fixed - font 1 6x10 - font 2 6x13 + font 1 5x7 + font 2 6x10 font 3 8x13 font 4 9x15 # font bold 7x14 diff --git a/themes/cEterm/theme.cfg.in b/themes/cEterm/theme.cfg.in index e6879e4..f1929ed 100644 --- a/themes/cEterm/theme.cfg.in +++ b/themes/cEterm/theme.cfg.in @@ -82,8 +82,8 @@ begin main # not been set and Eterm cannot map the foreground color to one of the # high-intensity colors (8-15). font 0 fixed - font 1 6x10 - font 2 6x13 + font 1 5x7 + font 2 6x10 font 3 8x13 font 4 9x15 # font bold 7x14 diff --git a/themes/chooser/theme.cfg.in b/themes/chooser/theme.cfg.in index ccd1f23..7387c80 100644 --- a/themes/chooser/theme.cfg.in +++ b/themes/chooser/theme.cfg.in @@ -83,8 +83,8 @@ begin main # not been set and Eterm cannot map the foreground color to one of the # high-intensity colors (8-15). font 0 fixed - font 1 6x10 - font 2 6x13 + font 1 5x7 + font 2 6x10 font 3 8x13 font 4 9x15 # font bold 7x14 diff --git a/themes/emacs/theme.cfg.in b/themes/emacs/theme.cfg.in index 788bb87..9195f09 100644 --- a/themes/emacs/theme.cfg.in +++ b/themes/emacs/theme.cfg.in @@ -83,8 +83,8 @@ begin main # not been set and Eterm cannot map the foreground color to one of the # high-intensity colors (8-15). font 0 fixed - font 1 6x10 - font 2 6x13 + font 1 5x7 + font 2 6x10 font 3 8x13 font 4 9x15 # font bold 7x14 diff --git a/themes/mutt/theme.cfg.in b/themes/mutt/theme.cfg.in index 2bbfe2d..23f98a9 100644 --- a/themes/mutt/theme.cfg.in +++ b/themes/mutt/theme.cfg.in @@ -83,8 +83,8 @@ begin main # not been set and Eterm cannot map the foreground color to one of the # high-intensity colors (8-15). font 0 fixed - font 1 6x10 - font 2 6x13 + font 1 5x7 + font 2 6x10 font 3 8x13 font 4 9x15 # font bold 7x14 diff --git a/themes/trans/theme.cfg.in b/themes/trans/theme.cfg.in index e1cc336..0fa95df 100644 --- a/themes/trans/theme.cfg.in +++ b/themes/trans/theme.cfg.in @@ -83,8 +83,8 @@ begin main # not been set and Eterm cannot map the foreground color to one of the # high-intensity colors (8-15). font 0 fixed - font 1 6x10 - font 2 6x13 + font 1 5x7 + font 2 6x10 font 3 8x13 font 4 9x15 # font bold 7x14 diff --git a/utils/Etbg.c b/utils/Etbg.c index 704fa18..24e10d3 100644 --- a/utils/Etbg.c +++ b/utils/Etbg.c @@ -30,26 +30,22 @@ # define FALSE (0) #endif #ifndef TRUE -# define TRUE (!FALSE) +# define TRUE (1) #endif int main(int argc, char **argv) { int scale = FALSE, trans = FALSE; - unsigned int i, pic = 0, tint = 0, shade = 0; + unsigned int i, pic = 0; for (i = 1; i < argc; i++) { if (strcasecmp(argv[i], "-scale") == 0) { scale = TRUE; } else if (strcasecmp(argv[i], "-trans") == 0) { trans = TRUE; - } else if (strcasecmp(argv[i], "-tint") == 0 && i < argc - 1) { - tint = ++i; - } else if (strcasecmp(argv[i], "-shade") == 0 && i < argc - 1) { - shade = ++i; } else if (strncasecmp(argv[i], "-h", 2) == 0) { - printf("Usage: %s [[-scale] file] [-trans] [-tint 0xACOLOR] [-shade nn%]\n", argv[0]); + printf("Usage: %s [[-scale] file] [-trans]\n", argv[0]); return 0; } else { pic = i; @@ -58,16 +54,10 @@ main(int argc, char **argv) if (pic && argv[pic]) { printf("\033]6;0;0\a"); - printf("\033]20;%s%s\a", argv[pic], scale ? ";100x100+0+0" : ";0"); + printf("\033]20;%s%s\a", argv[pic], scale ? "@100x100+50+50:scale" : "@0x0+0+0:tile"); } if (trans) { printf("\033]6;0;1\a"); } - if (tint && argv[tint]) { - printf("\033]6;2;%s\a", argv[tint]); - } - if (shade && argv[shade]) { - printf("\033]6;1;%s\a", argv[shade]); - } return 0; }