emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master dc5930ba97: Fix the GTK 2 build


From: Po Lu
Subject: master dc5930ba97: Fix the GTK 2 build
Date: Sun, 6 Feb 2022 07:11:28 -0500 (EST)

branch: master
commit dc5930ba973c9d921e9124b7afa1a65bba568b45
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    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.
---
 src/gtkutil.c | 4 +++-
 src/xfns.c    | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gtkutil.c b/src/gtkutil.c
index 2b5f78aa32..6912ea1e96 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -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
 
diff --git a/src/xfns.c b/src/xfns.c
index 2b8a1abdfe..7878ee62f5 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -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;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]