Exemplo n.º 1
0
void select_client(Client *c) {
  XColor border_colour_active, border_colour_inactive;
  XColor border_colour_float_active, border_colour_float_inactive;
  XColor dummy;
  unsigned long bpixel;

  if (current)
  {
    XAllocNamedColor(dpy, DefaultColormap(dpy, current->xstuff->screen->screen), settings_get( "border.colour.inactive" ), &border_colour_inactive, &dummy);
    XAllocNamedColor(dpy, DefaultColormap(dpy, current->xstuff->screen->screen), settings_get( "border.colour.float.inactive" ), &border_colour_float_inactive, &dummy);
    if (is_sticky(current))
      bpixel = border_colour_float_inactive.pixel;
    else
      bpixel = border_colour_inactive.pixel;
    XSetWindowBorder(dpy, current->xstuff->parent, bpixel);
  }
  if (c) {
    XAllocNamedColor(dpy, DefaultColormap(dpy, c->xstuff->screen->screen), settings_get( "border.colour.active" ), &border_colour_active, &dummy);
    XAllocNamedColor(dpy, DefaultColormap(dpy, c->xstuff->screen->screen), settings_get( "border.colour.float.active" ), &border_colour_float_active, &dummy);
    if (is_sticky(c))
      bpixel = border_colour_float_active.pixel;
    else
      bpixel = border_colour_active.pixel;
    XSetWindowBorder(dpy, c->xstuff->parent, bpixel);
    XInstallColormap(dpy, c->xstuff->cmap);
    XSetInputFocus(dpy, c->xstuff->window, RevertToPointerRoot, CurrentTime);
  }
  current = c;
}
Exemplo n.º 2
0
void select_client(Client *c) {
	if (current)
		XSetWindowBorder(dpy, current->parent, current->screen->bg.pixel);
	if (c) {
		unsigned long bpixel;
#ifdef VWM
		if (is_sticky(c))
			bpixel = c->screen->fc.pixel;
		else
#endif
			bpixel = c->screen->fg.pixel;
		XSetWindowBorder(dpy, c->parent, bpixel);
#ifdef COLOURMAP
		XInstallColormap(dpy, c->cmap);
#endif
		XSetInputFocus(dpy, c->window, RevertToPointerRoot, CurrentTime);
	}
	current = c;
}