Skip to content

Commit

Permalink
gtk: zap scrolled_window
Browse files Browse the repository at this point in the history
The vte widget implements the scrollable interface, placing it into
a scrolled window is pointless and creates a bunch of strange effects.
Zap it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
  • Loading branch information
kraxel committed May 26, 2014
1 parent 178ac11 commit fd07d07
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions ui/gtk.c
Expand Up @@ -110,7 +110,6 @@ typedef struct VirtualConsole
GtkWidget *menu_item;
GtkWidget *terminal;
#if defined(CONFIG_VTE)
GtkWidget *scrolled_window;
CharDriverState *chr;
#endif
} VirtualConsole;
Expand Down Expand Up @@ -1189,8 +1188,6 @@ static GSList *gd_vc_init(GtkDisplayState *s, VirtualConsole *vc, int index, GSL
const char *label;
char buffer[32];
char path[32];
GtkWidget *scrolled_window;
GtkAdjustment *vadjustment;

snprintf(buffer, sizeof(buffer), "vc%d", index);
snprintf(path, sizeof(path), "<QEMU>/View/VC%d", index);
Expand All @@ -1213,24 +1210,12 @@ static GSList *gd_vc_init(GtkDisplayState *s, VirtualConsole *vc, int index, GSL

vte_terminal_set_scrollback_lines(VTE_TERMINAL(vc->terminal), -1);

#if VTE_CHECK_VERSION(0, 28, 0) && GTK_CHECK_VERSION(3, 0, 0)
vadjustment = gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(vc->terminal));
#else
vadjustment = vte_terminal_get_adjustment(VTE_TERMINAL(vc->terminal));
#endif

scrolled_window = gtk_scrolled_window_new(NULL, vadjustment);
gtk_container_add(GTK_CONTAINER(scrolled_window), vc->terminal);

vte_terminal_set_size(VTE_TERMINAL(vc->terminal), 80, 25);

vc->chr->opaque = vc;
vc->scrolled_window = scrolled_window;

gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(vc->scrolled_window),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);

gtk_notebook_append_page(GTK_NOTEBOOK(s->notebook), scrolled_window, gtk_label_new(label));
gtk_notebook_append_page(GTK_NOTEBOOK(s->notebook), vc->terminal,
gtk_label_new(label));
g_signal_connect(vc->menu_item, "activate",
G_CALLBACK(gd_menu_switch_vc), s);

Expand Down

0 comments on commit fd07d07

Please sign in to comment.