1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 18:07:59 +00:00
Commit Graph

617 Commits

Author SHA1 Message Date
Jacob Nevins
1c28be2056 Use pid_t more consistently. Should shut up a warning from GCC 4.6, and may
conceivably help on platforms where int and pid_t aren't sufficiently similar.

[originally from svn r9110]
2011-03-01 23:00:32 +00:00
Simon Tatham
7c61c07eb8 Allow setting the WM_CLASS X window property as a configuration option
in saved sessions, so that a programmable window manager can
distinguish different PuTTYs/pterms on startup and assign them
different window management properties.

[originally from svn r9078]
2011-01-15 11:39:44 +00:00
Jacob Nevins
c5228adce3 It's a new year.
[originally from svn r9072]
[this svn revision also touched putty-website]
2011-01-05 12:01:00 +00:00
Jacob Nevins
3e8287839a Add more possible baud rates to the Unix serial backend. These are the
union of rates found in the termios.h of Linux 2.6.24 and "SunOS 5.6
Generic_105181-29 sun4u sparc SUNW,Ultra-4" machines. After a patch by
Thomas Bechtold.

[originally from svn r9028]
2010-12-08 14:21:35 +00:00
Simon Tatham
0fc1f78677 David Laight reports that sometimes reads on a serial port will
attempt to block, and hence return EAGAIN/EWOULDBLOCK, in spite of
the port having been reported readable by select(2). Don't treat
those errors as fatal.

[originally from svn r9020]
2010-11-06 17:22:38 +00:00
Simon Tatham
406e62f77b Cleanups of the GSSAPI support. On Windows, standard GSS libraries
are now loaded from standard locations (system32 for SSPI, the
registry-stored MIT KfW install location for KfW) rather than using
the risky default DLL search path; I've therefore also added an
option to manually specify a GSS DLL we haven't heard of (which
should in principle Just Work provided it supports proper GSS-API as
specified in the RFC). The same option exists on Unix too, because
it seemed like too useful an idea to reserve to Windows. In
addition, GSSAPI is now documented, and also (unfortunately) its GUI
configuration has been moved out into a sub-subpanel on the grounds
that it was too big to fit in Auth.

[originally from svn r9003]
2010-09-25 07:16:56 +00:00
Simon Tatham
75f1d3ed94 Missing close() causing resource leak when reading from /dev/random.
[originally from svn r8991]
2010-09-09 14:36:46 +00:00
Ben Harris
edfc6a05ec Set WM_TRANSIENT_FOR appropriately on the "about" box so that fvwm doesn't
insist on finding a bit of spare screen to put it in.  Still pondering whether
it's sensible to do this with the "change settings" box as well.

[originally from svn r8970]
2010-06-29 22:00:43 +00:00
Simon Tatham
a6957f606b Restore the configure check for GTK 1, which I accidentally removed
as part of r8952 (the patch submitter had done it as a temporary
measure and I forgot to undo it before checkin).

[originally from svn r8956]
[r8952 == 99fffd6ed3]
2010-05-22 14:07:25 +00:00
Simon Tatham
99fffd6ed3 Patch from Alejandro Sedeno, somewhat modified by me, which
reorganises the GSSAPI support so that it handles alternative
implementations of the GSS-API. In particular, this means PuTTY can
now talk to MIT Kerberos for Windows instead of being limited to
SSPI. I don't know for sure whether further tweaking will be needed
(to the UI, most likely, or to automatic selection of credentials),
but testing reports suggest it's now at least worth committing to
trunk to get it more widely tested.

[originally from svn r8952]
2010-05-19 18:22:17 +00:00
Jacob Nevins
4a8c45f9f7 r8854/5 broke compilation with Gtk 1.2. Grow a hack to cope.
[originally from svn r8901]
[r8854 == 14247162f7]
[r8855 == 7e16457d14]
2010-03-14 18:58:20 +00:00
Simon Tatham
4d77b65677 Centralise generation of the control sequences for arrow keys into a
function in terminal.c, and replace the cloned-and-hacked handling
code in all our front ends with calls to that.

This was intended for code cleanliness, but a side effect is to make
the GTK arrow-key handling support disabling of application cursor
key mode in the Features panel. Previously that checkbox was
accidentally ignored, and nobody seems to have noticed before!

[originally from svn r8896]
2010-03-06 15:50:26 +00:00
Simon Tatham
c347755f87 Unix console utilities should send prompts to /dev/tty or failing
that stderr, not to stdout.

[originally from svn r8878]
2010-02-20 19:15:25 +00:00
Simon Tatham
c969ae2ea6 Colin Watson reports that linking with 'gold' doesn't work, because
PuTTY makes explicit use of libX11 without including -lX11 on the
link line. (GNU ld appears to pull in libX11 automatically because
it's needed for the dependencies of GTK, but gold expects that
dependency to be satisfied at run time via DT_NEEDED and hence
doesn't bother.) Hence, add explicit -lX11 to both Makefile.gtk and
the autoconf world.

[originally from svn r8876]
2010-02-20 19:06:30 +00:00
Simon Tatham
7198a148b5 Update to r8614: another -D_FORTIFY_SOURCE=2 fix.
[originally from svn r8875]
[r8614 == 4bddcc2b5d]
2010-02-20 11:21:25 +00:00
Jacob Nevins
7e16457d14 ...and the rest of r8854.
[originally from svn r8855]
[r8854 == 14247162f7]
2010-01-25 14:33:39 +00:00
Jacob Nevins
14247162f7 Our handling of timers in Gtk was truncating times on 64-bit systems; one
symptom was that the terminal window would not update until a focus-change
event. Spotted and patched by Max Kellermann.

[originally from svn r8854]
2010-01-23 12:25:31 +00:00
Jacob Nevins
075d6e819e It's a new year.
[originally from svn r8848]
[this svn revision also touched putty-website]
2010-01-17 17:27:27 +00:00
Jacob Nevins
94b98ea537 Fix minor file descriptor leaks. Found by cppcheck, reported by Tim Kosse.
[originally from svn r8656]
2009-09-16 22:28:20 +00:00
Jacob Nevins
d992932e1e Since r7266, it's been possible to get a hostname into Default Settings; but
plink did not cope gracefully with this -- it was not possible to override that
hostname on the command line (attempts at doing so would be treated as part of
the remote command).
Fix this by applying the principle of r7265: if the user didn't explicitly
specify that they wanted to launch the hostname in the default (for instance
with '-load "Default Settings"', we assume they don't want to, and such a
hostname doesn't count when deciding whether to treat a non-option argument as
hostname or command.

[originally from svn r8651]
[r7265 == 5d76e00dac]
[r7266 == 856ed4ae73]
2009-09-14 21:26:48 +00:00
Jacob Nevins
68d9ae20ca In Unix PuTTY, grey out "Restart Session" when it doesn't apply (as the Windows
version does), rather than hiding it completely.

[originally from svn r8650]
2009-09-13 23:41:55 +00:00
Jacob Nevins
924657d8c5 Add a couple of ellipses in Unix context menu (like r759 on Windows).
[originally from svn r8649]
[r759 == 779069ccd3]
2009-09-13 23:37:55 +00:00
Jacob Nevins
5094b58a20 If there are no saved sessions, put a grayed "(No sessions)" entry on the saved
sessions submenu of the terminal window context menu (as Pageant does), rather
than an empty menu (which often renders poorly).

[originally from svn r8648]
2009-09-13 23:29:11 +00:00
Jacob Nevins
b802ee0c16 Avoid compiling autoconf test programs with -Wall -Werror; doing so causes
trouble on Ubuntu, where the Gtk test programs don't check the return value
from system() and thus fall foul of the combination of our -Werror and
<https://wiki.ubuntu.com/CompilerFlags#-D_FORTIFY_SOURCE=2>.

[originally from svn r8638]
2009-08-30 13:16:50 +00:00
Jacob Nevins
6349a69b9b Remove outdated comment.
[originally from svn r8628]
2009-08-21 23:25:48 +00:00
Jacob Nevins
7b8c6957d5 Corey Stup points out a memory leak in the local-proxy implementations.
[originally from svn r8626]
2009-08-21 21:16:22 +00:00
Jacob Nevins
c35eff9213 Add "-serial" to Plink's usage message.
[originally from svn r8618]
2009-08-13 22:01:20 +00:00
Simon Tatham
f3ac927d33 Patch from Alan Clucas (somewhat polished) providing command-line
options to select and configure serial port mode.

[originally from svn r8617]
2009-08-10 20:55:19 +00:00
Jacob Nevins
4bddcc2b5d Workarounds for compiling with -D_FORTIFY_SOURCE=2 (as Ubuntu does), which
doesn't like you to ignore the return value from read()/write()/etc (and
apparently can't be shut up with a cast to void).

[originally from svn r8614]
2009-08-07 00:19:04 +00:00
Jacob Nevins
9c1f81dd94 More use of sockaddr_union (above and beyond that necessary to remove current
warnings).

[originally from svn r8613]
2009-08-06 22:55:15 +00:00
Jacob Nevins
16eeab4066 Avoid "dereferencing pointer 'sa' does break strict-aliasing rules" warnings
from recent versions of GCC.

[originally from svn r8612]
2009-08-06 22:12:05 +00:00
Jacob Nevins
0abd192e83 Alex Besogonov suggests that our Unix autoconf GSSAPI library search order is
sub-optimal -- apparently it prefers shishi above Heimdal, and apparently
that's bad.

[originally from svn r8610]
2009-07-28 23:45:48 +00:00
Jacob Nevins
3767871300 Include putty.h (and hence uxconfig.h) before testing for NO_GSSAPI, so that
"./configure --without-gssapi" actually works. Spotted by Rob Shinn.

[originally from svn r8608]
2009-07-28 23:20:50 +00:00
Simon Tatham
4c0b7ba7e4 Pango-based font handling: combine display of adjacent characters
into a single gdk_draw_layout() where conveniently feasible, after
some work with xtrace revealed this as a major source of pterm's
slow display updates when using client-side fonts.

Ideally we ought to be able to do better. I know exactly what
sequence of X protocol operations I want to see on the wire, but I
don't know how to persuade Pango to generate them.

[originally from svn r8558]
2009-05-11 08:46:17 +00:00
Jacob Nevins
542fc983bb Reported by Tim Kosse: on Unix, read_random_seed() wasn't correctly checking
the return from open() and behaved wrongly in the absence of a seed file.

[originally from svn r8517]
2009-04-26 22:32:41 +00:00
Jacob Nevins
19e47863de Several people have spotted an uninitialised structure member leading to a
potential crash on "reget" in Unix PSFTP.

[originally from svn r8516]
2009-04-26 22:19:30 +00:00
Simon Tatham
d0661ca94e Handle more gracefully the possibility of a keyboard-interactive
prompts packet containing no actual prompts (perhaps due to odd
server organisation, or perhaps so it can print a banner message and
do nothing else). Previously, the get_userpass_input functions
always returned failure when in '-batch' mode, even in this case
where no actual input would be required.

[originally from svn r8490]
2009-03-03 18:35:53 +00:00
Simon Tatham
99782a4066 Debian bug #517535: we were unconditionally interpreting the
'string' field in a GdkEventKey structure as ISO-8859-1, which was
correct for GTK 1.2 but in 2.0 that field is encoded according to
the current C library locale. Hence, we now process that field by
converting it to UTF-8 via trips through both libc and libcharset,
and then let lpage_send() convert from UTF-8 back to whatever it's
supposed to actually go down the line in.

[originally from svn r8470]
2009-02-28 16:52:42 +00:00
Jacob Nevins
d699530e4c Since r8305, Unix PuTTY has always "upgraded" an X11 display like "localhost:0"
to a Unix-domain socket. This typically works fine when PuTTY is run on the
same machine as the X server, but it's broken multi-hop X forwarding through
OpenSSH; when OpenSSH creates a proxy X server "localhost:10", it only listens
on TCP, not on a Unix-domain socket.

Instead, when deciding on the details of the display, we actively probe to see
if there's a Unix-domain socket we can use instead, and only use it if it's
there, falling back to the specified IP "localhost" if not.

Independently, when looking for local auth details in Xauthority for a
"localhost" TCP display, we prefer a matching Unix-domain entry, but will fall
back to an IP "localhost" entry (which would be unusual, but we don't trust a
Windows X server not to do it) -- this is a generalisation of the special case
added in r2538 (but removed in r8305, as the automatic upgrade masked the need
for it).
(This is now done in platform-independent code, so a side-effect is that
get_hostname() is now part of the networking abstraction on all platforms.)

[originally from svn r8462]
[r2538 == fda9983243]
[r8305 == ca6fc3a4da]
2009-02-24 01:01:23 +00:00
Jacob Nevins
40be9eeedd Stop attempting to make session logs private on Unix. This was introduced in
r7084 at the same time as sensible permissions when writing private key files;
however, it causes an assertion failure whenever an attempt is made to append
to an existing log file on Unix, and it's not clear what "is_private" *should*
do for append, so revert to log file security being the user's responsibility.
(Fixes Ubuntu LP#212711.)

[originally from svn r8461]
[r7084 == 4fa9564c90]
2009-02-23 22:40:09 +00:00
Simon Tatham
464aa76aaf Check the two popen() calls in noise_get_heavy for NULL.
[originally from svn r8411]
2009-01-13 18:18:35 +00:00
Jacob Nevins
e4027368fd It's a new year (and there have even been checkins).
[originally from svn r8392]
[this svn revision also touched putty-website]
2009-01-05 23:49:19 +00:00
Jacob Nevins
e0deac8960 sk_address_is_local() failed to cope when presented with a Unix-domain socket.
This could cause Unix PuTTY to segfault when X forwarding over an SSH session
through a proxy.
(sk_getaddr() wouldn't cope either -- in that case, add an assertion to make it
more obvious; I don't think it should ever happen.)

[originally from svn r8391]
2009-01-05 23:36:14 +00:00
Jacob Nevins
bd5cec280a Add some hard-coded textual literal-IP representations of localhost to
sk_hostname_is_local(), to catch the case where we're doing something like X11
forwarding over SSH through a proxy, and we've thus disabled local lookup of
hostnames.
(I think this is what's behind the report in
<e9a86996-5dc2-4428-9b0c-c65693ca6351@m32g2000hsf.googlegroups.com>
in comp.security.ssh, although I'd like to know more of the circumstances.)

[originally from svn r8385]
2009-01-05 02:45:38 +00:00
Jacob Nevins
51bceb0c9a ...and fix an unlikely memory leak.
[originally from svn r8384]
2009-01-05 01:15:06 +00:00
Jacob Nevins
030046a2a8 Cope with a (non-standard) ENAMETOOLONG return from gethostname(); glibc will
do this if the supplied buffer isn't big enough, which shouldn't lead to
complete abandonment of X11 auth. (Would only have bitten with hostnames
>255 chars anyway.)

[originally from svn r8383]
2009-01-05 01:01:58 +00:00
Jacob Nevins
07a876ce1e r8305 made platform_x11_best_transport[] obsolete, but there still seem to be a
few instances around; expunge them.

[originally from svn r8382]
[r8305 == ca6fc3a4da]
2009-01-04 23:36:24 +00:00
Simon Tatham
742e65d66b gtk_selection_clear_targets() does not exist on GTK 1, so ifdef it.
[originally from svn r8371]
2008-12-03 00:06:38 +00:00
Simon Tatham
e6fee2636d At some point recently, Unix PuTTY started suffering build errors
using -DNO_GSSAPI. Move some ifdefs around so it stops.

[originally from svn r8370]
2008-12-02 18:18:32 +00:00
Simon Tatham
5fec8bd897 Add missing call to gtk_selection_clear_targets(), without which the
list of selection targets offered by GTK PuTTY/pterm grows an extra
copy of each of the three supported text formats every time the user
makes a selection!

[originally from svn r8364]
2008-12-01 23:03:11 +00:00
Ben Harris
5d0d5e0466 Change the Unix version of Ssh_gss_name to be a gss_name_t rather than
void *, and hence eliminate a few casts.  The Windows definition is
unchanged, but I daresay I've managed to stop it compiling nonetheless.

[originally from svn r8359]
2008-12-01 21:18:29 +00:00
Ben Harris
e5eabee3c0 Now that we use real gss_buffer_ts, there's no need to muck about with
casts when passing them to GSS-API functions.  Removing them makes the code
more readable and allows better type-checking.

[originally from svn r8333]
2008-11-25 22:11:17 +00:00
Ben Harris
81dafd906e Change how we handle the Ssh_gss_buf type. Previously, we defined it
ourselves, but on Unix then assumed it was compatible with the system's
gss_buffer_desc, which wasn't the case on LP64 systems.  Now, on Unix
we make Ssh_gss_buf into an alias for gss_buffer_desc, though we keep
something similar to the existing behaviour on Windows.  This requires
renaming a couple of the fields in Ssh_gss_buf, and hence fixing all
the references.

Tested on Linux (MIT Kerberos) and Solaris.  Compiled on NetBSD (Heimdal).
Not tested on Windows because neither mingw32 nor winegcc worked out of the
box for me.  I think the Windows changes are all syntactic, though, so
if this compiles it should work no worse than before.

[originally from svn r8326]
2008-11-24 23:44:55 +00:00
Ben Harris
7da40ece76 Autoconfiscate GSS-API support, including support for manually disabling it.
[originally from svn r8318]
2008-11-22 22:49:27 +00:00
Ben Harris
f45bfdbf1f Changes to make this compile on Solaris 9: use <gssapi/gssapi.h> rather
than <gssapi/gssapi_krb5.h> and provide the OID for Kerberos 5 ourselves
(since it's a known constant).  I'm not sure this actually works on Solaris
yet, mind.

[originally from svn r8317]
2008-11-22 22:06:42 +00:00
Simon Tatham
ca6fc3a4da Revamp of the local X11 connection code. We now parse X display
strings more rigorously, and then we look up the local X authority
data in .Xauthority _ourself_ rather than delegating to an external
xauth program. This is (negligibly) more efficient on Unix, assuming
I haven't got it wrong in some subtle way, but its major benefit is
that we can now support X authority lookups on Windows as well
provided the user points us at an appropriate X authority file in
the standard format. A new Windows-specific config option has been
added for this purpose.

[originally from svn r8305]
2008-11-17 18:38:09 +00:00
Simon Tatham
0cef8a897d Avoid freeing the backend in notify_remote_exit(), since that's
called from within a backend function which will expect its own
backend pointer to still be valid on return. Instead, move all the
real functionality of notify_remote_exit() out into a GTK idle
function.

[originally from svn r8304]
2008-11-17 18:36:27 +00:00
Simon Tatham
59691d28a3 Implement sk_addr_dup().
[originally from svn r8294]
2008-11-08 16:58:55 +00:00
Simon Tatham
6e2501be77 Move out of the SockAddr structure the mutable fields "ai" and
"curraddr", and turn "family" into a macro-derived property of the
other fields. The idea is that this renders SockAddrs immutable once
created, which should open up the possibility of duplicating and
reusing one without having to redo the actual DNS lookup.

I _hope_ I haven't broken anything. The new code architecture
contains several rather dubious-looking operations (namely the
arbitrary choice of the first returned address in functions like
sk_getaddr and sk_address_is_local - what if, for instance, a DNS
lookup returned a local and a non-local address?), but I think they
were functionally just as dubious beforehand and all this change has
done is to make them more obviously so to a reader.

[originally from svn r8293]
2008-11-08 16:45:45 +00:00
Jacob Nevins
e415865e58 Fix inability to save session on Unix when ~/.putty doesn't exist introduced
in r7934.

[originally from svn r8204]
[r7934 == 087adb167e]
2008-10-12 11:32:23 +00:00
Simon Tatham
4829802c43 Good grief. When I originally wrote the local proxy code two years
ago, I apparently caused all data received from local proxies to be
unconditionally tagged as TCP Urgent. Most network backends ignore
this, but it's critical to the Telnet backend, which will ignore all
Urgent-marked data in the assumption that there's a SYNCH on its way
that it should wait for. Nobody has noticed in two years, presumably
meaning that nobody has ever tried to do Telnet over a local proxy
in that time.

[originally from svn r8158]
2008-08-31 21:45:39 +00:00
Simon Tatham
0251dbf13e Colin Watson points out an apparently erroneous cast: Ssh_gss_name
and gss_name_t are supposed to be congruent types, so a pointer to
one should never be cast to a non-indirect instance of the other.

[originally from svn r8157]
2008-08-31 19:18:17 +00:00
Jacob Nevins
6e2bd31d32 Fix for portfwd-addr-family: on Unix, when a tunnel is specified as "Auto"
(rather than IPv4 or IPv6-only; this is the default), try to open up listening
sockets on both address families, rather than (unhelpfully) just IPv6. (And
don't open one if the other can't be bound, in a nod to CVE-2008-1483.)
Based on a patch from Ben A L Jemmett.

[originally from svn r8150]
[this svn revision also touched putty-wishlist]
2008-08-20 22:21:04 +00:00
Owen Dunn
de5dd9d65c Initial commit of GSSAPI Kerberos support.
[originally from svn r8138]
2008-08-10 13:10:31 +00:00
Jacob Nevins
f405259798 Cosmetic: use `appname' in more places, so that Unix PuTTYtel announces itself
thus.

[originally from svn r8075]
2008-06-15 13:26:08 +00:00
Simon Tatham
189c9a2a08 Work around a bug in early versions of GTK (which I'm still forced
to use, gah) in which the "model" argument to
gtk_tree_selection_get_selected_rows() couldn't be NULL.

[originally from svn r8069]
2008-06-11 18:03:35 +00:00
Simon Tatham
65ae6ba3d2 Manfred Schwarb points out that scroll wheel support stopped working
with the switch to GTK2. This turns out to be because, where GTK1
represented the scroll wheel as mouse buttons 4 and 5 and generated
GdkEventButton when it was moved, GTK2 has moved wheel actions out
into a new event type GdkEventScroll which we were not handling. Now
we do, so scroll wheel support should be back in place.

[originally from svn r8063]
2008-06-10 20:18:23 +00:00
Simon Tatham
b3c1438a31 Re-jig the combo box handling ifdefs so that we can compile with GTK
versions >= 2.0 (when the new list boxes came in) but < 2.4 (when
the new combo boxes came in). Since some combo boxes are handled
using the old list-box code, this means that the two lots of code
can both be compiled in at once in some situations!

[originally from svn r8031]
2008-05-31 19:23:45 +00:00
Simon Tatham
79f7249185 On some systems, strncpy is a macro, and putting preprocessor
directives in the middle of a macro invocation appears to be frowned
on. Irritating, but there we go.

[originally from svn r8026]
2008-05-31 13:29:32 +00:00
Simon Tatham
85c227326c Merge from trunk up to r8020.
[originally from svn r8021]
[r8020 == 14d825d42f]
2008-05-28 19:28:17 +00:00
Simon Tatham
14d825d42f OS X Leopard, it turns out, has a new and exciting strategy for
addressing X displays. Update PuTTY's display-name-to-Unix-socket-
path translation code to cope with it, thus causing X forwarding to
start working again on Leopard.

[originally from svn r8020]
2008-05-28 19:23:57 +00:00
Simon Tatham
cb18f9a6eb Oops; prevent further segfault during setup, which apparently only
show up when building without debugging...

[originally from svn r7991]
2008-04-14 18:00:57 +00:00
Simon Tatham
92caf21c2c Prevent assertion failure in the case where the user manipulates the
filter checkboxes to filter the currently selected font out of the
family list and then does something in one of the other list boxes
or the size edit box.

[originally from svn r7990]
2008-04-14 17:57:45 +00:00
Simon Tatham
6af8462765 Just noticed that selecting "client:Bitstream Vera Sans Mono 10" in
the font config box and then invoking the unifontsel causes the box
to come up empty rather than populated with that font. Turns out
that I completely forgot to have pangofont_canonify_fontname()
return the flags word, ahem.

[originally from svn r7988]
2008-04-13 07:48:10 +00:00
Simon Tatham
8ac9896853 In the new unified font handling, my strategy so far for combining
client- and server-side fonts into a single namespace was mainly to
hope there would naturally be no collisions, and to provide
disambiguating "client:" and "server:" prefixes for manual use in
emergencies.

Jacob points out, however, that his system not only has a namespace
clash but worse still the clash is at the name "fixed", which is our
default font! So, modify my namespace policy to use the
disambiguating prefixes everywhere by default, and use _unprefixed_
names only if the user types one in by hand.

In particular, I've changed the keys used to store font names in
Unix saved session files. Font names read from the new keys will be
passed straight to the new unifont framework; font names read from
the old keys will have "server:" prepended. So any existing
configuration file for GTK1 PuTTY should now work reliably in GTK2
PuTTY and select the same font, even if that font is one on which
your system (rather, your client+server combination) has a font
namespace clash.

[originally from svn r7973]
2008-04-05 13:37:20 +00:00
Simon Tatham
2503cd1861 Ensure the new depth' and treepath' structure fields in struct
selparam are always properly initialised.

[originally from svn r7972]
2008-04-05 12:53:32 +00:00
Simon Tatham
db281abd97 gtk_combo_box_get_active_text didn't appear until GTK 2.6; bodge
around it for earlier versions of GTK 2.

[originally from svn r7969]
2008-04-04 12:23:29 +00:00
Simon Tatham
ceb2a9b862 Fix the jarring change of window size on expanding the SSH branch of
the configuration tree.

[originally from svn r7968]
2008-04-04 11:37:06 +00:00
Simon Tatham
bfa9859f2a I apparently missed out a piece of code when doing the new GTK2 list
box: shortcut activations for list boxes are missing.

That's the last thing on the to-do list. We're now ready to merge
back to the trunk, given only some final testing!

[originally from svn r7967]
2008-04-04 11:02:26 +00:00
Simon Tatham
ee92c21e53 Reinstate all the GTK1-specific code under ifdefs, and verify that
we can now build and run successfully using both GTK1 and GTK2 by
giving appropriate options to make. (Specifically, to override the
default of GTK2 in favour of GTK1, "make GTK_CONFIG=gtk-config".)

[originally from svn r7966]
2008-04-04 10:56:26 +00:00
Simon Tatham
54e26eb7ef Rename a structure field to avoid clashing with one of the old GTK1
ones. (I'm going to merge the GTK1 list code back in under ifdefs,
and I want none of the disputed structure fields to have the same
names, so that I'll reliably be told by the compiler if I keep the
wrong piece of code outside the ifdef.)

[originally from svn r7965]
2008-04-04 10:16:24 +00:00
Simon Tatham
a128ee8588 Update autoconf for GTK 2. We now check for both GTK2 and GTK1, and
in the presence of GTK 2 we also check to see whether we have a
prehistoric Pango (since Pango itself helpfully doesn't provide that
functionality, bah).

[originally from svn r7964]
2008-04-02 17:32:17 +00:00
Simon Tatham
ed085ca824 Another tedious chore off the to-do list. I've just checked over my
custom Columns layout class to see what fiddly details of
GTK2isation were yet to be done. It turns out that all the basic
object management got moved out of GTK into a separate library, so
that all the gtk_object_* calls are deprecated and g_object_* should
be used instead; having done that, though, it all looks perfectly
fine.

[originally from svn r7962]
2008-04-02 17:04:21 +00:00
Simon Tatham
50d4d05679 TODO update: I don't think it's worth switching to GTK2's native
shortcut mechanism. The existing code doesn't use any deprecated
calls, and translating shortcut text _into_ Pango markup just sounds
too unpleasant to do if I don't actually have to. Not to mention
that the documentation for the Pango markup language doesn't tell me
how to distinguish a mnemonic underscore prefix from a literal
underscore in label text, but I know my current code can get that
right (the current config box talks about TCP_NODELAY and
SO_KEEPALIVE in widget labels that also have functioning shortcuts).

[originally from svn r7961]
2008-04-02 16:26:01 +00:00
Simon Tatham
29d875f7da Enable the display of server-side font aliases by default in my font
selector. I had previously been worried that the default of not
showing aliases interacted badly with the default actual font
_being_ specified as an alias. One of those defaults had to change,
and I've decided which: `fixed' is staying as Unix PuTTY's default
font in defiance of GTK2's vigorous encouragement of Pango.

[originally from svn r7960]
2008-04-02 14:50:47 +00:00
Simon Tatham
6a743399b0 Update all the list box code in gtkdlg.c to use the new-style GTK2
GtkTreeView, GtkComboBox and GtkComboBoxEntry instead of the various
old deprecated stuff. Immediate benefit: GTK2 natively supports real
drag lists, hooray!

[originally from svn r7959]
2008-04-02 14:48:06 +00:00
Simon Tatham
d2b4b4a9ef Explicit casts to placate OS X gcc's pedantic type-check warnings.
[originally from svn r7958]
2008-03-31 10:47:48 +00:00
Simon Tatham
6ef1fa7b1f I give up. I can't work out what the purpose of the call to
gtk_container_dequeue_resize_handler in request_resize() was;
everything seems to work fine without it. So I'm removing the
nonportable GTK 2 instance of it, and if anything ever goes wrong as
a result then I'll at least find out what the problem was.

[originally from svn r7957]
2008-03-29 20:02:12 +00:00
Simon Tatham
bef50d3fd2 Be more picky than Pango when validating a Pango font description
string. Without this, Richard B reports that Pango 1.18 will treat
_anything_ as valid, which means PuTTY can never fall back to X
fonts.

[originally from svn r7956]
2008-03-29 15:44:32 +00:00
Simon Tatham
9adbc97e91 TODO updates.
[originally from svn r7955]
2008-03-29 14:57:56 +00:00
Simon Tatham
c3dbd71f9d Aha, _that's_ why there was some unexplained space on the RHS of the
font selector: I had got the row and column counts in
gtk_table_new() back to front, so the space on the right was the
padding around five empty table columns! (And apparently a GtkTable
silently expands if you try to use rows that don't exist, which is
why I hadn't already noticed.)

Fixed that, and added some padding around the entire table. I think
my font selector is now finished, except for any bug fixes that come
up in testing.

[originally from svn r7954]
2008-03-29 14:54:55 +00:00
Simon Tatham
ae802c16d8 Deal with the possibility of no valid font being selected at all
during an entire run of unifontsel (because unifontsel_set_name was
either not called at all, or called with a name that didn't
correspond to any known font). In this situation we grey out the OK
button until a valid font is selected, and we have
unifontsel_get_name return NULL rather than failing an assertion if
it should be called in that state. The current client code in
gtkdlg.c should never encounter a NULL return, since it only calls
it after the OK button is clicked, but I've stuck an assertion in
there too on general principles.

[originally from svn r7953]
2008-03-29 14:21:25 +00:00
Simon Tatham
f07f782547 Prevent NULL-dereferencing segfaults when the font selector is
invoked with no valid font in the input text.

[originally from svn r7952]
2008-03-29 13:59:31 +00:00
Simon Tatham
0527d54f03 Richard B points out another thing for the overall GTK2 to-do list.
[originally from svn r7951]
2008-03-29 13:55:51 +00:00
Simon Tatham
05766d7214 Cosmetic polishing.
[originally from svn r7950]
2008-03-29 13:55:40 +00:00
Simon Tatham
cce6a5e2ec Detect non-monospaced X fonts, and respond by drawing text one
character at a time centred in its character cell, as we do for
Pango. Gives much better results for those non-monospaced fonts
which are usable as terminal fonts, and shows up the problems with
the others more readily. (In particular, this means the preview pane
in the font selector now warns you there will be trouble if you
select such a font.)

[originally from svn r7949]
2008-03-29 10:48:16 +00:00
Simon Tatham
115898b2a5 Add the rest of ASCII to the font preview window.
[originally from svn r7948]
2008-03-29 10:25:45 +00:00
Simon Tatham
6e6eae2506 When the user switches between fonts using the font family or style
selectors, preserve their most recent size selection as faithfully
as possible. We do this by having a secondary size variable
indicating what they _intend_, so we can come back to their intended
size even after going through a font which doesn't include it.

[originally from svn r7947]
2008-03-29 10:16:48 +00:00
Simon Tatham
d173eb52ea Improve the preview pane text.
[originally from svn r7946]
2008-03-28 20:08:12 +00:00
Simon Tatham
638e350e1f Move the font-preview updating code out into a separate function so
we can call it both when the drawing area changes size and when the
selected font changes. As a result, the preview pane doesn't start
off blank any more.

[originally from svn r7945]
2008-03-27 19:53:28 +00:00