iamscottxu / obs-rtspserver

RTSP server plugin for obs-studio

Home Page:https://obsproject.com/forum/resources/obs-rtspserver.1037/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OBS Studio not hiding in system tray after installing obs-rtspserver v.1.0.1 and later

Seamas73 opened this issue · comments

After I've installed obs-rtspserver v.1.0.1 I couldn't hide OBS Studio in Windows 10 system tray by clicking on system-tray OBS icon or by right click on icon and choosing "hide" item of the context menu. When I click on icon I just turn off the preview mode In OBS Studio. In v.1.1.0 I found the same bug.
This bug I observed also when I used StreamFX plugin v.0.9.0. This bug was fixed by Xaymar in later releases https://github.com/obsproject/obs-studio/issues/3518
Another plugin, which breaked "hide" option in my obs-studio, is obs-ndi v.4.9.0 and below. I had to delete it to use "hide" option.

Reason

//obs-studio/UI/window-basic-main.cpp
void OBSBasic::ToggleShowHide()
{
	bool showing = isVisible();
	if (showing) {
		/* check for modal dialogs */
		EnumDialogs();
		if (!modalDialogs.isEmpty() || !visMsgBoxes.isEmpty())
			return;
	}
	SetShowing(!showing);
}

The value of modalDialogs.isEmpty() remains false after the RTSP server's dialog is closed. Because this dialog is still a modal dialog after it is closed.

Solution

//obs-rtspserver/rtsp_main.cpp
obs_frontend_push_ui_translation(obs_module_get_string);
rtspProperties = new RtspProperties(mainWindow);
//rtspProperties->setModal(true); //remove
obs_frontend_pop_ui_translation();

auto menu_cb = [] {
		rtspProperties->exec(); //rtspProperties->setModal(true);
};