simon-git: putty (master): Simon Tatham
Commits to Tartarus CVS repository.
tartarus-commits at lists.tartarus.org
Mon Aug 31 16:49:59 BST 2015
TL;DR:
1ce2701 Add a new #define to disable pty_pre_init.
69737b2 Add a bodge to make pty masters nonblocking on OS X.
7acb747 Handle the Ctrl modifier key ourselves if necessary.
1fa0b5a Introduce a config option for building on OS X GTK.
5de838a Don't use "server:fixed" as the default font without X.
620622b Switch to gdk_rgba_parse() for GDK 3.
4e243ae Avoid using gdk_cursor_new() in GTK 3.
0b5a0c4 Avoid deprecated gtk_misc_set_alignment().
ad8995b Stop using GtkAlignment in GTK 3.
55de891 Use GtkMessageDialog for dlg_error().
749b0fd Add a missing cast in g_object_set.
dc11417 Stop using GtkDialog (for most purposes) in GTK 3!
49ff9f4 Move more functions into the new gtkmisc.c.
976e778 Slightly improve layout in GTK3 Pageant passphrase prompts.
7658b29 Fix an uninitialised bufchain in NO_PTY_PRE_INIT mode.
ad994ba Work around Pango fonts with fractional width.
Repository: git://git.tartarus.org/simon/putty.git
On the web: http://tartarus.org/~simon-git/gitweb/?p=putty.git
Branch updated: master
Committer: Simon Tatham <anakin at pobox.com>
Date: 2015-08-31 16:49:59
commit 1ce27010dd060508f349aa25a57f18f61edc0c7b
web diff http://tartarus.org/~simon-git/gitweb/?p=putty.git;a=commitdiff;h=1ce27010dd060508f349aa25a57f18f61edc0c7b;hp=e5b266a681f501294ddc56788fdf18866937db8f
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Aug 31 12:51:25 2015 +0100
Add a new #define to disable pty_pre_init.
OS X dislikes us calling the setuid or setgid syscalls when not
privileged, even if we try to set ourselves to the _same_ uid/gid.
Since I don't anticipate this code needing to run setuid on OS X, and
since I do anticipate wanting to handle multiple ptys in a single
process so that pty_pre_init would be useless anyway, the simplest fix
seems to me to be just conditioning out the whole of pty_pre_init
completely.
unix/uxpty.c | 7 +++++++
1 file changed, 7 insertions(+)
commit 69737b24b56d7f7befc27e473f8a61a7e32af5b6
web diff http://tartarus.org/~simon-git/gitweb/?p=putty.git;a=commitdiff;h=69737b24b56d7f7befc27e473f8a61a7e32af5b6;hp=1ce27010dd060508f349aa25a57f18f61edc0c7b
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Aug 31 13:00:19 2015 +0100
Add a bodge to make pty masters nonblocking on OS X.
OS X for some reason doesn't let my usual fcntl approach (wrapped in
nonblock()) work on pty masters - the fcntl(F_SETFL) fails, with the
(in this context) hilariously inappropriate error code ENOTTY. Work
around it by instead passing O_NONBLOCK to posix_openpt.
unix/uxpty.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
commit 7acb747a7d7e6835f07240f27b3b382155815600
web diff http://tartarus.org/~simon-git/gitweb/?p=putty.git;a=commitdiff;h=7acb747a7d7e6835f07240f27b3b382155815600;hp=69737b24b56d7f7befc27e473f8a61a7e32af5b6
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Aug 31 13:00:42 2015 +0100
Handle the Ctrl modifier key ourselves if necessary.
The Quartz GDK back end, if you press (say) Ctrl-A, will generate a
GdkKeyEvent with keyval='a' and state=CONTROL, but it'll have a
translated string of "a" where the X back end would have returned
"\001". So we have to do our own translation, which fortunately isn't
hard.
unix/gtkwin.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
commit 1fa0b5a1ac21ae204f5514203e2fa1d5ea287a67
web diff http://tartarus.org/~simon-git/gitweb/?p=putty.git;a=commitdiff;h=1fa0b5a1ac21ae204f5514203e2fa1d5ea287a67;hp=7acb747a7d7e6835f07240f27b3b382155815600
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Aug 31 13:05:51 2015 +0100
Introduce a config option for building on OS X GTK.
Using GTK to run on OS X is going to require several workarounds and
behaviour tweaks to be enabled at various points in the code, and it's
already getting cumbersome to remember what they all are to put on the
command line. Here's a central #define (OSX_GTK) that enables them all
in one go, and a configure option (--with-quartz) that sets it.
As part of this commit, I've also rearranged the #include order in the
GTK source files, so that they include unix.h (which now might be
where NOT_X_WINDOWS gets defined) before they test NOT_X_WINDOWS to
decide whether to include X11 headers.
configure.ac | 6 ++++++
unix/gtkdlg.c | 13 +++++++------
unix/gtkfont.c | 12 +++++++-----
unix/gtkwin.c | 13 +++++++------
unix/unix.h | 14 ++++++++++++++
5 files changed, 41 insertions(+), 17 deletions(-)
commit 5de838a979f75380c5fc4bec39646b81b44bd9b6
web diff http://tartarus.org/~simon-git/gitweb/?p=putty.git;a=commitdiff;h=5de838a979f75380c5fc4bec39646b81b44bd9b6;hp=1fa0b5a1ac21ae204f5514203e2fa1d5ea287a67
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Aug 31 13:24:09 2015 +0100
Don't use "server:fixed" as the default font without X.
If we're not supporting server-side fonts, it's utterly silly to set
one as the default! Instead, we use Pango's guarantee that some
reasonably sensible monospaced font will be made available under the
name "Monospace", and use that at a reasonable default size of 12pt.
unix/gtkfont.c | 2 +-
unix/gtkwin.c | 2 +-
unix/unix.h | 9 +++++++++
3 files changed, 11 insertions(+), 2 deletions(-)
commit 620622b3e552d899f23097ad51a3ed024796e59f
web diff http://tartarus.org/~simon-git/gitweb/?p=putty.git;a=commitdiff;h=620622b3e552d899f23097ad51a3ed024796e59f;hp=5de838a979f75380c5fc4bec39646b81b44bd9b6
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Aug 31 13:37:30 2015 +0100
Switch to gdk_rgba_parse() for GDK 3.
I'm using a slightly more up-to-date GTK version for testing on MacOS,
and it's marked a few more functions as deprecated, among which is
gdk_color_parse(). So now parsing -fg and -bg options has to be done
by two different calls and an ugly #ifdef, depending on GTK version.
unix/gtkwin.c | 58 ++++++++++++++++++++++++++++++++++++++-------------------
1 file changed, 39 insertions(+), 19 deletions(-)
commit 4e243ae9a4a08a3697b4803357bd12375f801998
web diff http://tartarus.org/~simon-git/gitweb/?p=putty.git;a=commitdiff;h=4e243ae9a4a08a3697b4803357bd12375f801998;hp=620622b3e552d899f23097ad51a3ed024796e59f
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Aug 31 13:41:16 2015 +0100
Avoid using gdk_cursor_new() in GTK 3.
It's deprecated in up-to-date versions, but fortunately, the
workaround is just to explicitly include the appropriate GdkDisplay.
unix/gtkcompat.h | 3 +++
1 file changed, 3 insertions(+)
commit 0b5a0c4da1f40fee351be1ae4494ef36ce1bef11
web diff http://tartarus.org/~simon-git/gitweb/?p=putty.git;a=commitdiff;h=0b5a0c4da1f40fee351be1ae4494ef36ce1bef11;hp=4e243ae9a4a08a3697b4803357bd12375f801998
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Aug 31 13:57:34 2015 +0100
Avoid deprecated gtk_misc_set_alignment().
As of GTK 3.16 (but not in previous GTK 3 versions), there's a new
gtk_label_set_xalign which does this job.
unix/gtkdlg.c | 13 +++++++++++--
unix/gtkfont.c | 8 +++++---
unix/unix.h | 6 +++++-
3 files changed, 21 insertions(+), 6 deletions(-)
commit ad8995b0d674d63a0a6898b0879dc3c9bb55dab2
web diff http://tartarus.org/~simon-git/gitweb/?p=putty.git;a=commitdiff;h=ad8995b0d674d63a0a6898b0879dc3c9bb55dab2;hp=0b5a0c4da1f40fee351be1ae4494ef36ce1bef11
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Aug 31 14:05:51 2015 +0100
Stop using GtkAlignment in GTK 3.
We were using it in the main config box to ensure everything expanded
on window resize, but in GTK3 that's the default anyway. And we were
using it to put padding around the edges of the font selector, which
is now done using the "margin" property.
unix/gtkdlg.c | 6 ++++++
unix/gtkfont.c | 18 ++++++++++++++++--
2 files changed, 22 insertions(+), 2 deletions(-)
commit 55de891e5437cf520c0231b4b42a855e14395b3d
web diff http://tartarus.org/~simon-git/gitweb/?p=putty.git;a=commitdiff;h=55de891e5437cf520c0231b4b42a855e14395b3d;hp=ad8995b0d674d63a0a6898b0879dc3c9bb55dab2
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Aug 31 14:29:56 2015 +0100
Use GtkMessageDialog for dlg_error().
This is a much simpler way to display simple message-box type dialogs,
whose absence I've previously been working around by laboriously
constructing something in my usual style.
unix/gtkdlg.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
commit 749b0fdda01dc7837302bbcc0f577e8d397cc0e6
web diff http://tartarus.org/~simon-git/gitweb/?p=putty.git;a=commitdiff;h=749b0fdda01dc7837302bbcc0f577e8d397cc0e6;hp=55de891e5437cf520c0231b4b42a855e14395b3d
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Aug 31 14:36:12 2015 +0100
Add a missing cast in g_object_set.
When NULL appears in variadic argument lists, it should be cast to the
pointer type that the function will be expecting, because otherwise it
might end up as a type not even the same size as a pointer.
unix/gtkdlg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit dc11417aeeec0735071cf98347af6f9616ba6a2e
web diff http://tartarus.org/~simon-git/gitweb/?p=putty.git;a=commitdiff;h=dc11417aeeec0735071cf98347af6f9616ba6a2e;hp=749b0fdda01dc7837302bbcc0f577e8d397cc0e6
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Aug 31 15:45:18 2015 +0100
Stop using GtkDialog (for most purposes) in GTK 3!
They've now deprecated gtk_dialog_get_action_area, because they really
want a dialog box's action area to be filled with nothing but buttons
controlled by GTK which end the dialog with a response code. But we're
accustomed to putting all sorts of other things in our action area -
non-buttons, buttons that don't end the dialog, and sub-widgets that
do layout - and so I think it's no longer sensible to be trying to
coerce our use cases into GtkDialog.
Hence, I'm introducing a set of wrapper functions which equivocate
between a GtkDialog for GTK1 and GTK2, and a GtkWindow with a vbox in
it for GTK3, and I'll lay out the action area by hand.
(Not everything has sensible layout and margins in the new GTK3 system
yet, but I can sort that out later.)
Because the new functions are needed by gtkask.c, which doesn't link
against gtkdlg.c or include putty.h, I've put them in a new source
file and header file pair gtkmisc.[ch] which is common to gtkask and
the main GTK edifice.
Recipe | 4 +-
unix/gtkask.c | 18 ++++---
unix/gtkdlg.c | 127 ++++++++-----------------------------------------
unix/gtkmisc.c | 145 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
unix/gtkmisc.h | 15 ++++++
5 files changed, 193 insertions(+), 116 deletions(-)
commit 49ff9f480e973060c0c7215868fae53db096ce2d
web diff http://tartarus.org/~simon-git/gitweb/?p=putty.git;a=commitdiff;h=49ff9f480e973060c0c7215868fae53db096ce2d;hp=dc11417aeeec0735071cf98347af6f9616ba6a2e
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Aug 31 15:44:24 2015 +0100
Move more functions into the new gtkmisc.c.
Several utility functions I've written over the last few weeks were in
rather random places because I didn't have a central gtkmisc.c to put
them in. Now I've got one, put them there!
unix/gtkdlg.c | 16 ----------------
unix/gtkfont.c | 41 +----------------------------------------
unix/gtkmisc.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
unix/gtkmisc.h | 5 +++++
unix/gtkwin.c | 1 +
unix/unix.h | 8 --------
6 files changed, 59 insertions(+), 64 deletions(-)
commit 976e7782695070a0e20163e13b692e2d1150f401
web diff http://tartarus.org/~simon-git/gitweb/?p=putty.git;a=commitdiff;h=976e7782695070a0e20163e13b692e2d1150f401;hp=49ff9f480e973060c0c7215868fae53db096ce2d
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Aug 31 15:45:27 2015 +0100
Slightly improve layout in GTK3 Pageant passphrase prompts.
Now I've moved align_label_left() into gtkmisc.c where gtkask.c can
get at it, we can use it to fix the alignment of the prompt label.
Also, use gtk_label_set_width_chars() to give the label a more or less
sensible width.
unix/gtkask.c | 4 ++++
1 file changed, 4 insertions(+)
commit 7658b291dbde482d483500883af8ae31c4194e8c
web diff http://tartarus.org/~simon-git/gitweb/?p=putty.git;a=commitdiff;h=7658b291dbde482d483500883af8ae31c4194e8c;hp=976e7782695070a0e20163e13b692e2d1150f401
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Aug 31 16:11:37 2015 +0100
Fix an uninitialised bufchain in NO_PTY_PRE_INIT mode.
The Pty that we created in pty_pre_init had its bufchain properly
initialised, but if that one didn't get created, then the one we
create in pty_init did not. Now both should go through the same init
routine.
unix/uxpty.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
commit ad994bab57c06bff0c6d06d0ca8806be0bb2afd2
web diff http://tartarus.org/~simon-git/gitweb/?p=putty.git;a=commitdiff;h=ad994bab57c06bff0c6d06d0ca8806be0bb2afd2;hp=7658b291dbde482d483500883af8ae31c4194e8c
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Aug 31 16:37:05 2015 +0100
Work around Pango fonts with fractional width.
By retrieving characters' widths using get_extents and not
get_pixel_extents, we can spot when they're not actually an exact
multiple of a pixel, and avoid getting confused by the overall width
of a long string being off by up to a pixel per character.
unix/gtkfont.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
More information about the tartarus-commits
mailing list