Mir

Merge lp:~alan-griffiths/mir/cherry-pick-fix-1641166-for-0-25 into lp:mir/0.25

Proposed by Alan Griffiths on 2016-11-13
Status: Merged
Approved by: Brandon Schaefer on 2016-11-14
Approved revision: 3816
Merged at revision: 3815
Proposed branch: lp:~alan-griffiths/mir/cherry-pick-fix-1641166-for-0-25
Merge into: lp:mir/0.25
Diff against target: 103 lines (+6/-45)
4 files modified
debian/changelog (+2/-0)
src/include/server/mir/frontend/unsupported_feature_exception.h (+0/-41)
src/server/frontend/protobuf_message_processor.cpp (+1/-2)
src/server/scene/unsupported_coordinate_translator.cpp (+3/-2)
To merge this branch: bzr merge lp:~alan-griffiths/mir/cherry-pick-fix-1641166-for-0-25
Reviewer Review Type Date Requested Status
Brandon Schaefer (community) Approve on 2016-11-14
Andreas Pokorny (community) Approve on 2016-11-14
Daniel van Vugt 2016-11-13 Needs Fixing on 2016-11-14
Review via email: mp+310720@code.launchpad.net

Commit message

Fix code to match the documentation of CoordinateTranslator - vis "It is acceptable ...[to] throw a std::runtime_error" (LP: #1641166)

To post a comment you must log in.
Daniel van Vugt (vanvugt) wrote :

I'm not familiar with the bug but we should probably land a changelog entry for the fix at the same time.

review: Needs Fixing
3816. By Alan Griffiths on 2016-11-14

Add changelog entry

Alan Griffiths (alan-griffiths) wrote :

> I'm not familiar with the bug but we should probably land a changelog entry
> for the fix at the same time.

Thanks you

Andreas Pokorny (andreas-pokorny) wrote :

ok...

review: Approve
Brandon Schaefer (brandontschaefer) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2016-11-09 05:52:05 +0000
3+++ debian/changelog 2016-11-14 09:42:57 +0000
4@@ -88,6 +88,8 @@
5 . mir_connection_create_spec_for_tooltip does not set aux_rect
6 (LP: #1632335)
7 . VMware virtual connector recognized by Mir as "unknown" (LP: #1248072)
8+ . Fix code to match the documentation of CoordinateTranslator - vis "It is
9+ acceptable ...[to] throw a std::runtime_error" (LP: #1641166)
10 . Test timeout MesaDisplayConfigurationTests.* (LP: #1613352)
11 . Tests fail when built against lp:mir (LP: #1621917)
12 . CI failure PointerConfinement.* (LP: #1606418)
13
14=== removed file 'src/include/server/mir/frontend/unsupported_feature_exception.h'
15--- src/include/server/mir/frontend/unsupported_feature_exception.h 2014-09-18 09:18:01 +0000
16+++ src/include/server/mir/frontend/unsupported_feature_exception.h 1970-01-01 00:00:00 +0000
17@@ -1,41 +0,0 @@
18-/*
19- * Copyright © 2014 Canonical Ltd.
20- *
21- * This program is free software: you can redistribute it and/or modify it
22- * under the terms of the GNU General Public License version 3,
23- * as published by the Free Software Foundation.
24- *
25- * This program is distributed in the hope that it will be useful,
26- * but WITHOUT ANY WARRANTY; without even the implied warranty of
27- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28- * GNU General Public License for more details.
29- *
30- * You should have received a copy of the GNU General Public License
31- * along with this program. If not, see <http://www.gnu.org/licenses/>.
32- *
33- * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
34- */
35-
36-
37-#ifndef MIR_FRONTEND_UNSUPPORTED_FEATURE_EXCEPTION_H_
38-#define MIR_FRONTEND_UNSUPPORTED_FEATURE_EXCEPTION_H_
39-
40-#include <stdexcept>
41-
42-namespace mir
43-{
44-namespace frontend
45-{
46-class unsupported_feature : public std::runtime_error
47-{
48-public:
49- unsupported_feature()
50- : std::runtime_error{"Unsupported feature requested"}
51- {
52- }
53-};
54-}
55-}
56-
57-
58-#endif /* MIR_FRONTEND_UNSUPPORTED_FEATURE_EXCEPTION_H_ */
59
60=== modified file 'src/server/frontend/protobuf_message_processor.cpp'
61--- src/server/frontend/protobuf_message_processor.cpp 2016-10-12 06:03:15 +0000
62+++ src/server/frontend/protobuf_message_processor.cpp 2016-11-14 09:42:57 +0000
63@@ -22,7 +22,6 @@
64 #include "mir/frontend/message_processor_report.h"
65 #include "mir/frontend/protobuf_message_sender.h"
66 #include "mir/frontend/template_protobuf_message_processor.h"
67-#include "mir/frontend/unsupported_feature_exception.h"
68 #include <mir/protobuf/display_server_debug.h>
69 #include "mir/client_visible_error.h"
70
71@@ -322,7 +321,7 @@
72 auto debug_interface = dynamic_cast<mir::protobuf::DisplayServerDebug*>(display_server.get());
73 invoke(this, debug_interface, &mir::protobuf::DisplayServerDebug::translate_surface_to_screen, invocation);
74 }
75- catch (mir::frontend::unsupported_feature const&)
76+ catch (std::runtime_error const&)
77 {
78 std::string message{"Server does not support the client debugging interface"};
79 invoke(this,
80
81=== modified file 'src/server/scene/unsupported_coordinate_translator.cpp'
82--- src/server/scene/unsupported_coordinate_translator.cpp 2016-01-29 08:18:22 +0000
83+++ src/server/scene/unsupported_coordinate_translator.cpp 2016-11-14 09:42:57 +0000
84@@ -17,10 +17,11 @@
85 */
86
87 #include "unsupported_coordinate_translator.h"
88-#include "mir/frontend/unsupported_feature_exception.h"
89
90 #include <boost/exception/all.hpp>
91
92+#include <stdexcept>
93+
94 namespace mg = mir::geometry;
95 namespace mf = mir::frontend;
96 namespace ms = mir::scene;
97@@ -29,5 +30,5 @@
98 std::shared_ptr<mf::Surface> /*surface*/,
99 int32_t /*x*/, int32_t /*y*/)
100 {
101- BOOST_THROW_EXCEPTION(mf::unsupported_feature());
102+ BOOST_THROW_EXCEPTION(std::runtime_error{"Unsupported feature requested"});
103 }

Subscribers

People subscribed via source and target branches