plugins/composite/src/screen.cpp: Suspicious for loop never iterates

Bug #1046203 reported by Daniel van Vugt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Compiz
Triaged
Medium
Unassigned

Bug Description

plugins/composite/src/screen.cpp:

This loop can't possibly work as a loop if it breaks immediately:

            for (CompWindowList::reverse_iterator rit =
                 screen->windows ().rbegin ();
                 rit != screen->windows ().rend (); ++rit)
            {
                CompWindow *w = (*rit);

                if (w->destroyed () || w->invisible ())
                    continue;

                if (!CompositeWindow::get (w)->redirected ())
                    priv->damage -= w->region ();

                break;
            }

Looks like maybe the author meant:

                if (!CompositeWindow::get (w)->redirected ())
                {
                    priv->damage -= w->region ();
                    break;
                }

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Is the code even relevant any more? We can't and don't do regional redraws any more, so omitting unredirected windows will:

1. For fullscreen unredirected windows: Produce an empty damage region, leaving nothing to paint. This sounds right, but paint() is called anyway, which might be a bug.

2. For non-fullscreen windows: The above loop makes no difference at all. Buffer swapping will probably still clobber/conflict with the unredirected region.

Stephen M. Webb (bregma)
Changed in compiz:
milestone: none → 0.9.11.0
status: New → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.