summaryrefslogtreecommitdiff
path: root/src/fringe.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2019-08-13 17:49:51 +0300
committerEli Zaretskii <eliz@gnu.org>2019-08-13 17:49:51 +0300
commitc90975f92fd71be7282293e0ed1098c0fa5d62a0 (patch)
treeaa873f81d0436527a3b80e6f26bd41c5cd889934 /src/fringe.c
parent2b329ed420eb15f6738edd402697ac2876b2aa61 (diff)
downloademacs-c90975f92fd71be7282293e0ed1098c0fa5d62a0.tar.gz
Fix initialization of user-defined fringe bitmaps in daemon mode
* src/fringe.c (gui_init_fringe): Rename from w32_init_fringe or x_cr_init_fringe, and make unconditionally compiled; all callers changed. Do nothing if the frame's redisplay_interface doesn't implement the define_fringe_bitmap method. Set up any user-defined fringe bitmaps in addition to the standard bitmaps. Suggested by Liam Quinlan <liamkquinlan@gmail.com> in https://lists.gnu.org/archive/html/emacs-devel/2019-08/msg00259.html. (w32_reset_fringes) [HAVE_NTGUI]: Do nothing if the frame's redisplay_interface doesn't implement the destroy_fringe_bitmap method. * src/w32fns.c (Fx_create_frame): Call gui_init_fringe when the first GUI frame is created for this session. * src/dispextern.h (w32_init_fringe): Rename to gui_init_fringe and make unconditional. (x_cr_init_fringe): Remove prototype.
Diffstat (limited to 'src/fringe.c')
-rw-r--r--src/fringe.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/fringe.c b/src/fringe.c
index d0d599223d5..4c5a4d748fb 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -1765,27 +1765,32 @@ init_fringe (void)
fringe_faces = xzalloc (max_fringe_bitmaps * sizeof *fringe_faces);
}
-#if defined (HAVE_NTGUI) || defined (USE_CAIRO)
-
void
-#ifdef HAVE_NTGUI
-w32_init_fringe (struct redisplay_interface *rif)
-#else
-x_cr_init_fringe (struct redisplay_interface *rif)
-#endif
+gui_init_fringe (struct redisplay_interface *rif)
{
int bt;
- if (!rif)
+ if (!rif || !rif->define_fringe_bitmap)
return;
+ /* Set up the standard fringe bitmaps. */
for (bt = NO_FRINGE_BITMAP + 1; bt < MAX_STANDARD_FRINGE_BITMAPS; bt++)
{
struct fringe_bitmap *fb = &standard_bitmaps[bt];
rif->define_fringe_bitmap (bt, fb->bits, fb->height, fb->width);
}
+
+ /* Set up user-defined fringe bitmaps that might have been defined
+ before the frame of this kind was initialized. This can happen
+ if Emacs is started as a daemon and the init files define fringe
+ bitmaps. */
+ for ( ; bt < max_used_fringe_bitmap; bt++)
+ {
+ struct fringe_bitmap *fb = fringe_bitmaps[bt];
+ if (fb)
+ rif->define_fringe_bitmap (bt, fb->bits, fb->height, fb->width);
+ }
}
-#endif
#ifdef HAVE_NTGUI
void
@@ -1795,7 +1800,7 @@ w32_reset_fringes (void)
int bt;
struct redisplay_interface *rif = FRAME_RIF (SELECTED_FRAME ());
- if (!rif)
+ if (!rif || !rif->destroy_fringe_bitmap)
return;
for (bt = NO_FRINGE_BITMAP + 1; bt < max_used_fringe_bitmap; bt++)