1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-06 14:02:47 -05:00

Stop using deprecated gtk_container_set_focus_chain().

In GTK 2, this function was a new and convenient way to override the
order in which the Tab key cycled through the sub-widgets of a
container, replacing the more verbose mechanism in GTK 1 where you had
to provide a custom implementation of the "focus" method in
GtkContainerClass.

GTK 3.24 has now deprecated gtk_container_set_focus_chain(),
apparently on the grounds that that old system is what they think you
_ought_ to be doing. So I've abandoned set_focus_chain completely, and
switched back to doing it by a custom focus method for _all_ versions
of GTK, with the only slight wrinkle being that between GTK 1 and 2
the method in question moved from GtkContainer to GtkWidget (my guess
is so that an individual non-container widget can still have multiple
separately focusable UI components).
This commit is contained in:
Simon Tatham
2018-10-28 09:14:53 +00:00
parent ab89fd7847
commit 730af28b99
2 changed files with 39 additions and 38 deletions

View File

@ -53,6 +53,7 @@
#define gtk_widget_get_parent(w) ((w)->parent)
#define gtk_widget_set_allocation(w, a) ((w)->allocation = *(a))
#define gtk_container_get_border_width(c) ((c)->border_width)
#define gtk_container_get_focus_child(c) ((c)->focus_child)
#define gtk_bin_get_child(b) ((b)->child)
#define gtk_color_selection_dialog_get_color_selection(cs) ((cs)->colorsel)
#define gtk_selection_data_get_target(sd) ((sd)->target)
@ -79,6 +80,10 @@
#define gtk_widget_get_mapped(w) GTK_WIDGET_MAPPED(w)
#define gtk_widget_get_realized(w) GTK_WIDGET_REALIZED(w)
#define gtk_widget_get_state(w) GTK_WIDGET_STATE(w)
#define gtk_widget_get_can_focus(w) GTK_WIDGET_CAN_FOCUS(w)
#define gtk_widget_is_drawable(w) GTK_WIDGET_DRAWABLE(w)
#define gtk_widget_is_sensitive(w) GTK_WIDGET_IS_SENSITIVE(w)
#define gtk_widget_has_focus(w) GTK_WIDGET_HAS_FOCUS(w)
/* This is a bit of a bodge because it relies on us only calling this
* macro as GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), so under