1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 03:22:48 -05:00

Remove TermWin's is_minimised method.

Again, I've replaced it with a push-based notification going in the
other direction, so that when the terminal output stream includes a
query for 'is the window minimised?', the Terminal doesn't have to
consult the TermWin, because it already knows the answer.

The GTK API I'm using here (getting a GdkEventWindowState via
GtkWidget's window-state-event) is not present in GTK 1. The API I was
previously using (gdk_window_is_viewable) _is_, but it turns out that
that API doesn't reliably give the right answer: it only checks
visibility of GDK window ancestors, not X window ancestors. So in fact
GTK 1 PuTTY/pterm was only ever _pretending_ to reliably support the
'am I minimised' terminal query. Now it won't pretend any more.
This commit is contained in:
Simon Tatham
2021-02-07 19:59:20 +00:00
parent 42ad454f4f
commit 61571376cc
6 changed files with 26 additions and 25 deletions

View File

@ -244,7 +244,6 @@ static void wintw_request_resize(TermWin *, int w, int h);
static void wintw_set_title(TermWin *, const char *title);
static void wintw_set_icon_title(TermWin *, const char *icontitle);
static void wintw_set_minimised(TermWin *, bool minimised);
static bool wintw_is_minimised(TermWin *);
static void wintw_set_maximised(TermWin *, bool maximised);
static void wintw_move(TermWin *, int x, int y);
static void wintw_set_zorder(TermWin *, bool top);
@ -272,7 +271,6 @@ static const TermWinVtable windows_termwin_vt = {
.set_title = wintw_set_title,
.set_icon_title = wintw_set_icon_title,
.set_minimised = wintw_set_minimised,
.is_minimised = wintw_is_minimised,
.set_maximised = wintw_set_maximised,
.move = wintw_move,
.set_zorder = wintw_set_zorder,
@ -2980,6 +2978,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
"...",
LOWORD(lParam), HIWORD(lParam));
#endif
term_notify_minimised(term, wParam == SIZE_MINIMIZED);
if (wParam == SIZE_MINIMIZED)
SetWindowText(hwnd,
conf_get_bool(conf, CONF_win_name_always) ?
@ -5611,14 +5610,6 @@ static void wintw_set_maximised(TermWin *tw, bool maximised)
}
}
/*
* Report whether the window is iconic, for terminal reports.
*/
static bool wintw_is_minimised(TermWin *tw)
{
return IsIconic(wgs.term_hwnd);
}
/*
* Report the window's position, for terminal reports.
*/