X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fscreen.c;h=5d640a90950e13e0ff111b5dea29e21133e1794c;hb=174de91c343dfbdfe866e566393bf4790ae22596;hp=544bcdbd9ea2bbf064a9ef383ca0d3b8fcb280be;hpb=a2543824e8ad648153353dcda0a7c76acc1370eb;p=chaz%2Fopenbox diff --git a/openbox/screen.c b/openbox/screen.c index 544bcdbd..5d640a90 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -54,7 +54,7 @@ guint screen_last_desktop; Size screen_physical_size; gboolean screen_showing_desktop; DesktopLayout screen_desktop_layout; -char **screen_desktop_names; +gchar **screen_desktop_names; Window screen_support_win; static Rect **area; /* array of desktop holding array of xinerama areas */ @@ -64,7 +64,7 @@ static ObPagerPopup *desktop_cycle_popup; static gboolean replace_wm() { - char *wm_sn; + gchar *wm_sn; Atom wm_sn_atom; Window current_wm_sn_owner; Time timestamp; @@ -281,9 +281,9 @@ void screen_startup(gboolean reconfig) screen_resize(); /* set the names */ - screen_desktop_names = g_new(char*, + screen_desktop_names = g_new(gchar*, g_slist_length(config_desktops_names) + 1); - for (i = 0, it = config_desktops_names; it; ++i, it = it->next) + for (i = 0, it = config_desktops_names; it; ++i, it = g_slist_next(it)) screen_desktop_names[i] = it->data; /* dont strdup */ screen_desktop_names[i] = NULL; PROP_SETSS(RootWindow(ob_display, ob_screen), @@ -336,8 +336,8 @@ void screen_shutdown(gboolean reconfig) void screen_resize() { - static int oldw = 0, oldh = 0; - int w, h; + static gint oldw = 0, oldh = 0; + gint w, h; GList *it; guint32 geometry[2]; @@ -360,7 +360,7 @@ void screen_resize() screen_update_areas(); dock_configure(); - for (it = client_list; it; it = it->next) + for (it = client_list; it; it = g_list_next(it)) client_move_onscreen(it->data, FALSE); } @@ -392,7 +392,7 @@ void screen_set_num_desktops(guint num) screen_update_desktop_names(); /* move windows on desktops that will no longer exist! */ - for (it = client_list; it != NULL; it = it->next) { + for (it = client_list; it; it = g_list_next(it)) { ObClient *c = it->data; if (c->desktop >= num && c->desktop != DESKTOP_ALL) client_set_desktop(c, num - 1, FALSE); @@ -850,7 +850,7 @@ void screen_update_desktop_names() else i = 0; if (i <= screen_num_desktops) { - screen_desktop_names = g_renew(char*, screen_desktop_names, + screen_desktop_names = g_renew(gchar*, screen_desktop_names, screen_num_desktops + 1); screen_desktop_names[screen_num_desktops] = NULL; for (; i < screen_num_desktops; ++i) @@ -867,28 +867,28 @@ void screen_show_desktop(gboolean show) screen_showing_desktop = show; if (show) { - /* bottom to top */ - for (it = g_list_last(stacking_list); it != NULL; it = it->prev) { + /* bottom to top */ + for (it = g_list_last(stacking_list); it; it = g_list_previous(it)) { if (WINDOW_IS_CLIENT(it->data)) { ObClient *client = it->data; if (client->frame->visible && !client_should_show(client)) frame_hide(client->frame); } - } + } } else { /* top to bottom */ - for (it = stacking_list; it != NULL; it = it->next) { + for (it = stacking_list; it; it = g_list_next(it)) { if (WINDOW_IS_CLIENT(it->data)) { ObClient *client = it->data; if (!client->frame->visible && client_should_show(client)) frame_show(client->frame); } - } + } } if (show) { /* focus desktop */ - for (it = focus_order[screen_desktop]; it; it = it->next) + for (it = focus_order[screen_desktop]; it; it = g_list_next(it)) if (((ObClient*)it->data)->type == OB_CLIENT_TYPE_DESKTOP && client_focus(it->data)) break; @@ -1021,7 +1021,7 @@ void screen_update_areas() o = MIN(o, area[i][x].x); for (x = 0; x < screen_num_monitors; ++x) { - for (it = client_list; it; it = it->next) { + for (it = client_list; it; it = g_list_next(it)) { ObClient *c = it->data; screen_area_add_strut_left(&c->strut, &monitor_area[x], @@ -1043,7 +1043,7 @@ void screen_update_areas() o = MIN(o, area[i][x].y); for (x = 0; x < screen_num_monitors; ++x) { - for (it = client_list; it; it = it->next) { + for (it = client_list; it; it = g_list_next(it)) { ObClient *c = it->data; screen_area_add_strut_top(&c->strut, &monitor_area[x], @@ -1065,7 +1065,7 @@ void screen_update_areas() o = MAX(o, area[i][x].x + area[i][x].width - 1); for (x = 0; x < screen_num_monitors; ++x) { - for (it = client_list; it; it = it->next) { + for (it = client_list; it; it = g_list_next(it)) { ObClient *c = it->data; screen_area_add_strut_right(&c->strut, &monitor_area[x], @@ -1090,7 +1090,7 @@ void screen_update_areas() o = MAX(o, area[i][x].y + area[i][x].height - 1); for (x = 0; x < screen_num_monitors; ++x) { - for (it = client_list; it; it = it->next) { + for (it = client_list; it; it = g_list_next(it)) { ObClient *c = it->data; screen_area_add_strut_bottom(&c->strut, &monitor_area[x], @@ -1126,7 +1126,7 @@ void screen_update_areas() /* the area has changed, adjust all the maximized windows */ - for (it = client_list; it; it = it->next) { + for (it = client_list; it; it = g_list_next(it)) { ObClient *c = it->data; if (i < screen_num_desktops) { if (c->desktop == i) @@ -1190,10 +1190,10 @@ void screen_set_root_cursor() ob_cursor(OB_CURSOR_POINTER)); } -gboolean screen_pointer_pos(int *x, int *y) +gboolean screen_pointer_pos(gint *x, gint *y) { Window w; - int i; + gint i; guint u; return !!XQueryPointer(ob_display, RootWindow(ob_display, ob_screen),