Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requests: Add CloseMainWindow #1138

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/requesthandler/RequestHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ const std::unordered_map<std::string, RequestMethodHandler> RequestHandler::_han
{"TriggerMediaInputAction", &RequestHandler::TriggerMediaInputAction},

// Ui
{"CloseMainWindow", &RequestHandler::CloseMainWindow},
{"GetStudioModeEnabled", &RequestHandler::GetStudioModeEnabled},
{"SetStudioModeEnabled", &RequestHandler::SetStudioModeEnabled},
{"OpenInputPropertiesDialog", &RequestHandler::OpenInputPropertiesDialog},
Expand Down
1 change: 1 addition & 0 deletions src/requesthandler/RequestHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ class RequestHandler {
RequestResult TriggerMediaInputAction(const Request &);

// Ui
RequestResult CloseMainWindow(const Request &);
RequestResult GetStudioModeEnabled(const Request &);
RequestResult SetStudioModeEnabled(const Request &);
RequestResult OpenInputPropertiesDialog(const Request &);
Expand Down
16 changes: 16 additions & 0 deletions src/requesthandler/RequestHandler_Ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@ with this program. If not, see <https://www.gnu.org/licenses/>

#include "RequestHandler.h"

/**
* Closes the main window.
*
* @requestType CloseMainWindow
* @complexity 1
* @rpcVersion -1
* @initialVersion 5.0.0
* @category ui
* @api requests
*/
RequestResult RequestHandler::CloseMainWindow(const Request &)
{
obs_frontend_close_main_window();
return RequestResult::Success();
}

/**
* Gets whether studio is enabled.
*
Expand Down