~ci-train-bot/miral/miral-ubuntu-zesty-2299

« back to all changes in this revision

Viewing changes to miral-shell/tiling_window_manager.h

  • Committer: Bileto Bot
  • Date: 2016-11-30 08:40:00 UTC
  • mfrom: (340.1.2 miral-release)
  • Revision ID: ci-train-bot@canonical.com-20161130084000-q9mfvwqsbdr078ec
* New upstream release 0.5.0 (https://launchpad.net/miral/+milestone/0.5)
  - ABI summary:
    . miral ABI unchanged at 1
  - Enhancements:
    . Add miral::DebugExtension allowing shells to enable & disable support
      for debug extension API(s) dynamically
    . Improve handling of fullscreen surfaces when switching outputs, or
      specified output doesn't exist (any more)
    . Initial tests and some fixes for tracking of active window.
    . Document the order of windows passed to
      WindowManagementPolicy::advise_raise() so clients can rely on it.
    . [examples] Add miral-desktop script for launching a pseudo-desktop
    . [examples] Add miral-screencast - a utility script to assist with
      creating a screencast
    . [examples: miral-shell --window-manager tiling] implement the layout
      suggested in "Tasks for the interested reader"
    . [examples: miral-shell --window-manager tiling] Don't place a tile
      until the first window is ready
    . [examples: miral-kiosk] Provide configuration options for kiosk:
      --keymap --kiosk-maximize-root-windows & --kiosk-startup-apps-only
  - Bugs fixed:
    . Display configuration changes may cause "fatal errors" when there are
      fullscreen windows (LP: #1640557)

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include <mir/geometry/displacement.h>
30
30
#include <miral/internal_client.h>
31
31
 
 
32
 
 
33
#include <functional>
 
34
#include <vector>
 
35
 
32
36
using namespace mir::geometry;
33
37
 
34
38
// Demonstrate implementing a simple tiling algorithm
107
111
    Rectangles displays;
108
112
    bool dirty_tiles = false;
109
113
 
 
114
    class MRUTileList
 
115
    {
 
116
    public:
 
117
 
 
118
        void push(std::shared_ptr<void> const& tile);
 
119
        void erase(std::shared_ptr<void> const& tile);
 
120
        auto top() const -> std::shared_ptr<void> const&;
 
121
 
 
122
        using Enumerator = std::function<void(std::shared_ptr<void> const& tile)>;
 
123
 
 
124
        void enumerate(Enumerator const& enumerator) const;
 
125
        auto count() -> size_t { return tiles.size(); }
 
126
 
 
127
    private:
 
128
        std::vector<std::shared_ptr<void>> tiles;
 
129
    };
 
130
 
 
131
    MRUTileList tiles;
 
132
 
110
133
    // These two variables are used by the advise_display methods which are
111
134
    // NOT guarded by the usual WM mutex
112
135
    bool dirty_displays = false;