aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2019-08-13 17:49:51 +0300
committerEli Zaretskii2019-08-13 17:49:51 +0300
commitc90975f92fd71be7282293e0ed1098c0fa5d62a0 (patch)
treeaa873f81d0436527a3b80e6f26bd41c5cd889934 /src
parent2b329ed420eb15f6738edd402697ac2876b2aa61 (diff)
downloademacs-c90975f92fd71be7282293e0ed1098c0fa5d62a0.tar.gz
emacs-c90975f92fd71be7282293e0ed1098c0fa5d62a0.zip
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')
-rw-r--r--src/dispextern.h6
-rw-r--r--src/fringe.c25
-rw-r--r--src/w32fns.c6
-rw-r--r--src/w32term.c2
-rw-r--r--src/xterm.c2
5 files changed, 25 insertions, 16 deletions
diff --git a/src/dispextern.h b/src/dispextern.h
index 4e947daa253..05f199ff353 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -3360,13 +3360,11 @@ void draw_row_fringe_bitmaps (struct window *, struct glyph_row *);
3360bool draw_window_fringes (struct window *, bool); 3360bool draw_window_fringes (struct window *, bool);
3361bool update_window_fringes (struct window *, bool); 3361bool update_window_fringes (struct window *, bool);
3362 3362
3363void gui_init_fringe (struct redisplay_interface *);
3364
3363#ifdef HAVE_NTGUI 3365#ifdef HAVE_NTGUI
3364void w32_init_fringe (struct redisplay_interface *);
3365void w32_reset_fringes (void); 3366void w32_reset_fringes (void);
3366#endif 3367#endif
3367#ifdef USE_CAIRO
3368void x_cr_init_fringe (struct redisplay_interface *);
3369#endif
3370 3368
3371extern unsigned row_hash (struct glyph_row *); 3369extern unsigned row_hash (struct glyph_row *);
3372 3370
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)
1765 fringe_faces = xzalloc (max_fringe_bitmaps * sizeof *fringe_faces); 1765 fringe_faces = xzalloc (max_fringe_bitmaps * sizeof *fringe_faces);
1766} 1766}
1767 1767
1768#if defined (HAVE_NTGUI) || defined (USE_CAIRO)
1769
1770void 1768void
1771#ifdef HAVE_NTGUI 1769gui_init_fringe (struct redisplay_interface *rif)
1772w32_init_fringe (struct redisplay_interface *rif)
1773#else
1774x_cr_init_fringe (struct redisplay_interface *rif)
1775#endif
1776{ 1770{
1777 int bt; 1771 int bt;
1778 1772
1779 if (!rif) 1773 if (!rif || !rif->define_fringe_bitmap)
1780 return; 1774 return;
1781 1775
1776 /* Set up the standard fringe bitmaps. */
1782 for (bt = NO_FRINGE_BITMAP + 1; bt < MAX_STANDARD_FRINGE_BITMAPS; bt++) 1777 for (bt = NO_FRINGE_BITMAP + 1; bt < MAX_STANDARD_FRINGE_BITMAPS; bt++)
1783 { 1778 {
1784 struct fringe_bitmap *fb = &standard_bitmaps[bt]; 1779 struct fringe_bitmap *fb = &standard_bitmaps[bt];
1785 rif->define_fringe_bitmap (bt, fb->bits, fb->height, fb->width); 1780 rif->define_fringe_bitmap (bt, fb->bits, fb->height, fb->width);
1786 } 1781 }
1782
1783 /* Set up user-defined fringe bitmaps that might have been defined
1784 before the frame of this kind was initialized. This can happen
1785 if Emacs is started as a daemon and the init files define fringe
1786 bitmaps. */
1787 for ( ; bt < max_used_fringe_bitmap; bt++)
1788 {
1789 struct fringe_bitmap *fb = fringe_bitmaps[bt];
1790 if (fb)
1791 rif->define_fringe_bitmap (bt, fb->bits, fb->height, fb->width);
1792 }
1787} 1793}
1788#endif
1789 1794
1790#ifdef HAVE_NTGUI 1795#ifdef HAVE_NTGUI
1791void 1796void
@@ -1795,7 +1800,7 @@ w32_reset_fringes (void)
1795 int bt; 1800 int bt;
1796 struct redisplay_interface *rif = FRAME_RIF (SELECTED_FRAME ()); 1801 struct redisplay_interface *rif = FRAME_RIF (SELECTED_FRAME ());
1797 1802
1798 if (!rif) 1803 if (!rif || !rif->destroy_fringe_bitmap)
1799 return; 1804 return;
1800 1805
1801 for (bt = NO_FRINGE_BITMAP + 1; bt < max_used_fringe_bitmap; bt++) 1806 for (bt = NO_FRINGE_BITMAP + 1; bt < max_used_fringe_bitmap; bt++)
diff --git a/src/w32fns.c b/src/w32fns.c
index fc80e018834..d6fd8f53490 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -5798,6 +5798,12 @@ DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
5798 f->output_data.w32 = xzalloc (sizeof (struct w32_output)); 5798 f->output_data.w32 = xzalloc (sizeof (struct w32_output));
5799 FRAME_FONTSET (f) = -1; 5799 FRAME_FONTSET (f) = -1;
5800 5800
5801 /* Need to finish setting up of user-defined fringe bitmaps that
5802 were defined before the first GUI frame was created (e.g., while
5803 in daemon mode). */
5804 if (!f->terminal->reference_count)
5805 gui_init_fringe (f->terminal->rif);
5806
5801 fset_icon_name (f, gui_display_get_arg (dpyinfo, 5807 fset_icon_name (f, gui_display_get_arg (dpyinfo,
5802 parameters, 5808 parameters,
5803 Qicon_name, 5809 Qicon_name,
diff --git a/src/w32term.c b/src/w32term.c
index ad96287a43a..e5874f2d365 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -7299,7 +7299,7 @@ w32_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
7299 horizontally reflected compared to how they appear on X, so we 7299 horizontally reflected compared to how they appear on X, so we
7300 need to bitswap and convert to unsigned shorts before creating 7300 need to bitswap and convert to unsigned shorts before creating
7301 the bitmaps. */ 7301 the bitmaps. */
7302 w32_init_fringe (terminal->rif); 7302 gui_init_fringe (terminal->rif);
7303 7303
7304 unblock_input (); 7304 unblock_input ();
7305 7305
diff --git a/src/xterm.c b/src/xterm.c
index bbe68ef6221..0d224063d76 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -13531,7 +13531,7 @@ x_initialize (void)
13531#endif 13531#endif
13532 13532
13533#ifdef USE_CAIRO 13533#ifdef USE_CAIRO
13534 x_cr_init_fringe (&x_redisplay_interface); 13534 gui_init_fringe (&x_redisplay_interface);
13535#endif 13535#endif
13536 13536
13537 /* Note that there is no real way portable across R3/R4 to get the 13537 /* Note that there is no real way portable across R3/R4 to get the