ui: drop gtk2 support.

-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJbwKolAAoJEEy22O7T6HE4JSgQAJ02MLV03QD9aJ+HDH5w5Wli
 XkbXaiCv4jM84eMuW8joKBN+aJCNHgmHyePPtvSF722mXXhP9mNfZYltJ2MGfJL8
 rwdd0J/BDaak5UxqUPEU+fMs9zviGeAvm8PCBGYDI1AZgCvYItCMb6dK5THHeIgL
 uH1Ld/zqnBHWk7D52lr01MYKZ5/+RpvauqrjR5E5fNnK4VT0KsUzI1CbLIrTqhGg
 5hH6/phrZDx0ON3vX16LDavvz/1+ppcb5m8E++1FLeCXudKKER5+CqVACYOXVatc
 wva32EvoZGIc7ywPHTe62izGaw7oSvNSPTsf4+GzoYl0lA3VfLws+UtB3G7EnblJ
 XsCjQxPut4rkTP14Pp9Dfhjhi4CmBz5MdvzZ74HNaFj/tsFz/o4Z/c0WmIVUb6TW
 tboluxPHQL5iWJt3YGqvLZkq2hRnFtsiA1BlcRR7KnzkJdgurKYPVpsA3jK6Zxxo
 LHlCcz+i6Sox1LR8vcxvrWMqmwJXRp0/zZFyCo2YejwuMzkfy10YzrLFEJjrfhFO
 Ldk8qomfELRUKbD7gn2OYL2iT17Ast8GM0ZgULK8FFaZzQlJuYGa/L55YiBKcQ8C
 iRjJaQhSnCr213My9OCdXDeJuxe4wrJltWIHXouY/Hfetd/CmbT5q0w7F/wJsKFT
 yb0Cy4zxfcXRQ9L6nPm/
 =e5P+
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/ui2-20181012-pull-request' into staging

ui: drop gtk2 support.

# gpg: Signature made Fri 12 Oct 2018 15:05:25 BST
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/ui2-20181012-pull-request:
  ui: increase min required GTK3 version to 3.14.0
  ui: remove support for GTK2 in favour of GTK3

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2018-10-12 17:24:23 +01:00
commit 046936ed71
5 changed files with 26 additions and 253 deletions

51
configure vendored
View File

@ -454,7 +454,6 @@ glusterfs_discard="no"
glusterfs_fallocate="no"
glusterfs_zerofill="no"
gtk=""
gtkabi=""
gtk_gl="no"
tls_priority="NORMAL"
gnutls=""
@ -1370,8 +1369,6 @@ for opt do
;;
--disable-pvrdma) pvrdma="no"
;;
--with-gtkabi=*) gtkabi="$optarg"
;;
--disable-vte) vte="no"
;;
--enable-vte) vte="yes"
@ -1659,7 +1656,6 @@ disabled with --disable-FEATURE, default is enabled if available:
sdl SDL UI
--with-sdlabi select preferred SDL ABI 1.2 or 2.0
gtk gtk UI
--with-gtkabi select preferred GTK ABI 2.0 or 3.0
vte vte support for the gtk UI
curses curses UI
vnc VNC UI support
@ -2646,24 +2642,9 @@ fi
# GTK probe
if test "$gtk" != "no"; then
if test "$gtkabi" = ""; then
# The GTK ABI was not specified explicitly, so try whether 3.0 is available.
# Use 2.0 as a fallback if that is available.
if $pkg_config --exists "gtk+-3.0 >= 3.0.0"; then
gtkabi=3.0
elif $pkg_config --exists "gtk+-2.0 >= 2.18.0"; then
gtkabi=2.0
else
gtkabi=3.0
fi
fi
gtkpackage="gtk+-$gtkabi"
gtkx11package="gtk+-x11-$gtkabi"
if test "$gtkabi" = "3.0" ; then
gtkversion="3.0.0"
else
gtkversion="2.18.0"
fi
gtkpackage="gtk+-3.0"
gtkx11package="gtk+-x11-3.0"
gtkversion="3.14.0"
if $pkg_config --exists "$gtkpackage >= $gtkversion"; then
gtk_cflags=$($pkg_config --cflags $gtkpackage)
gtk_libs=$($pkg_config --libs $gtkpackage)
@ -2907,16 +2888,11 @@ fi
# VTE probe
if test "$vte" != "no"; then
if test "$gtkabi" = "3.0"; then
vteminversion="0.32.0"
if $pkg_config --exists "vte-2.91"; then
vtepackage="vte-2.91"
else
vtepackage="vte-2.90"
fi
vteminversion="0.32.0"
if $pkg_config --exists "vte-2.91"; then
vtepackage="vte-2.91"
else
vtepackage="vte"
vteminversion="0.24.0"
vtepackage="vte-2.90"
fi
if $pkg_config --exists "$vtepackage >= $vteminversion"; then
vte_cflags=$($pkg_config --cflags $vtepackage)
@ -2924,11 +2900,7 @@ if test "$vte" != "no"; then
vteversion=$($pkg_config --modversion $vtepackage)
vte="yes"
elif test "$vte" = "yes"; then
if test "$gtkabi" = "3.0"; then
feature_not_found "vte" "Install libvte-2.90/2.91 devel"
else
feature_not_found "vte" "Install libvte devel"
fi
feature_not_found "vte" "Install libvte-2.90/2.91 devel"
else
vte="no"
fi
@ -6109,12 +6081,6 @@ if test "$sdl_too_old" = "yes"; then
echo "-> Your SDL version is too old - please upgrade to have SDL support"
fi
if test "$gtkabi" = "2.0"; then
echo
echo "WARNING: Use of GTK 2.0 is deprecated and will be removed in"
echo "WARNING: future releases. Please switch to using GTK 3.0"
fi
if test "$sdlabi" = "1.2"; then
echo
echo "WARNING: Use of SDL 1.2 is deprecated and will be removed in"
@ -6431,7 +6397,6 @@ if test "$bluez" = "yes" ; then
fi
if test "$gtk" = "yes" ; then
echo "CONFIG_GTK=m" >> $config_host_mak
echo "CONFIG_GTKABI=$gtkabi" >> $config_host_mak
echo "GTK_CFLAGS=$gtk_cflags" >> $config_host_mak
echo "GTK_LIBS=$gtk_libs" >> $config_host_mak
if test "$gtk_gl" = "yes" ; then

View File

@ -27,15 +27,6 @@
#include "ui/egl-context.h"
#endif
/* Compatibility define to let us build on both Gtk2 and Gtk3 */
#if GTK_CHECK_VERSION(3, 0, 0)
static inline void gdk_drawable_get_size(GdkWindow *w, gint *ww, gint *wh)
{
*ww = gdk_window_get_width(w);
*wh = gdk_window_get_height(w);
}
#endif
typedef struct GtkDisplayState GtkDisplayState;
typedef struct VirtualGfxConsole {

View File

@ -19,13 +19,6 @@ deprecated.
@section Build options
@subsection GTK 2.x
Previously QEMU has supported building against both GTK 2.x
and 3.x series APIs. Support for the GTK 2.x builds will be
discontinued, so maintainers should switch to using GTK 3.x,
which is the default.
@subsection SDL 1.2
Previously QEMU has supported building against both SDL 1.2

View File

@ -48,11 +48,7 @@ void gd_egl_init(VirtualConsole *vc)
return;
}
#if GTK_CHECK_VERSION(3, 0, 0)
Window x11_window = gdk_x11_window_get_xid(gdk_window);
#else
Window x11_window = gdk_x11_drawable_get_xid(gdk_window);
#endif
if (!x11_window) {
return;
}
@ -82,7 +78,8 @@ void gd_egl_draw(VirtualConsole *vc)
vc->gfx.esurface, vc->gfx.ectx);
window = gtk_widget_get_window(vc->gfx.drawing_area);
gdk_drawable_get_size(window, &ww, &wh);
ww = gdk_window_get_width(window);
wh = gdk_window_get_height(window);
surface_gl_setup_viewport(vc->gfx.gls, vc->gfx.ds, ww, wh);
surface_gl_render_texture(vc->gfx.gls, vc->gfx.ds);
@ -265,7 +262,8 @@ void gd_egl_scanout_flush(DisplayChangeListener *dcl,
vc->gfx.esurface, vc->gfx.ectx);
window = gtk_widget_get_window(vc->gfx.drawing_area);
gdk_drawable_get_size(window, &ww, &wh);
ww = gdk_window_get_width(window);
wh = gdk_window_get_height(window);
egl_fb_setup_default(&vc->gfx.win_fb, ww, wh);
if (vc->gfx.cursor_fb.texture) {
egl_texture_blit(vc->gfx.gls, &vc->gfx.win_fb, &vc->gfx.guest_fb,

202
ui/gtk.c
View File

@ -111,49 +111,6 @@
# define VTE_CHECK_VERSION(a, b, c) 0
#endif
#if defined(CONFIG_VTE) && !GTK_CHECK_VERSION(3, 0, 0)
/*
* The gtk2 vte terminal widget seriously messes up the window resize
* for some reason. You basically can't make the qemu window smaller
* any more because the toplevel window geoemtry hints are overridden.
*
* Workaround that by hiding all vte widgets, except the one in the
* current tab.
*
* Luckily everything works smooth in gtk3.
*/
# define VTE_RESIZE_HACK 1
#endif
#if !GTK_CHECK_VERSION(2, 20, 0)
#define gtk_widget_get_realized(widget) GTK_WIDGET_REALIZED(widget)
#endif
#ifndef GDK_IS_X11_DISPLAY
#define GDK_IS_X11_DISPLAY(dpy) (dpy == dpy)
#endif
#ifndef GDK_IS_WAYLAND_DISPLAY
#define GDK_IS_WAYLAND_DISPLAY(dpy) (dpy == dpy)
#endif
#ifndef GDK_IS_WIN32_DISPLAY
#define GDK_IS_WIN32_DISPLAY(dpy) (dpy == dpy)
#endif
#if !GTK_CHECK_VERSION(2, 22, 0)
#define GDK_KEY_0 GDK_0
#define GDK_KEY_1 GDK_1
#define GDK_KEY_2 GDK_2
#define GDK_KEY_f GDK_f
#define GDK_KEY_g GDK_g
#define GDK_KEY_m GDK_m
#define GDK_KEY_q GDK_q
#define GDK_KEY_plus GDK_plus
#define GDK_KEY_equal GDK_equal
#define GDK_KEY_minus GDK_minus
#define GDK_KEY_Pause GDK_Pause
#define GDK_KEY_Delete GDK_Delete
#endif
/* Some older mingw versions lack this constant or have
* it conditionally defined */
#ifdef _WIN32
@ -455,7 +412,8 @@ static void gd_update_full_redraw(VirtualConsole *vc)
{
GtkWidget *area = vc->gfx.drawing_area;
int ww, wh;
gdk_drawable_get_size(gtk_widget_get_window(area), &ww, &wh);
ww = gdk_window_get_width(gtk_widget_get_window(area));
wh = gdk_window_get_height(gtk_widget_get_window(area));
#if defined(CONFIG_GTK_GL)
if (vc->gfx.gls && gtk_use_gl_area) {
gtk_gl_area_queue_render(GTK_GL_AREA(vc->gfx.drawing_area));
@ -530,7 +488,8 @@ static void gd_update(DisplayChangeListener *dcl,
if (!win) {
return;
}
gdk_drawable_get_size(win, &ww, &wh);
ww = gdk_window_get_width(win);
wh = gdk_window_get_height(win);
mx = my = 0;
if (ww > fbw) {
@ -549,7 +508,6 @@ static void gd_refresh(DisplayChangeListener *dcl)
graphic_hw_update(dcl->con);
}
#if GTK_CHECK_VERSION(3, 0, 0)
static GdkDevice *gd_get_pointer(GdkDisplay *dpy)
{
#if GTK_CHECK_VERSION(3, 20, 0)
@ -580,24 +538,6 @@ static void gd_mouse_set(DisplayChangeListener *dcl,
vc->s->last_x = x;
vc->s->last_y = y;
}
#else
static void gd_mouse_set(DisplayChangeListener *dcl,
int x, int y, int visible)
{
VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);
gint x_root, y_root;
if (qemu_input_is_absolute()) {
return;
}
gdk_window_get_root_coords(gtk_widget_get_window(vc->gfx.drawing_area),
x, y, &x_root, &y_root);
gdk_display_warp_pointer(gtk_widget_get_display(vc->gfx.drawing_area),
gtk_widget_get_screen(vc->gfx.drawing_area),
x_root, y_root);
}
#endif
static void gd_cursor_define(DisplayChangeListener *dcl,
QEMUCursor *c)
@ -619,11 +559,7 @@ static void gd_cursor_define(DisplayChangeListener *dcl,
pixbuf, c->hot_x, c->hot_y);
gdk_window_set_cursor(gtk_widget_get_window(vc->gfx.drawing_area), cursor);
g_object_unref(pixbuf);
#if !GTK_CHECK_VERSION(3, 0, 0)
gdk_cursor_unref(cursor);
#else
g_object_unref(cursor);
#endif
}
static void gd_switch(DisplayChangeListener *dcl,
@ -863,7 +799,8 @@ static gboolean gd_draw_event(GtkWidget *widget, cairo_t *cr, void *opaque)
fbw = surface_width(vc->gfx.ds);
fbh = surface_height(vc->gfx.ds);
gdk_drawable_get_size(gtk_widget_get_window(widget), &ww, &wh);
ww = gdk_window_get_width(gtk_widget_get_window(widget));
wh = gdk_window_get_height(gtk_widget_get_window(widget));
if (s->full_screen) {
vc->gfx.scale_x = (double)ww / fbw;
@ -907,29 +844,6 @@ static gboolean gd_draw_event(GtkWidget *widget, cairo_t *cr, void *opaque)
return TRUE;
}
#if !GTK_CHECK_VERSION(3, 0, 0)
static gboolean gd_expose_event(GtkWidget *widget, GdkEventExpose *expose,
void *opaque)
{
cairo_t *cr;
gboolean ret;
cr = gdk_cairo_create(gtk_widget_get_window(widget));
cairo_rectangle(cr,
expose->area.x,
expose->area.y,
expose->area.width,
expose->area.height);
cairo_clip(cr);
ret = gd_draw_event(widget, cr, opaque);
cairo_destroy(cr);
return ret;
}
#endif
static gboolean gd_motion_event(GtkWidget *widget, GdkEventMotion *motion,
void *opaque)
{
@ -947,8 +861,8 @@ static gboolean gd_motion_event(GtkWidget *widget, GdkEventMotion *motion,
fbw = surface_width(vc->gfx.ds) * vc->gfx.scale_x;
fbh = surface_height(vc->gfx.ds) * vc->gfx.scale_y;
gdk_drawable_get_size(gtk_widget_get_window(vc->gfx.drawing_area),
&ww, &wh);
ww = gdk_window_get_width(gtk_widget_get_window(vc->gfx.drawing_area));
wh = gdk_window_get_height(gtk_widget_get_window(vc->gfx.drawing_area));
mx = my = 0;
if (ww > fbw) {
@ -1026,13 +940,8 @@ static gboolean gd_motion_event(GtkWidget *widget, GdkEventMotion *motion,
}
if (x != (int)motion->x_root || y != (int)motion->y_root) {
#if GTK_CHECK_VERSION(3, 0, 0)
GdkDevice *dev = gdk_event_get_device((GdkEvent *)motion);
gdk_device_warp(dev, screen, x, y);
#else
GdkDisplay *display = gtk_widget_get_display(widget);
gdk_display_warp_pointer(display, screen, x, y);
#endif
s->last_set = FALSE;
return FALSE;
}
@ -1089,7 +998,6 @@ static gboolean gd_scroll_event(GtkWidget *widget, GdkEventScroll *scroll,
btn = INPUT_BUTTON_WHEEL_UP;
} else if (scroll->direction == GDK_SCROLL_DOWN) {
btn = INPUT_BUTTON_WHEEL_DOWN;
#if GTK_CHECK_VERSION(3, 4, 0)
} else if (scroll->direction == GDK_SCROLL_SMOOTH) {
gdouble delta_x, delta_y;
if (!gdk_event_get_scroll_deltas((GdkEvent *)scroll,
@ -1101,7 +1009,6 @@ static gboolean gd_scroll_event(GtkWidget *widget, GdkEventScroll *scroll,
} else {
btn = INPUT_BUTTON_WHEEL_UP;
}
#endif
} else {
return TRUE;
}
@ -1309,10 +1216,6 @@ static void gd_accel_switch_vc(void *opaque)
VirtualConsole *vc = opaque;
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(vc->menu_item), TRUE);
#if !GTK_CHECK_VERSION(3, 0, 0)
/* GTK2 sends the accel key to the target console - ignore this until */
vc->s->ignore_keys = true;
#endif
}
static void gd_menu_show_tabs(GtkMenuItem *item, void *opaque)
@ -1539,7 +1442,7 @@ static void gd_grab_update(VirtualConsole *vc, bool kbd, bool ptr)
gdk_seat_ungrab(seat);
}
}
#elif GTK_CHECK_VERSION(3, 0, 0)
#else
static void gd_grab_devices(VirtualConsole *vc, bool grab,
GdkInputSource source, GdkEventMask mask,
GdkCursor *cursor)
@ -1578,14 +1481,10 @@ static void gd_grab_keyboard(VirtualConsole *vc, const char *reason)
#if GTK_CHECK_VERSION(3, 20, 0)
gd_grab_update(vc, true, vc->s->ptr_owner == vc);
#elif GTK_CHECK_VERSION(3, 0, 0)
#else
gd_grab_devices(vc, true, GDK_SOURCE_KEYBOARD,
GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK,
NULL);
#else
gdk_keyboard_grab(gtk_widget_get_window(vc->gfx.drawing_area),
FALSE,
GDK_CURRENT_TIME);
#endif
vc->s->kbd_owner = vc;
gd_update_caption(vc->s);
@ -1603,10 +1502,8 @@ static void gd_ungrab_keyboard(GtkDisplayState *s)
#if GTK_CHECK_VERSION(3, 20, 0)
gd_grab_update(vc, false, vc->s->ptr_owner == vc);
#elif GTK_CHECK_VERSION(3, 0, 0)
gd_grab_devices(vc, false, GDK_SOURCE_KEYBOARD, 0, NULL);
#else
gdk_keyboard_ungrab(GDK_CURRENT_TIME);
gd_grab_devices(vc, false, GDK_SOURCE_KEYBOARD, 0, NULL);
#endif
gd_update_caption(s);
trace_gd_ungrab(vc->label, "kbd");
@ -1628,7 +1525,7 @@ static void gd_grab_pointer(VirtualConsole *vc, const char *reason)
gd_grab_update(vc, vc->s->kbd_owner == vc, true);
gdk_device_get_position(gd_get_pointer(display),
NULL, &vc->s->grab_x_root, &vc->s->grab_y_root);
#elif GTK_CHECK_VERSION(3, 0, 0)
#else
gd_grab_devices(vc, true, GDK_SOURCE_MOUSE,
GDK_POINTER_MOTION_MASK |
GDK_BUTTON_PRESS_MASK |
@ -1638,19 +1535,6 @@ static void gd_grab_pointer(VirtualConsole *vc, const char *reason)
vc->s->null_cursor);
gdk_device_get_position(gd_get_pointer(display),
NULL, &vc->s->grab_x_root, &vc->s->grab_y_root);
#else
gdk_pointer_grab(gtk_widget_get_window(vc->gfx.drawing_area),
FALSE, /* All events to come to our window directly */
GDK_POINTER_MOTION_MASK |
GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
GDK_BUTTON_MOTION_MASK |
GDK_SCROLL_MASK,
NULL, /* Allow cursor to move over entire desktop */
vc->s->null_cursor,
GDK_CURRENT_TIME);
gdk_display_get_pointer(display, NULL,
&vc->s->grab_x_root, &vc->s->grab_y_root, NULL);
#endif
vc->s->ptr_owner = vc;
gd_update_caption(vc->s);
@ -1673,16 +1557,11 @@ static void gd_ungrab_pointer(GtkDisplayState *s)
gdk_device_warp(gd_get_pointer(display),
gtk_widget_get_screen(vc->gfx.drawing_area),
vc->s->grab_x_root, vc->s->grab_y_root);
#elif GTK_CHECK_VERSION(3, 0, 0)
#else
gd_grab_devices(vc, false, GDK_SOURCE_MOUSE, 0, NULL);
gdk_device_warp(gd_get_pointer(display),
gtk_widget_get_screen(vc->gfx.drawing_area),
vc->s->grab_x_root, vc->s->grab_y_root);
#else
gdk_pointer_ungrab(GDK_CURRENT_TIME);
gdk_display_warp_pointer(display,
gtk_widget_get_screen(vc->gfx.drawing_area),
vc->s->grab_x_root, vc->s->grab_y_root);
#endif
gd_update_caption(s);
trace_gd_ungrab(vc->label, "ptr");
@ -1715,21 +1594,10 @@ static void gd_change_page(GtkNotebook *nb, gpointer arg1, guint arg2,
return;
}
#ifdef VTE_RESIZE_HACK
vc = gd_vc_find_current(s);
if (vc && vc->type == GD_VC_VTE) {
gtk_widget_hide(vc->vte.terminal);
}
#endif
vc = gd_vc_find_by_page(s, arg2);
if (!vc) {
return;
}
#ifdef VTE_RESIZE_HACK
if (vc->type == GD_VC_VTE) {
gtk_widget_show(vc->vte.terminal);
}
#endif
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(vc->menu_item),
TRUE);
on_vga = (vc->type == GD_VC_GFX &&
@ -1802,11 +1670,9 @@ static GSList *gd_vc_menu_init(GtkDisplayState *s, VirtualConsole *vc,
gtk_accel_group_connect(s->accel_group, GDK_KEY_1 + idx,
HOTKEY_MODIFIERS, 0,
g_cclosure_new_swap(G_CALLBACK(gd_accel_switch_vc), vc, NULL));
#if GTK_CHECK_VERSION(3, 8, 0)
gtk_accel_label_set_accel(
GTK_ACCEL_LABEL(gtk_bin_get_child(GTK_BIN(vc->menu_item))),
GDK_KEY_1 + idx, HOTKEY_MODIFIERS);
#endif
g_signal_connect(vc->menu_item, "activate",
G_CALLBACK(gd_menu_switch_vc), s);
@ -1965,20 +1831,15 @@ static GSList *gd_vc_vte_init(GtkDisplayState *s, VirtualConsole *vc,
vte_terminal_set_size(VTE_TERMINAL(vc->vte.terminal),
VC_TERM_X_MIN, VC_TERM_Y_MIN);
#if VTE_CHECK_VERSION(0, 28, 0) && GTK_CHECK_VERSION(3, 0, 0)
#if VTE_CHECK_VERSION(0, 28, 0)
vadjustment = gtk_scrollable_get_vadjustment
(GTK_SCROLLABLE(vc->vte.terminal));
#else
vadjustment = vte_terminal_get_adjustment(VTE_TERMINAL(vc->vte.terminal));
#endif
#if GTK_CHECK_VERSION(3, 0, 0)
box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
scrollbar = gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, vadjustment);
#else
box = gtk_hbox_new(false, 2);
scrollbar = gtk_vscrollbar_new(vadjustment);
#endif
gtk_box_pack_end(GTK_BOX(box), scrollbar, FALSE, FALSE, 0);
gtk_box_pack_end(GTK_BOX(box), vc->vte.terminal, TRUE, TRUE, 0);
@ -2017,7 +1878,6 @@ static void gd_vcs_init(GtkDisplayState *s, GSList *group,
static void gd_connect_vc_gfx_signals(VirtualConsole *vc)
{
#if GTK_CHECK_VERSION(3, 0, 0)
g_signal_connect(vc->gfx.drawing_area, "draw",
G_CALLBACK(gd_draw_event), vc);
#if defined(CONFIG_GTK_GL)
@ -2028,10 +1888,6 @@ static void gd_connect_vc_gfx_signals(VirtualConsole *vc)
g_signal_connect(vc->gfx.drawing_area, "resize",
G_CALLBACK(gd_resize_event), vc);
}
#endif
#else
g_signal_connect(vc->gfx.drawing_area, "expose-event",
G_CALLBACK(gd_expose_event), vc);
#endif
if (qemu_console_is_graphic(vc->gfx.dcl.con)) {
g_signal_connect(vc->gfx.drawing_area, "event",
@ -2236,11 +2092,9 @@ static GtkWidget *gd_create_menu_view(GtkDisplayState *s)
gtk_accel_group_connect(s->accel_group, GDK_KEY_f, HOTKEY_MODIFIERS, 0,
g_cclosure_new_swap(G_CALLBACK(gd_accel_full_screen), s, NULL));
#if GTK_CHECK_VERSION(3, 8, 0)
gtk_accel_label_set_accel(
GTK_ACCEL_LABEL(gtk_bin_get_child(GTK_BIN(s->full_screen_item))),
GDK_KEY_f, HOTKEY_MODIFIERS);
#endif
gtk_menu_shell_append(GTK_MENU_SHELL(view_menu), s->full_screen_item);
separator = gtk_separator_menu_item_new();
@ -2319,11 +2173,9 @@ static GtkWidget *gd_create_menu_view(GtkDisplayState *s)
TRUE);
gtk_accel_group_connect(s->accel_group, GDK_KEY_m, HOTKEY_MODIFIERS, 0,
g_cclosure_new_swap(G_CALLBACK(gd_accel_show_menubar), s, NULL));
#if GTK_CHECK_VERSION(3, 8, 0)
gtk_accel_label_set_accel(
GTK_ACCEL_LABEL(gtk_bin_get_child(GTK_BIN(s->show_menubar_item))),
GDK_KEY_m, HOTKEY_MODIFIERS);
#endif
gtk_menu_shell_append(GTK_MENU_SHELL(view_menu), s->show_menubar_item);
return view_menu;
@ -2372,17 +2224,8 @@ static void gtk_display_init(DisplayState *ds, DisplayOptions *opts)
assert(opts->type == DISPLAY_TYPE_GTK);
s->opts = opts;
#if !GTK_CHECK_VERSION(3, 0, 0)
g_printerr("Running QEMU with GTK 2.x is deprecated, and will be removed\n"
"in a future release. Please switch to GTK 3.x instead\n");
#endif
s->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
#if GTK_CHECK_VERSION(3, 2, 0)
s->vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
#else
s->vbox = gtk_vbox_new(FALSE, 0);
#endif
s->notebook = gtk_notebook_new();
s->menu_bar = gtk_menu_bar_new();
@ -2433,23 +2276,6 @@ static void gtk_display_init(DisplayState *ds, DisplayOptions *opts)
gtk_widget_show_all(s->window);
#ifdef VTE_RESIZE_HACK
{
VirtualConsole *cur = gd_vc_find_current(s);
if (cur) {
int i;
for (i = 0; i < s->nb_vcs; i++) {
VirtualConsole *vc = &s->vc[i];
if (vc && vc->type == GD_VC_VTE && vc != cur) {
gtk_widget_hide(vc->vte.terminal);
}
}
gd_update_windowsize(cur);
}
}
#endif
vc = gd_vc_find_current(s);
gtk_widget_set_sensitive(s->view_menu, vc != NULL);
#ifdef CONFIG_VTE