From d158d619c654a73ccad7c16a339db04d7869fc8f Mon Sep 17 00:00:00 2001 From: mattkae Date: Sat, 18 Feb 2023 14:09:01 -0500 Subject: [PATCH] Make the example more true --- .gitignore | 3 ++- CMakeLists.txt | 4 +++- src/main.cpp | 15 +++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e195b8d..97b6c60 100644 --- a/.gitignore +++ b/.gitignore @@ -34,4 +34,5 @@ # Custom mir-builder.* build -Technical_Test_-_Software_Engineer_-_Mir_-_Google_Docs.pdf \ No newline at end of file +Technical_Test_-_Software_Engineer_-_Mir_-_Google_Docs.pdf +.cache \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index fe02281..b8c17ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,9 @@ set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_COMPILER g++) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +set(ENV{PKG_CONFIG_PATH} "/usr/local/lib/pkgconfig/") set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) @@ -17,4 +19,4 @@ find_package(OpenGL REQUIRED) add_executable(compositor src/main.cpp) target_include_directories(compositor PUBLIC SYSTEM ${MIRAL_INCLUDE_DIRS}) -target_link_libraries( compositor ${MIRAL_LDFLAGS}) +target_link_libraries( compositor ${MIRAL_LDFLAGS}) \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 97739fd..ed09f84 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -68,11 +68,26 @@ int main(int argc, char const* argv[]) { }; }; + Keymap config_keymap; + + auto run_startup_apps = [&](std::string const& apps) + { + for (auto i = begin(apps); i != end(apps); ) + { + auto const j = find(i, end(apps), ':'); + external_client_launcher.launch(std::vector{std::string{i, j}}); + if ((i = j) != end(apps)) ++i; + } + }; + return runner.run_with( { set_window_management_policy(), + WaylandExtensions{}, + X11Support{}, AppendEventFilter{quit_on_ctrl_alt_bksp}, + config_keymap }); return EXIT_SUCCESS; } \ No newline at end of file