~albaguirre/mir/possibly-fix-yakkety-build-failure

« back to all changes in this revision

Viewing changes to examples/server_example.cpp

  • Committer: Alan Griffiths
  • Date: 2016-06-08 19:17:10 UTC
  • mto: This revision was merged to the branch mainline in revision 3535.
  • Revision ID: alan@octopull.co.uk-20160608191710-v1f2x68yrk7cdhf0
Fix one more issue running Qt client application

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
        const auto options = server.get_options();
69
69
        if (options->is_set(launch_child_opt))
70
70
        {
 
71
            unsetenv("DISPLAY");                                // Discourage toolkits from using X11
 
72
            setenv("GDK_BACKEND", "mir", true);                 // configure GTK to use Mir
 
73
            setenv("QT_QPA_PLATFORM", "ubuntumirclient", true); // configure Qt to use Mir
 
74
            unsetenv("QT_QPA_PLATFORMTHEME");                   // Discourage Qt from unsupported theme
 
75
            setenv("SDL_VIDEODRIVER", "mir", true);             // configure SDL to use Mir
 
76
 
71
77
            auto const value = options->get<std::string>(launch_child_opt);
72
78
 
73
79
            for (auto i = begin(value); i != end(value); )
74
80
            {
75
81
                auto const j = find(i, end(value), '&');
76
82
 
77
 
                auto const cmd ="DISPLAY= "             // Discourage toolkits from using X11
78
 
                    "GDK_BACKEND=mir "                  // configure GTK to use Mir
79
 
                    "QT_QPA_PLATFORM=ubuntumirclient "  // configure Qt to use Mir
80
 
                    "SDL_VIDEODRIVER=mir "              // configure SDL to use Mir
81
 
                    "MIR_SOCKET=" + connection(server.open_client_socket()) + " " +
 
83
                auto const cmd ="MIR_SOCKET=" + connection(server.open_client_socket()) + " " +
82
84
                    std::string{i, j} + "&";
83
85
 
84
86
                auto ignore = std::system(cmd.c_str());