From bfadff61d2554b153d973b3cf150420ca60a4143 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 2 Nov 2024 11:56:01 +0100 Subject: Force window always on top, even if restacking order changes --- include/Overlay.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/Overlay.hpp b/include/Overlay.hpp index a138d07..eafb4ab 100644 --- a/include/Overlay.hpp +++ b/include/Overlay.hpp @@ -7,11 +7,12 @@ #include "window_texture.h" #include +#include #include #include #include #include -#include +#include namespace gsr { class DropdownButton; @@ -32,7 +33,7 @@ namespace gsr { class Overlay { public: - Overlay(std::string resources_path, GsrInfo gsr_info, egl_functions egl_funcs, mgl::Color bg_color); + Overlay(std::string resources_path, GsrInfo gsr_info, egl_functions egl_funcs); Overlay(const Overlay&) = delete; Overlay& operator=(const Overlay&) = delete; ~Overlay(); @@ -75,6 +76,8 @@ namespace gsr { void on_press_start_record(); void on_press_start_stream(); bool update_compositor_texture(const mgl_monitor *monitor); + + void force_window_on_top(); private: using KeyBindingCallback = std::function; struct KeyBinding { @@ -87,7 +90,6 @@ namespace gsr { std::string resources_path; GsrInfo gsr_info; egl_functions egl_funcs; - mgl::Color bg_color; std::vector audio_devices; mgl::Texture window_texture_texture; mgl::Sprite window_texture_sprite; @@ -109,6 +111,7 @@ namespace gsr { DropdownButton *replay_dropdown_button_ptr = nullptr; DropdownButton *record_dropdown_button_ptr = nullptr; DropdownButton *stream_dropdown_button_ptr = nullptr; + mgl::Clock force_window_on_top_clock; RecordingStatus recording_status = RecordingStatus::NONE; bool paused = false; -- cgit v1.2.3