Upgrade to Gtk+ 3 and current Vte
cover Upgrade to Gtk+ 3 and current Vte
The big change is that spawning a shell is now done "manually" as vte_terminal_fork_*() have been removed.
This patchset is part of the quest to make Sato compatible with GTK+3. Complete WIP collection of patches can be found in jku/matchbox-wip branch at git://git.yoctoproject.org/poky-contrib
The following changes since commit 452bca253492a97a587f440289b9ab27d217353e:
INSTALL: remove, this is a dangling symlink (2013-02-04 10:13:06 +0000)
are available in the git repository at:
git://github.com/jku/matchbox-terminal gtk3
https://github.com/jku/matchbox-terminal/tree/gtk3
Jussi Kukkonen (1):
Upgrade to current Vte and Gtk+ versions
Makefile.am | 4 ++-- configure.ac | 2 +- main.c | 49 +++++++++++++++++++++++++++++++++++++++---------- 3 files changed, 42 insertions(+), 13 deletions(-)
Signature · 1 line
2.8.1
PATCH 1/1 Upgrade to current Vte and Gtk+ versions
--- Makefile.am | 4 ++-- configure.ac | 2 +- main.c | 49 +++++++++++++++++++++++++++++++++++++++---------- 3 files changed, 42 insertions(+), 13 deletions(-)
Makefile.am +2 -2
@@ -1,6 +1,6 @@ -AM_CPPFLAGS = $(VTE_CFLAGS) +AM_CPPFLAGS = $(MBTERM_CFLAGS) AM_CFLAGS = -Wall -LDADD = $(VTE_LIBS) +LDADD = $(MBTERM_LIBS) bin_PROGRAMS = matchbox-terminal matchbox_terminal_SOURCES = main.c
configure.ac +1 -1
@@ -7,7 +7,7 @@ AM_CONFIG_HEADER(config.h) AC_PROG_CPP AC_PROG_CC -PKG_CHECK_MODULES(VTE, vte) +PKG_CHECK_MODULES(MBTERM, glib-2.0 gtk+-3.0 vte-2.91) AC_OUTPUT([ Makefile
main.c +39 -10
85 lines not on this page · raw message
Signature · 1 line
2.8.1
Re: [matchbox-terminal][PATCH 1/1] Upgrade to current Vte and Gtk+ versions
Merged and pushed, thanks Jussi. I've started tagging the last GTK+ 2 commit with 'GTK+2'.
Ross
Quoted 134 lines · Jussi Kukkonen
Signed-off-by Jussi Kukkonen <[email protected]>--- Makefile.am | 4 ++-- configure.ac | 2 +- main.c | 49 +++++++++++++++++++++++++++++++++++++++---------- 3 files changed, 42 insertions(+), 13 deletions(-)Makefile.am +2
-2@@ -1,6 +1,6 @@ -AM_CPPFLAGS = $(VTE_CFLAGS) +AM_CPPFLAGS = $(MBTERM_CFLAGS) AM_CFLAGS = -Wall -LDADD = $(VTE_LIBS) +LDADD = $(MBTERM_LIBS) bin_PROGRAMS = matchbox-terminal matchbox_terminal_SOURCES = main.cconfigure.ac +1
-1@@ -7,7 +7,7 @@ AM_CONFIG_HEADER(config.h) AC_PROG_CPP AC_PROG_CC -PKG_CHECK_MODULES(VTE, vte) +PKG_CHECK_MODULES(MBTERM, glib-2.0 gtk+-3.0 vte-2.91) AC_OUTPUT([ Makefilemain.c +39
-11@@ -18,13 +18,15 @@#include <gtk/gtk.h> #include <vte/vte.h> +#include <glib.h> static void on_window_title_changed (VteTerminal *terminal,GtkWindow *window) {char *title; - title =g_strdup_printf ("%s - Terminal" , terminal->window_title); + title =g_strdup_printf ("%s - Terminal" , +vte_terminal_get_window_title (terminal));gtk_window_set_title (window, title);g_free (title); }@@ -38,16 +40,22 @@ on_eof (VteTerminal *terminal, gpointer user_data)int main (int argc,char **argv) { -GtkWidget *window, *box, *terminal, *scrollbar; - +GtkWidget *window, *terminal, *scrolled_win; +GError *err =NULL ; +char *cmd; +char **cmd_argv =NULL ; +int cmd_argc; +gtk_init (&argc, &argv); window =gtk_window_new (GTK_WINDOW_TOPLEVEL );g_signal_connect (window,"destroy" , gtk_main_quit,NULL );gtk_window_set_title (GTK_WINDOW (window),"Terminal" ); - box =gtk_hbox_new (FALSE,0 ); -gtk_container_add (GTK_CONTAINER (window), box); + scrolled_win =gtk_scrolled_window_new (NULL ,NULL ); +gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win), +GTK_POLICY_NEVER ,GTK_POLICY_ALWAYS ); +gtk_container_add (GTK_CONTAINER (window), scrolled_win); terminal = g_object_connect (vte_terminal_new (),@@ -57,17 +65,38 @@ main (int argc, char **argv)/* Child is trying to control the terminal */ "signal::window-title-changed" , on_window_title_changed, window, NULL); -gtk_box_pack_start (GTK_BOX (box), terminal, TRUE, TRUE,0 ); +gtk_container_add (GTK_CONTAINER (scrolled_win), terminal); + + cmd =vte_get_user_shell (); +if (!cmd) + cmd =g_strdup (g_getenv ("SHELL" )); +if (!cmd) + cmd =g_strdup ("/bin/sh" ); + +if (!g_shell_parse_argv (cmd, &cmd_argc, &cmd_argv, &err)) { +g_printerr ("Failed to parse shell command line '%s'\n" , cmd); + }else if (!vte_terminal_spawn_sync (VTE_TERMINAL (terminal), +VTE_PTY_DEFAULT , +NULL , + cmd_argv, +NULL , +G_SPAWN_SEARCH_PATH , +NULL , +NULL , +NULL , +NULL , + &err)) { +g_printerr ("Failed to spawn shell: %s\n" , err->message); +g_error_free (err); + } - scrollbar =gtk_vscrollbar_new (VTE_TERMINAL (terminal)->adjustment); -gtk_box_pack_start (GTK_BOX (box), scrollbar, FALSE, FALSE,0 ); -vte_terminal_fork_command (VTE_TERMINAL (terminal), -NULL ,NULL ,NULL ,NULL , TRUE, TRUE, TRUE); +gtk_window_set_default_size (GTK_WINDOW (window),640 ,480 );gtk_widget_show_all (window);gtk_main (); +g_free (cmd);return 0 ; } --2.8.1
--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto