From 5770b56af0c5088dc312ff874e0fd7bb5025fa0d Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sat, 5 Jan 2008 13:01:40 +0100 Subject: [PATCH] allow negativ coords --- config.c | 28 ++++++++++++++-------------- widget.c | 4 ++-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/config.c b/config.c index ee4a273d1..92106e414 100644 --- a/config.c +++ b/config.c @@ -514,22 +514,22 @@ config_parse(const char *confpatharg) }; static cfg_opt_t widget_opts[] = { - CFG_INT((char *) "x", -1, CFGF_NONE), - CFG_INT((char *) "y", -1, CFGF_NONE), + CFG_INT((char *) "x", 0xffffffff, CFGF_NONE), + CFG_INT((char *) "y", 0xffffffff, CFGF_NONE), CFG_SEC((char *) "mouse", mouse_generic_opts, CFGF_MULTI), CFG_END() }; static cfg_opt_t widget_taglist_opts[] = { - CFG_INT((char *) "x", -1, CFGF_NONE), - CFG_INT((char *) "y", -1, CFGF_NONE), + CFG_INT((char *) "x", 0xffffffff, CFGF_NONE), + CFG_INT((char *) "y", 0xffffffff, CFGF_NONE), CFG_SEC((char *) "mouse", mouse_taglist_opts, CFGF_MULTI), CFG_END() }; static cfg_opt_t widget_iconbox_opts[] = { - CFG_INT((char *) "x", -1, CFGF_NONE), - CFG_INT((char *) "y", -1, CFGF_NONE), + CFG_INT((char *) "x", 0xffffffff, CFGF_NONE), + CFG_INT((char *) "y", 0xffffffff, CFGF_NONE), CFG_SEC((char *) "mouse", mouse_generic_opts, CFGF_MULTI), CFG_STR((char *) "image", (char *) NULL, CFGF_NONE), CFG_BOOL((char *) "resize", cfg_true, CFGF_NONE), @@ -537,8 +537,8 @@ config_parse(const char *confpatharg) }; static cfg_opt_t widget_textbox_opts[] = { - CFG_INT((char *) "x", -1, CFGF_NONE), - CFG_INT((char *) "y", -1, CFGF_NONE), + CFG_INT((char *) "x", 0xffffffff, CFGF_NONE), + CFG_INT((char *) "y", 0xffffffff, CFGF_NONE), CFG_SEC((char *) "mouse", mouse_generic_opts, CFGF_MULTI), CFG_INT((char *) "width", 0, CFGF_NONE), CFG_STR((char *) "text", (char *) NULL, CFGF_NONE), @@ -550,8 +550,8 @@ config_parse(const char *confpatharg) }; static cfg_opt_t widget_focustitle_opts[] = { - CFG_INT((char *) "x", -1, CFGF_NONE), - CFG_INT((char *) "y", -1, CFGF_NONE), + CFG_INT((char *) "x", 0xffffffff, CFGF_NONE), + CFG_INT((char *) "y", 0xffffffff, CFGF_NONE), CFG_SEC((char *) "mouse", mouse_generic_opts, CFGF_MULTI), CFG_STR((char *) "fg", (char *) NULL, CFGF_NONE), CFG_STR((char *) "bg", (char *) NULL, CFGF_NONE), @@ -561,8 +561,8 @@ config_parse(const char *confpatharg) }; static cfg_opt_t widget_tasklist_opts[] = { - CFG_INT((char *) "x", -1, CFGF_NONE), - CFG_INT((char *) "y", -1, CFGF_NONE), + CFG_INT((char *) "x", 0xffffffff, CFGF_NONE), + CFG_INT((char *) "y", 0xffffffff, CFGF_NONE), CFG_SEC((char *) "mouse", mouse_generic_opts, CFGF_MULTI), CFG_STR((char *) "fg", (char *) NULL, CFGF_NONE), CFG_STR((char *) "bg", (char *) NULL, CFGF_NONE), @@ -581,8 +581,8 @@ config_parse(const char *confpatharg) }; static cfg_opt_t widget_progressbar_opts[] = { - CFG_INT((char *) "x", -1, CFGF_NONE), - CFG_INT((char *) "y", -1, CFGF_NONE), + CFG_INT((char *) "x", 0xffffffff, CFGF_NONE), + CFG_INT((char *) "y", 0xffffffff, CFGF_NONE), CFG_SEC((char *) "mouse", mouse_generic_opts, CFGF_MULTI), CFG_SEC((char *) "bar", widget_progressbar_bar_opts, CFGF_MULTI), CFG_INT((char *) "width", 100, CFGF_NONE), diff --git a/widget.c b/widget.c index 121c882fc..f5697533e 100644 --- a/widget.c +++ b/widget.c @@ -117,8 +117,8 @@ widget_common_new(Widget *widget, Statusbar *statusbar, cfg_t* config) widget->button_press = widget_common_button_press; widget->area.x = cfg_getint(config, "x"); widget->area.y = cfg_getint(config, "y"); - widget->user_supplied_x = (widget->area.x >= 0); - widget->user_supplied_y = (widget->area.y >= 0); + widget->user_supplied_x = (widget->area.x != (int) 0xffffffff); + widget->user_supplied_y = (widget->area.y != (int) 0xffffffff); } /** Send command to widget