/* * Copyright © Canonical Ltd. * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef MIR_FRONTEND_FOREIGN_TOPLEVEL_MANAGER_V1_H #define MIR_FRONTEND_FOREIGN_TOPLEVEL_MANAGER_V1_H #include "wlr-foreign-toplevel-management-unstable-v1_wrapper.h" #include "desktop_file_manager.h" #include #include #include #include namespace mir { class Executor; class MainLoop; namespace shell { class Shell; } namespace frontend { class SurfaceStack; auto create_foreign_toplevel_manager_v1( wl_display* display, std::shared_ptr const& shell, std::shared_ptr const& wayland_executor, std::shared_ptr const& surface_stack, std::shared_ptr const& desktop_file_manager) -> std::shared_ptr; class GDesktopFileCache : public DesktopFileCache { public: GDesktopFileCache(std::shared_ptr const& main_loop); ~GDesktopFileCache() override = default; std::shared_ptr lookup_by_app_id(std::string const&) const override; std::shared_ptr lookup_by_wm_class(std::string const&) const override; std::shared_ptr lookup_by_exec_string(std::string const&) const override; void refresh_app_cache(); private: std::shared_ptr const main_loop; mir::Fd inotify_fd; std::vector config_path_wd_list; struct GDesktopFileCacheData { std::map> id_to_app; std::map> hidden_id_to_app; std::map> wm_class_to_app_info_id; std::map> exec_to_app; }; mir::Synchronised cache_state; }; } } #endif // MIR_FRONTEND_FOREIGN_TOPLEVEL_MANAGER_V1_H