OBS Dock Plugin not Saving Position

danielscg

New Member
I have been working on a plugin for OBS. OBS-Teams-Bridge. When I open OBS for the first time I always have to select the plugin from the top menu ‘Docks’ > ‘OBS-Teams-Bridge’. Then dock the window somewhere on the screen.

Is there away to make it so that the plugin always is on the same space in the window layout even after a restart. I have tried using ‘Docks’ > ‘Lock Docks’ but I still have to open the plugin window each time after restarting.

I have heard that docked plugins are supposed to stay where they are after a restart so maybe there is something wrong in the code. I am picking this project up of someone who has left is there a standard area where positions are saved in plugins someone could direct me to?

This is my plugin-main.cpp code:


#include <obs-module.h>
#include <plugin-support.h>
//frontend includes
#include "formwidget.h"
#include "obs-frontend-api.h"
#include "obs-module.h"
#include <QWebSocket>
#include "AzureWebSocket/azurewebsocket.h"
OBS_DECLARE_MODULE()
OBS_MODULE_USE_DEFAULT_LOCALE(PLUGIN_NAME, "en-US")
/**
* @brief function that loads the module
*
* @return true
* @return false on error
*/
FormWidget *formWidget;
bool obs_module_load(void)
{
obs_frontend_push_ui_translation(obs_module_get_string);
QWidget* mainWindow = (QWidget*)obs_frontend_get_main_window();
formWidget = new FormWidget(mainWindow);
obs_frontend_pop_ui_translation();
obs_frontend_add_dock(formWidget);

obs_log(LOG_INFO, "plugin loaded successfully (version %s)",
PLUGIN_VERSION);
return true;
}
/**
* @brief function called after obs finished loading
*
*/
void obs_module_post_load(void)
{
}
void obs_module_unload(void)
{
obs_log(LOG_INFO, "plugin unloaded");
}

1710509056614.png
 
Top