From 8aee59f421c84dd621ae33722bd84aaa7248646f Mon Sep 17 00:00:00 2001 From: Helge Norberg Date: Fri, 21 Aug 2015 15:21:07 +0200 Subject: [PATCH] Merged borderless screen consumer support from 2.0 --- modules/screen/consumer/screen_consumer.cpp | 13 ++++++++++++- shell/casparcg.config | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/screen/consumer/screen_consumer.cpp b/modules/screen/consumer/screen_consumer.cpp index 4d6887164..c57cb6b39 100644 --- a/modules/screen/consumer/screen_consumer.cpp +++ b/modules/screen/consumer/screen_consumer.cpp @@ -106,6 +106,7 @@ struct configuration aspect_ratio aspect = aspect_ratio::aspect_invalid; bool vsync = true; bool interactive = true; + bool borderless = false; }; struct screen_consumer : boost::noncopyable @@ -228,7 +229,12 @@ public: void init() { - window_.create(sf::VideoMode(screen_width_, screen_height_, 32), u8(L"Screen consumer " + channel_and_format()), config_.windowed ? sf::Style::Resize | sf::Style::Close : sf::Style::Fullscreen); + auto window_style = config_.borderless + ? sf::Style::None + : (config_.windowed + ? sf::Style::Resize | sf::Style::Close + : sf::Style::Fullscreen); + window_.create(sf::VideoMode(screen_width_, screen_height_, 32), u8(L"Screen consumer " + channel_and_format()), window_style); window_.setMouseCursorVisible(config_.interactive); window_.setPosition(sf::Vector2i(screen_x_, screen_y_)); window_.setSize(sf::Vector2u(screen_width_, screen_height_)); @@ -667,6 +673,7 @@ void describe_consumer(core::help_sink& sink, const core::help_repository& repo) L"SCREEN " L"{[screen_index:int]|1} " L"{[fullscreen:FULLSCREEN]} " + L"{[borderless:BORDERLESS]} " L"{[key_only:KEY_ONLY]} " L"{[non_interactive:NON_INTERACTIVE]} " L"{[no_auto_deinterlace:NO_AUTO_DEINTERLACE]} " @@ -675,6 +682,7 @@ void describe_consumer(core::help_sink& sink, const core::help_repository& repo) sink.definitions() ->item(L"screen_index", L"Determines which screen the channel should be displayed on. Defaults to 1.") ->item(L"fullscreen", L"If specified opens the window in fullscreen.") + ->item(L"borderless", L"Makes the window appear without any window decorations.") ->item(L"key_only", L"Only displays the alpha channel of the video channel if specified.") ->item(L"non_interactive", L"If specified does not send mouse input to producers on the video channel.") ->item(L"no_auto_deinterlace", L"If the video mode of the channel is an interlaced mode, specifying this will turn of deinterlacing.") @@ -683,6 +691,7 @@ void describe_consumer(core::help_sink& sink, const core::help_repository& repo) sink.example(L">> ADD 1 SCREEN", L"opens a screen consumer on the default screen."); sink.example(L">> ADD 1 SCREEN 2", L"opens a screen consumer on the screen 2."); sink.example(L">> ADD 1 SCREEN 1 FULLSCREEN", L"opens a screen consumer in fullscreen on screen 1."); + sink.example(L">> ADD 1 SCREEN 1 BORDERLESS", L"opens a screen consumer without borders/window decorations on screen 1."); } spl::shared_ptr create_consumer(const std::vector& params, core::interaction_sink* sink) @@ -699,6 +708,7 @@ spl::shared_ptr create_consumer(const std::vector create_preconfigured_consumer(const boost: config.auto_deinterlace = ptree.get(L"auto-deinterlace", config.auto_deinterlace); config.vsync = ptree.get(L"vsync", config.vsync); config.interactive = ptree.get(L"interactive", config.interactive); + config.borderless = ptree.get(L"borderless", config.borderless); auto stretch_str = ptree.get(L"stretch", L"default"); if(stretch_str == L"uniform") diff --git a/shell/casparcg.config b/shell/casparcg.config index 82a549333..5c1c4096c 100644 --- a/shell/casparcg.config +++ b/shell/casparcg.config @@ -90,6 +90,7 @@ true [true|false] false [true|false] true [true|false] + false [true|false] -- 2.39.2