Skip to content

Instantly share code, notes, and snippets.

@jrziviani
Created June 17, 2014 02:43
Show Gist options
  • Save jrziviani/853666a6050ce4c1f051 to your computer and use it in GitHub Desktop.
Save jrziviani/853666a6050ce4c1f051 to your computer and use it in GitHub Desktop.
unsigned int nonFloatingWindows = 0;
using lbPair = std::pair<const long unsigned int,
std::unique_ptr<IWindow>>;
// couting only non-floating windows to calcule the areas
// for tiling them.
std::for_each(
_desktops[_currentDesktop].begin(),
_desktops[_currentDesktop].end(),
// lambda - use nonFloatingWindows variable as
// reference, it will be incresead if the window is
// not floating
[&nonFloatingWindows](lbPair& wnd)
{
if (!wnd.second->floating())
++nonFloatingWindows;
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment