if (data[1])
self->class = g_strdup(data[1]);
}
+ g_strfreev(data);
}
- g_strfreev(data);
-
if (PROP_GETS(self->window, wm_window_role, locale, &s))
self->role = g_strdup(s);
x = y = w = h = 0;
} else {
guint num;
- guint32 *dimensions;
+ gint32 *dimensions;
/* pick some fallbacks... */
x = screen_area(self->desktop)->x +
h = screen_area(self->desktop)->height / 2;
if (PROP_GETA32(self->window, openbox_premax, cardinal,
- &dimensions, &num)) {
+ (guint32**)&dimensions, &num)) {
if (num == 4) {
x = dimensions[0];
y = dimensions[1];
void prop_set_strings_utf8(Window win, Atom prop, char **strs)
{
GString *str;
- guint i;
+ char **s;
str = g_string_sized_new(0);
- for (i = 0; strs[i]; ++i) {
- str = g_string_append(str, strs[i]);
+ for (s = strs; *s; ++s) {
+ str = g_string_append(str, *s);
str = g_string_append_c(str, '\0');
}
XChangeProperty(ob_display, win, prop, prop_atoms.utf8, 8,
Size screen_physical_size;
gboolean screen_showing_desktop;
DesktopLayout screen_desktop_layout;
-char **screen_desktop_names;
+char **screen_desktop_names = NULL;
static Rect *area = NULL;
static Strut *strut = NULL;
screen_resize();
/* set the names */
- screen_desktop_names = g_new0(char*,
- g_slist_length(config_desktops_names) + 1);
+ screen_desktop_names = g_new(char*,
+ g_slist_length(config_desktops_names) + 1);
for (i = 0, it = config_desktops_names; it; ++i, it = it->next)
screen_desktop_names[i] = it->data; /* dont strdup */
+ screen_desktop_names[i] = NULL;
PROP_SETSS(ob_root, net_desktop_names, screen_desktop_names);
g_free(screen_desktop_names); /* dont free the individual strings */
screen_desktop_names = NULL;
/* empty the array */
g_strfreev(screen_desktop_names);
+ screen_desktop_names = NULL;
if (PROP_GETSS(ob_root, net_desktop_names, utf8, &screen_desktop_names))
for (i = 0; screen_desktop_names[i] && i <= screen_num_desktops; ++i);
else
i = 0;
+ g_message("I %d", i);
if (i <= screen_num_desktops) {
screen_desktop_names = g_renew(char*, screen_desktop_names,
screen_num_desktops + 1);