1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Don't retry get_window_title

Call get_window_title() at most once per terminal, even if it fails.
If ELinks is configured with X11 support, get_window_title() calls
XOpenDisplay(), which can sleep if $DISPLAY does not respond.
This delay was previously incurred every time ELinks changed the
title.  Besides, if ELinks had already changed the title, setting
ditrm->orig_title = get_window_title(); did not make sense anyway.
(cherry picked from elinks-0.12 commit 5d4beadc4b)

Conflicts:
	src/terminal/kbd.c:
		get_window_title has a codepage parameter in 0.13.GIT.
This commit is contained in:
Kalle Olavi Niemitalo 2009-07-25 15:56:47 +03:00 committed by Kalle Olavi Niemitalo
parent 6f4c95cc7f
commit 263c1836cb

View File

@ -515,7 +515,10 @@ dispatch_special(unsigned char *text)
if (ditrm->remote)
break;
if (!ditrm->orig_title)
/* If ditrm->touched_title is 0, then
* ditrm->orig_title should be NULL,
* but check it to prevent any leak. */
if (!ditrm->orig_title && !ditrm->touched_title)
ditrm->orig_title = get_window_title(
ditrm->title_codepage);
ditrm->touched_title = 1;