~attente/mir/basic-menu-surface-position

« back to all changes in this revision

Viewing changes to src/server/shell/default_placement_strategy.cpp

  • Committer: William Hua
  • Date: 2015-01-26 23:09:35 UTC
  • Revision ID: william.hua@canonical.com-20150126230935-ba9h6gzmgos2buke
Give surfaces a default depth.

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
        auto origin = parent->top_left();
53
53
        placed_parameters.top_left = placed_parameters.top_left + geom::DeltaX(origin.x.as_int());
54
54
        placed_parameters.top_left = placed_parameters.top_left + geom::DeltaY(origin.y.as_int());
 
55
 
 
56
        auto depth = 1;
 
57
 
 
58
        while (parent)
 
59
        {
 
60
            parent = parent->parent();
 
61
            ++depth;
 
62
        }
 
63
 
 
64
        placed_parameters.of_depth(ms::DepthId(depth));
55
65
    }
56
66
 
57
67
    geom::Rectangle rect{placed_parameters.top_left, placed_parameters.size};