aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-01-31 18:13:19 +0800
committerPo Lu2022-01-31 18:13:19 +0800
commit5edef4e98ce638069e37984537a9c5e5c7750667 (patch)
treea689b9b3ca7c8a12f845711d59758b6111e283ef /src
parent1472b046eaeb8b2177341fb1c2b42bf5d1207ec7 (diff)
downloademacs-5edef4e98ce638069e37984537a9c5e5c7750667.tar.gz
emacs-5edef4e98ce638069e37984537a9c5e5c7750667.zip
Improve portability of GDK visual code
* src/gtkutil.c (xg_create_frame_widgets): Look up the visual instead of assuming it based on the depth.
Diffstat (limited to 'src')
-rw-r--r--src/gtkutil.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c
index ea9c91d316b..b961cdedca9 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -1601,12 +1601,14 @@ xg_create_frame_widgets (struct frame *f)
1601 GdkScreen *screen = gtk_widget_get_screen (wtop); 1601 GdkScreen *screen = gtk_widget_get_screen (wtop);
1602 1602
1603#if !defined HAVE_PGTK 1603#if !defined HAVE_PGTK
1604 if (FRAME_DISPLAY_INFO (f)->n_planes == 32) 1604 GdkVisual *visual = gdk_x11_screen_lookup_visual (screen,
1605 { 1605 XVisualIDFromVisual (FRAME_X_VISUAL (f)));
1606 GdkVisual *visual = gdk_screen_get_rgba_visual (screen); 1606
1607 gtk_widget_set_visual (wtop, visual); 1607 if (!visual)
1608 gtk_widget_set_visual (wfixed, visual); 1608 emacs_abort ();
1609 } 1609
1610 gtk_widget_set_visual (wtop, visual);
1611 gtk_widget_set_visual (wfixed, visual);
1610#endif 1612#endif
1611 1613
1612#ifndef HAVE_PGTK 1614#ifndef HAVE_PGTK