mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-24 23:31:36 +08:00
Apply a number of fixes to the main window
- Fix the size issue with list boxes on mac. Was displaying the list boxes with an improper size. Turns out it was just the wrong size policies on the frame below. - Ensure the main windows are fully displayed *before* initializing subsystems. This ensures that the graphics system will properly start up on macos, and allows the glitch fix. - Made a workaround for weird QT glitch that would happen to the parent of a pure native widget that also has internal painting fully disabled. (Should definitely write an example and report this bug on the QT forums)
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
#include <obs.hpp>
|
||||
#include <QMessageBox>
|
||||
#include <QShowEvent>
|
||||
|
||||
#include "obs-app.hpp"
|
||||
#include "window-basic-settings.hpp"
|
||||
@@ -202,10 +203,17 @@ void OBSBasic::ChannelChanged(void *data, calldata_t params)
|
||||
/* Main class functions */
|
||||
|
||||
OBSBasic::OBSBasic(QWidget *parent)
|
||||
: QMainWindow (parent),
|
||||
ui (new Ui::OBSBasic)
|
||||
: OBSMainWindow (parent),
|
||||
ui (new Ui::OBSBasic)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
void OBSBasic::OBSInit()
|
||||
{
|
||||
/* make sure it's fully displayed before doing any initialization */
|
||||
show();
|
||||
App()->processEvents();
|
||||
|
||||
if (!obs_startup())
|
||||
throw "Failed to initialize libobs";
|
||||
@@ -223,6 +231,12 @@ OBSBasic::OBSBasic(QWidget *parent)
|
||||
|
||||
/* TODO: this is a test */
|
||||
obs_load_module("test-input");
|
||||
|
||||
#ifdef _WIN32
|
||||
/* HACK: fixes a windows qt bug with native widgets with native
|
||||
* repaint */
|
||||
ui->previewContainer->repaint();
|
||||
#endif
|
||||
}
|
||||
|
||||
OBSBasic::~OBSBasic()
|
||||
|
||||
Reference in New Issue
Block a user