diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/actions.c | 49 |
2 files changed, 34 insertions, 18 deletions
@@ -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) { |