Code review comment for lp:~brandontschaefer/compiz/lp.102246-remove-if-no-struts

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

As discussed, I'm happy with this, thanks for figuring it out.

11 + if (!window->struts())
12 + {

This check here is probably not necessary. updateStruts on a destroyed window that previous had struts should always clear the struts because the window is destroyed on the server. We should always seek to remove destroyed windows from that list - having destroyed windows in lists can cause later problems down the line, since we use raw pointers.

As for testing - it could be a tad tricky. One means of testing would be to encapsulate the strut window list and doHandleScreenSizeChange functions behind interfaces, and then make a class that encapsulates a PlaceWindow's ownership of a place in that list. That would be testing what the unit does at a unit level.

I was going to suggest using xorg-gtest to test integration with the server, however, xorg-gtest won't be able to handle this case. All attempts to reconfigure a root window automatically fail when using the protocol.

« Back to merge proposal