only parse geometry once
This commit is contained in:
parent
45a7ae8a54
commit
dd27202ba7
16
dunst.c
16
dunst.c
@ -972,10 +972,7 @@ void parse_cmdline(int argc, char *argv[])
|
|||||||
history_key_string = optarg;
|
history_key_string = optarg;
|
||||||
break;
|
break;
|
||||||
case 'g':
|
case 'g':
|
||||||
geometry.mask = XParseGeometry(optarg,
|
geom = optarg;
|
||||||
&geometry.x, &geometry.y,
|
|
||||||
&geometry.w,
|
|
||||||
&geometry.h);
|
|
||||||
break;
|
break;
|
||||||
case 'M':
|
case 'M':
|
||||||
if (!strcmp(optarg, "ctrl")) {
|
if (!strcmp(optarg, "ctrl")) {
|
||||||
@ -1097,10 +1094,6 @@ dunst_ini_handle(void *user_data, const char *section,
|
|||||||
scr.scr = atoi(value);
|
scr.scr = atoi(value);
|
||||||
else if (strcmp(name, "geometry") == 0) {
|
else if (strcmp(name, "geometry") == 0) {
|
||||||
geom = dunst_ini_get_string(value);
|
geom = dunst_ini_get_string(value);
|
||||||
geometry.mask = XParseGeometry(geom,
|
|
||||||
&geometry.x, &geometry.y,
|
|
||||||
&geometry.w,
|
|
||||||
&geometry.h);
|
|
||||||
} else if (strcmp(name, "modifier") == 0) {
|
} else if (strcmp(name, "modifier") == 0) {
|
||||||
char *mod = dunst_ini_get_string(value);
|
char *mod = dunst_ini_get_string(value);
|
||||||
|
|
||||||
@ -1244,15 +1237,16 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
char *cmdline_config_path;
|
char *cmdline_config_path;
|
||||||
now = time(&now);
|
now = time(&now);
|
||||||
geometry.mask = XParseGeometry(geom,
|
|
||||||
&geometry.x, &geometry.y,
|
|
||||||
&geometry.w, &geometry.h);
|
|
||||||
|
|
||||||
cmdline_config_path = parse_cmdline_for_config_file(argc, argv);
|
cmdline_config_path = parse_cmdline_for_config_file(argc, argv);
|
||||||
parse_dunstrc(cmdline_config_path);
|
parse_dunstrc(cmdline_config_path);
|
||||||
parse_cmdline(argc, argv);
|
parse_cmdline(argc, argv);
|
||||||
dc = initdc();
|
dc = initdc();
|
||||||
|
|
||||||
|
geometry.mask = XParseGeometry(geom,
|
||||||
|
&geometry.x, &geometry.y,
|
||||||
|
&geometry.w, &geometry.h);
|
||||||
|
|
||||||
/* initialize keys */
|
/* initialize keys */
|
||||||
key = key_string ? XStringToKeysym(key_string) : NoSymbol;
|
key = key_string ? XStringToKeysym(key_string) : NoSymbol;
|
||||||
history_key =
|
history_key =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user