~robertcarr/mir/client-focus-notifications

« back to all changes in this revision

Viewing changes to examples/demo-shell/demo_shell.cpp

  • Committer: Robert Carr
  • Date: 2013-08-01 22:01:20 UTC
  • mfrom: (706.2.208 trunk)
  • Revision ID: robert.carr@canonical.com-20130801220120-6m230b3g6x0xflzd
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
#include "window_manager.h"
22
22
#include "fullscreen_placement_strategy.h"
 
23
#include "../server_configuration.h"
23
24
 
24
25
#include "mir/run_mir.h"
25
26
#include "mir/report_exception.h"
26
 
#include "mir/default_server_configuration.h"
27
27
#include "mir/shell/session_manager.h"
28
28
#include "mir/shell/registration_order_focus_sequence.h"
29
29
#include "mir/shell/single_visibility_focus_mechanism.h"
44
44
namespace examples
45
45
{
46
46
 
47
 
struct DemoServerConfiguration : mir::DefaultServerConfiguration
 
47
struct DemoServerConfiguration : mir::examples::ServerConfiguration
48
48
{
49
49
    DemoServerConfiguration(int argc, char const* argv[],
50
50
                            std::initializer_list<std::shared_ptr<mi::EventFilter> const> const& filter_list)
51
 
      : DefaultServerConfiguration(argc, argv),
 
51
      : ServerConfiguration(argc, argv),
52
52
        filter_list(filter_list)
53
53
    {
 
54
        namespace po = boost::program_options;
 
55
 
 
56
        add_options()
 
57
            ("fullscreen-surfaces", po::value<bool>(),
 
58
                "Make all surfaces fullscreen [bool:default=false]");
54
59
    }
55
60
 
56
 
    std::shared_ptr<msh::PlacementStrategy> the_shell_placement_strategy()
 
61
    std::shared_ptr<msh::PlacementStrategy> the_shell_placement_strategy() override
57
62
    {
58
63
        return shell_placement_strategy(
59
 
            [this]
 
64
            [this]() -> std::shared_ptr<msh::PlacementStrategy>
60
65
            {
61
 
                return std::make_shared<me::FullscreenPlacementStrategy>(the_shell_display_layout());
 
66
                if (the_options()->is_set("fullscreen-surfaces"))
 
67
                    return std::make_shared<me::FullscreenPlacementStrategy>(the_shell_display_layout());
 
68
                else
 
69
                    return DefaultServerConfiguration::the_shell_placement_strategy();
62
70
            });
63
71
    }
64
72