X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fapp.cpp;h=ac70489567a542f654edeeff7f33416efc1dcee9;hb=6fdda786876d9640a6a26f05ef2c5aa7e2175421;hp=4bd739371061c4cbd9b705243559931b3af8008f;hpb=a414f394e06111d761ca6ac0aa783d59a42c6ea8;p=staging%2Fwindowmanager.git diff --git a/src/app.cpp b/src/app.cpp index 4bd7393..ac70489 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -39,7 +39,6 @@ namespace wm { namespace { -App *g_app; using nlohmann::json; @@ -84,9 +83,6 @@ App::App(wl::display *d) id_alloc{}, pending_events(false), policy{} { - assert(g_app == nullptr); - g_app = this; - try { { auto l = load_layer_map( @@ -102,8 +98,6 @@ App::App(wl::display *d) } } -App::~App() { g_app = nullptr; } - int App::init() { if (!this->display->ok()) { return -1; @@ -376,7 +370,7 @@ char const *App::api_activate_surface(char const *drawing_name) { auto o_state = *this->layers.get_layout_state(*surface_id); - if (!o_state) { + if (o_state == nullptr) { return "Could not find layer for surface"; } @@ -482,7 +476,7 @@ char const *App::api_deactivate_surface(char const *drawing_name) { auto o_state = *this->layers.get_layout_state(*surface_id); - if (!o_state) { + if (o_state == nullptr) { return "Could not find layer for surface"; } @@ -623,11 +617,11 @@ void App::surface_removed(uint32_t surface_id) { } void App::emit_activated(char const *label) { - this->api.send_event("activated", label); + this->api.send_event("active", label); } void App::emit_deactivated(char const *label) { - this->api.send_event("deactivated", label); + this->api.send_event("inactive", label); } void App::emit_syncdraw(char const *label) { @@ -742,7 +736,7 @@ bool App::can_split(struct LayoutState const &state, int new_id) { return false; } -void App::try_layout(struct LayoutState &state, +void App::try_layout(struct LayoutState & /*state*/, struct LayoutState const &new_layout, std::function apply) { if (this->policy.layout_is_valid(new_layout)) { @@ -764,10 +758,13 @@ void controller_hooks::surface_removed(uint32_t surface_id) { this->app->surface_removed(surface_id); } -void controller_hooks::surface_visibility(uint32_t surface_id, uint32_t v) { -} +void controller_hooks::surface_visibility(uint32_t /*surface_id*/, + uint32_t /*v*/) {} -void controller_hooks::surface_destination_rectangle(uint32_t surface_id, uint32_t x, uint32_t y, uint32_t w, uint32_t h) { -} +void controller_hooks::surface_destination_rectangle(uint32_t /*surface_id*/, + uint32_t /*x*/, + uint32_t /*y*/, + uint32_t /*w*/, + uint32_t /*h*/) {} } // namespace wm