Fix the GTK 2 build

* src/gtkutil.c (xg_filter_key): Remove call to GTK3-only
function without GTK 3.
* src/xfns.c (select_visual): Avoid 32-bit visuals on GTK 2.
This commit is contained in:
Po Lu 2022-02-06 20:10:46 +08:00
parent 3775156990
commit dc5930ba97
2 changed files with 4 additions and 2 deletions

View file

@ -4055,7 +4055,7 @@ xg_update_frame_menubar (struct frame *f)
gtk_widget_get_preferred_size (x->menubar_widget, NULL, &req);
req.height *= xg_get_scale (f);
#ifndef HAVE_PGTK
#if !defined HAVE_PGTK && defined HAVE_GTK3
if (FRAME_DISPLAY_INFO (f)->n_planes == 32)
{
GdkScreen *screen = gtk_widget_get_screen (x->menubar_widget);
@ -6387,8 +6387,10 @@ xg_filter_key (struct frame *frame, XEvent *xkey)
NULL, NULL, &consumed);
xg_add_virtual_mods (dpyinfo, &xg_event->key);
xg_event->key.state &= ~consumed;
#if GTK_CHECK_VERSION (3, 6, 0)
xg_event->key.is_modifier = gdk_x11_keymap_key_is_modifier (keymap,
xg_event->key.hardware_keycode);
#endif
}
#endif

View file

@ -6508,7 +6508,7 @@ select_visual (struct x_display_info *dpyinfo)
vinfo_template.screen = XScreenNumberOfScreen (screen);
#if !defined USE_X_TOOLKIT
#if !defined USE_X_TOOLKIT && !(defined USE_GTK && !defined HAVE_GTK3)
/* First attempt to use 32-bit visual if available */
vinfo_template.depth = 32;