{ S("-display"), S("*display"), XrmoptionSepArg },
{ S("-geometry"), S("*geometry"), XrmoptionSepArg },
{ S("-into"), S("*parentWindow"), XrmoptionSepArg },
- { S("-icon"), S("*icon"), XrmoptionIsArg },
+ { S("-iconic"), S("*iconic"), XrmoptionIsArg },
{ S("-withdrawn"), S("*withdrawn"), XrmoptionIsArg },
#define GC(g)
#define C(c,u) \
}
static int getresource_bool(const char *want, int def, int *cache) {
- /* *cache should be initialised to -1 and will be set to !!value */
+ /* *cache should be initialised to -1 and will be set to !!value
+ * alternatively cache==0 is allowed */
+
+ if (cache && *cache >= 0) return *cache;
- if (*cache >= 0) return *cache;
const char *str= getresource(want);
int result = def;
if (str && str[0]) {
}
}
}
- return *cache= result;
+
+ if (cache) *cache= result;
+ return result;
}
static void more_resources(const char *str, const char *why) {
wm_hints->flags= InputHint;
wm_hints->input= False;
- wm_hints->initial_state= (getresource("withdrawn") ? WithdrawnState :
- getresource("icon") ? IconicState
- : NormalState);
+ wm_hints->initial_state=
+ (getresource_bool("withdrawn",0,0) ? WithdrawnState :
+ getresource_bool("iconic",0,0) ? IconicState
+ : NormalState);
class_hint->res_name= program_name_silly;
class_hint->res_class= program_name_silly;