summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--src/actions.c49
2 files changed, 34 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 852dff1..27ef7a6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2001-09-16 shawn <sabetts@diggin.lamenet.tmp>
+ * src/actions.c (update_all_gcs): new function
+ (cmd_deffont): update the graphics contexts.
+
* src/list.c (format_window_name): Use 2 character escape codes,
like printf. Dependant code updated.
diff --git a/src/actions.c b/src/actions.c
index 8468f16..9b02e84 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -1506,6 +1506,36 @@ cmd_defbarloc (int interactive, void *data)
return NULL;
}
+static void
+update_gc (screen_info *s)
+{
+ XGCValues gv;
+
+ gv.foreground = s->fg_color;
+ gv.background = s->bg_color;
+ gv.function = GXcopy;
+ gv.line_width = 1;
+ gv.subwindow_mode = IncludeInferiors;
+ gv.font = defaults.font->fid;
+ XFreeGC (dpy, s->normal_gc);
+ s->normal_gc = XCreateGC(dpy, s->root,
+ GCForeground | GCBackground
+ | GCFunction | GCLineWidth
+ | GCSubwindowMode | GCFont, &gv);
+}
+
+static void
+update_all_gcs ()
+{
+ int i;
+
+ for (i=0; i<num_screens; i++)
+ {
+ update_gc (&screens[i]);
+ }
+}
+
+
char *
cmd_deffont (int interactive, void *data)
{
@@ -1523,6 +1553,7 @@ cmd_deffont (int interactive, void *data)
/* Save the font as the default. */
XFreeFont (dpy, defaults.font);
defaults.font = font;
+ update_all_gcs();
return NULL;
}
@@ -1692,24 +1723,6 @@ cmd_defwinname (int interactive, void *data)
return NULL;
}
-static void
-update_gc (screen_info *s)
-{
- XGCValues gv;
-
- gv.foreground = s->fg_color;
- gv.background = s->bg_color;
- gv.function = GXcopy;
- gv.line_width = 1;
- gv.subwindow_mode = IncludeInferiors;
- gv.font = defaults.font->fid;
- XFreeGC (dpy, s->normal_gc);
- s->normal_gc = XCreateGC(dpy, s->root,
- GCForeground | GCBackground
- | GCFunction | GCLineWidth
- | GCSubwindowMode | GCFont, &gv);
-}
-
char *
cmd_deffgcolor (int interactive, void *data)
{