зеркало из https://github.com/github/putty.git
Let puttyapp/ptermapp build against old Gtk 3.
gtk_application_set_accels_for_action() is new in Gtk 3.12, but (e.g.) Ubuntu 14.04 LTS still ships with Gtk 3.10. On the other hand, the function I've used instead, gtk_application_add_accelerator(), is deprecated from Gtk 3.14 onwards, indicating that it will disappear in some future version, so I've left the newer code in against that day.
This commit is contained in:
Родитель
599bab84a1
Коммит
5f7604888b
|
@ -153,12 +153,20 @@ static void startup(GApplication *app, gpointer user_data)
|
|||
g_menu_append(section, "Clear Scrollback", "win.clearscrollback");
|
||||
g_menu_append(section, "Reset Terminal", "win.resetterm");
|
||||
|
||||
#if GTK_CHECK_VERSION(3,12,0)
|
||||
#define SET_ACCEL(app, command, accel) do \
|
||||
{ \
|
||||
static const char *const accels[] = { accel, NULL }; \
|
||||
gtk_application_set_accels_for_action( \
|
||||
GTK_APPLICATION(app), command, accels); \
|
||||
} while (0)
|
||||
#else
|
||||
/* The Gtk function used above was new in 3.12; the one below
|
||||
* was deprecated from 3.14. */
|
||||
#define SET_ACCEL(app, command, accel) \
|
||||
gtk_application_add_accelerator(GTK_APPLICATION(app), accel, \
|
||||
command, NULL)
|
||||
#endif
|
||||
|
||||
SET_ACCEL(app, "app.newwin", "<Primary>n");
|
||||
SET_ACCEL(app, "win.copy", "<Primary>c");
|
||||
|
|
Загрузка…
Ссылка в новой задаче