All pastes #2063120 Raw Edit

Stuff

public text v1 · immutable
#2063120 ·published 2011-05-18 08:08 UTC
rendered paste body
void
NegWindow::toggle ()
{
    NEG_SCREEN (screen);

	CompString windowName = window->resName ();
	bool negWindowExists = false;

    /* toggle window negative flag */
    isNeg = !isNeg;

    /* check exclude list */
    if (ns->optionGetExcludeMatch ().evaluate (window))
	isNeg = false;
printf ("**********BEGIN**********\n");
	foreach (CompWindow *w, screen->windows ())
	{
		if (NegWindow::get (w)->isNeg)
		{
			negWindowExists = true;
			printf ("negWindowExists %s\n", w->resName ().c_str ());
			if (w->invisible ())
				printf ("invisible window %s\n", w->resName ().c_str ());
			/*
			if (windowName == w->resName ())
			{printf ("windowName == w->resName ()\n");
				NegWindow::get (w)->isNeg = isNeg;
			}
			*/
		}
	}
printf ("***********END***********\n");
	/* disable ns->isNeg if no windows are negative */
	if (!negWindowExists)
	{printf ("!negWindowExists\n");
		ns->isNeg = false;
	}
		

    /* cause repainting */
    cWindow->addDamage ();

    if (isNeg)
	gWindow->glDrawTextureSetEnabled (this, true);
    else
	gWindow->glDrawTextureSetEnabled (this, false);
}