diff --git a/src/screen_utils.c b/src/screen_utils.c
index d6e19fa3ec1047c674ed83bd2c8638d1d957fcd8..baa371be1aec79ae12c1ece3bd4691b1cb995869 100644 (file)
--- a/src/screen_utils.c
+++ b/src/screen_utils.c
#define FIND_PROMPT _("Find: ")
#define RFIND_PROMPT _("Find backward: ")
+void
+screen_bell(void)
+{
+ if( options.audible_bell )
+ beep();
+ if( options.visible_bell )
+ flash();
+}
+
int
screen_getch(WINDOW *w, char *prompt)
{
curs_set(1);
timeout(-1);
- while( (key=wgetch(w)) == ERR )
+ while( (key=my_wgetch(w)) == ERR )
;
-
- if( key==KEY_RESIZE )
- screen_resize();
+
+#ifdef HAVE_GETMOUSE
+ /* ignore mouse events */
+ if( key==KEY_MOUSE )
+ return screen_getch(w, prompt);
+#endif
noecho();
curs_set(0);
else
{
screen_status_printf(_("Unable to find \'%s\'"), screen->findbuf);
- beep();
+ screen_bell();
}
return 1;
default:
doupdate();
colors_use(w, COLOR_LIST);
}
+
+void
+set_xterm_title(char *format, ...)
+{
+ /* the current xterm title exists under the WM_NAME property */
+ /* and can be retreived with xprop -id $WINDOWID */
+
+ if( options.enable_xterm_title )
+ {
+ if( g_getenv("WINDOWID") )
+ {
+ char *msg;
+ va_list ap;
+
+ va_start(ap,format);
+ msg = g_strdup_vprintf(format,ap);
+ va_end(ap);
+ printf("%c]0;%s%c", '\033', msg, '\007');
+ g_free(msg);
+ }
+ else
+ options.enable_xterm_title = FALSE;
+ }
+}