summaryrefslogtreecommitdiff
path: root/src/actions.c
diff options
context:
space:
mode:
authorsabetts <sabetts>2004-04-24 06:10:33 +0000
committersabetts <sabetts>2004-04-24 06:10:33 +0000
commitc9303ecfb30db08b3cc12137831ab352ac9b0812 (patch)
treecbb6a01bd9c409d83300205871955edf24474830 /src/actions.c
parenta0b9448f94bf5c97730f13f7e6d5cb4d435d605b (diff)
downloadratpoison-c9303ecfb30db08b3cc12137831ab352ac9b0812.zip
* src/data.h (struct rp_defaults): new members, font_string,
fgcolor_string, bgcolor_string. * src/actions.c (set_font): return defaults.font_string when data is NULL (set_fgcolor): likewise for fgcolor_string (set_bgcolor): likewise for bgcolor_string * src/manage.c (ungrab_top_level_keys): properly grab capital letters. * src/main.c (init_defaults): init fgcolor_string, bgcolor_string, and font_string * src/input.c (grab_key): change keysym type to KeySym. convert keysym to keycode. All callers updated.
Diffstat (limited to 'src/actions.c')
-rw-r--r--src/actions.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/actions.c b/src/actions.c
index cb80a4c..8a004d9 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -2340,9 +2340,8 @@ set_font (char *data)
{
XFontStruct *font;
- /* FIXME: return a useful string. */
if (data == NULL)
- return xstrdup ("dummy");
+ return xstrdup (defaults.font_string);
font = XLoadQueryFont (dpy, data);
if (font == NULL)
@@ -2356,6 +2355,9 @@ set_font (char *data)
defaults.font = font;
update_all_gcs();
+ free (defaults.font_string);
+ defaults.font_string = xstrdup (data);
+
return NULL;
}
@@ -2559,9 +2561,8 @@ set_fgcolor (char *data)
int i;
XColor color, junk;
- /* FIXME: return a meaningful string. */
if (data == NULL)
- return xstrdup ("dummy");
+ return xstrdup (defaults.fgcolor_string);
for (i=0; i<num_screens; i++)
{
@@ -2577,6 +2578,9 @@ set_fgcolor (char *data)
XSetWindowBorder (dpy, screens[i].input_window, color.pixel);
XSetWindowBorder (dpy, screens[i].frame_window, color.pixel);
XSetWindowBorder (dpy, screens[i].help_window, color.pixel);
+
+ free (defaults.fgcolor_string);
+ defaults.fgcolor_string = xstrdup (data);
}
return NULL;
@@ -2588,9 +2592,8 @@ set_bgcolor (char *data)
int i;
XColor color, junk;
- /* FIXME: return a meaningful string. */
if (data == NULL)
- return xstrdup ("dummy");
+ return xstrdup (defaults.bgcolor_string);
for (i=0; i<num_screens; i++)
{
@@ -2606,6 +2609,9 @@ set_bgcolor (char *data)
XSetWindowBackground (dpy, screens[i].input_window, color.pixel);
XSetWindowBackground (dpy, screens[i].frame_window, color.pixel);
XSetWindowBackground (dpy, screens[i].help_window, color.pixel);
+
+ free (defaults.bgcolor_string);
+ defaults.bgcolor_string = xstrdup (data);
}
return NULL;