]> Dogcows Code - chaz/openbox/commitdiff
fixes for handling char**s
authorDana Jansens <danakj@orodu.net>
Mon, 14 Apr 2003 23:38:54 +0000 (23:38 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 14 Apr 2003 23:38:54 +0000 (23:38 +0000)
openbox/client.c
openbox/prop.c
openbox/screen.c

index b061b8f6eee493517fa8f1502876765c6205c10f..d2e75dc237e1177edcf2ac3eeb338e664f889946 100644 (file)
@@ -1134,10 +1134,9 @@ void client_update_class(Client *self)
             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);
 
@@ -1587,7 +1586,7 @@ void client_fullscreen(Client *self, gboolean fs, gboolean savearea)
         x = y = w = h = 0;
     } else {
         guint num;
-       guint32 *dimensions;
+       gint32 *dimensions;
 
         /* pick some fallbacks... */
         x = screen_area(self->desktop)->x +
@@ -1598,7 +1597,7 @@ void client_fullscreen(Client *self, gboolean fs, gboolean savearea)
         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];
index a97b66dc3748fc5831790a6773bcb7397c722241..bce0426b0fe373bf3a06828bcf2649a94535d32f 100644 (file)
@@ -352,11 +352,11 @@ void prop_set_string_utf8(Window win, Atom prop, char *val)
 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,
index 2b4ece3ea7219e34c74fb865ede7404ec0801608..4db99246a18b3db2f717ac441e9f65d07c656daa 100644 (file)
@@ -25,7 +25,7 @@ guint    screen_desktop         = 0;
 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;
@@ -155,10 +155,11 @@ void screen_startup()
     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;
@@ -377,11 +378,13 @@ void screen_update_desktop_names()
 
     /* 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);
This page took 0.028087 seconds and 4 git commands to generate.