if(focus == NULL) { return; }
switch_focus_widget(unsigned char direction){  register struct ctk_window *window;  register struct ctk_widget *focus;  struct ctk_widget *widget;      if(dialog != NULL) {    window = dialog;  } else {    window = windows;  }  /* If there are no windows open, we move focus around between the     icons on the root window instead. */  if(window == NULL) {    window = &desktop_window;  }   focus = window->focused;  if(focus == NULL) {    focus = window->active;  }  add_redrawwidget(focus);    if((direction & 1) == 0) {    /* Move focus "up" */    focus = focus->next;  } else {    /* Move focus "down" */    for(widget = window->active;	widget != NULL; widget = widget->next) {	if(widget->next == focus) {	  break;	}          }        focus = widget;    if(focus == NULL) {      if(window->active != NULL) {		for(focus = window->active;	    focus->next != NULL; focus = focus->next);      }    }  }  if(focus == NULL) {    focus = window->active;  }  select_widget(focus);}