aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2000-12-07 11:45:33 +0000
committerGerd Moellmann2000-12-07 11:45:33 +0000
commit959e647dcff6744bab020f8005b59981ed56c18c (patch)
tree04d806a6ff1335c468ade78f32c13364283d3ca6 /src
parentbd637d692d1ccfc43fb52727c59f1f49c19435c8 (diff)
downloademacs-959e647dcff6744bab020f8005b59981ed56c18c.tar.gz
emacs-959e647dcff6744bab020f8005b59981ed56c18c.zip
(x_free_gcs): New function.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog12
-rw-r--r--src/xfns.c59
2 files changed, 61 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index bd087232997..340222b56fb 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,15 @@
12000-12-07 Gerd Moellmann <gerd@gnu.org>
2
3 * xfns.c (x_free_gcs): New function.
4
5 * xterm.h (x_free_gcs): Add prototype.
6
7 * widget.c (EmacsFrameDestroy): Call x_free_gcs instead of
8 freeing GCs here.
9
10 * xterm.c (x_destroy_window): Call x_free_gcs so that
11 resources of non-toolkit X windows will be freed.
12
12000-12-07 Andrew Innes <andrewi@gnu.org> 132000-12-07 Andrew Innes <andrewi@gnu.org>
2 14
3 * w32fns.c (xlfd_charset_of_font): Fix last change. 15 * w32fns.c (xlfd_charset_of_font): Fix last change.
diff --git a/src/xfns.c b/src/xfns.c
index 65e917cf4c5..5cb5f2901f2 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -3936,20 +3936,20 @@ x_make_gc (f)
3936 gc_values.foreground = f->output_data.x->foreground_pixel; 3936 gc_values.foreground = f->output_data.x->foreground_pixel;
3937 gc_values.background = f->output_data.x->background_pixel; 3937 gc_values.background = f->output_data.x->background_pixel;
3938 gc_values.line_width = 0; /* Means 1 using fast algorithm. */ 3938 gc_values.line_width = 0; /* Means 1 using fast algorithm. */
3939 f->output_data.x->normal_gc = XCreateGC (FRAME_X_DISPLAY (f), 3939 f->output_data.x->normal_gc
3940 FRAME_X_WINDOW (f), 3940 = XCreateGC (FRAME_X_DISPLAY (f),
3941 GCLineWidth | GCFont 3941 FRAME_X_WINDOW (f),
3942 | GCForeground | GCBackground, 3942 GCLineWidth | GCFont | GCForeground | GCBackground,
3943 &gc_values); 3943 &gc_values);
3944 3944
3945 /* Reverse video style. */ 3945 /* Reverse video style. */
3946 gc_values.foreground = f->output_data.x->background_pixel; 3946 gc_values.foreground = f->output_data.x->background_pixel;
3947 gc_values.background = f->output_data.x->foreground_pixel; 3947 gc_values.background = f->output_data.x->foreground_pixel;
3948 f->output_data.x->reverse_gc = XCreateGC (FRAME_X_DISPLAY (f), 3948 f->output_data.x->reverse_gc
3949 FRAME_X_WINDOW (f), 3949 = XCreateGC (FRAME_X_DISPLAY (f),
3950 GCFont | GCForeground | GCBackground 3950 FRAME_X_WINDOW (f),
3951 | GCLineWidth, 3951 GCFont | GCForeground | GCBackground | GCLineWidth,
3952 &gc_values); 3952 &gc_values);
3953 3953
3954 /* Cursor has cursor-color background, background-color foreground. */ 3954 /* Cursor has cursor-color background, background-color foreground. */
3955 gc_values.foreground = f->output_data.x->background_pixel; 3955 gc_values.foreground = f->output_data.x->background_pixel;
@@ -3984,6 +3984,45 @@ x_make_gc (f)
3984 UNBLOCK_INPUT; 3984 UNBLOCK_INPUT;
3985} 3985}
3986 3986
3987
3988/* Free what was was allocated in x_make_gc. */
3989
3990void
3991x_free_gcs (f)
3992 struct frame *f;
3993{
3994 Display *dpy = FRAME_X_DISPLAY (f);
3995
3996 BLOCK_INPUT;
3997
3998 if (f->output_data.x->normal_gc)
3999 {
4000 XFreeGC (dpy, f->output_data.x->normal_gc);
4001 f->output_data.x->normal_gc = 0;
4002 }
4003
4004 if (f->output_data.x->reverse_gc)
4005 {
4006 XFreeGC (dpy, f->output_data.x->reverse_gc);
4007 f->output_data.x->reverse_gc = 0;
4008 }
4009
4010 if (f->output_data.x->cursor_gc)
4011 {
4012 XFreeGC (dpy, f->output_data.x->cursor_gc);
4013 f->output_data.x->cursor_gc = 0;
4014 }
4015
4016 if (f->output_data.x->border_tile)
4017 {
4018 XFreePixmap (dpy, f->output_data.x->border_tile);
4019 f->output_data.x->border_tile = 0;
4020 }
4021
4022 UNBLOCK_INPUT;
4023}
4024
4025
3987DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame, 4026DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
3988 1, 1, 0, 4027 1, 1, 0,
3989 "Make a new X window, which is called a \"frame\" in Emacs terms.\n\ 4028 "Make a new X window, which is called a \"frame\" in Emacs terms.\n\