UI: Make OBSQTDisplay::CreateDisplay() public and allow forcing creation
This will be used by a new event filter, added only when running as a Wayland client, to force creating the obs_display instance even when not exposed.
This commit is contained in:
parent
b629265e7f
commit
226cc22669
@ -87,9 +87,12 @@ void OBSQTDisplay::UpdateDisplayBackgroundColor()
|
||||
obs_display_set_background_color(display, backgroundColor);
|
||||
}
|
||||
|
||||
void OBSQTDisplay::CreateDisplay()
|
||||
void OBSQTDisplay::CreateDisplay(bool force)
|
||||
{
|
||||
if (display || !windowHandle()->isExposed())
|
||||
if (display)
|
||||
return;
|
||||
|
||||
if (!windowHandle()->isExposed() && !force)
|
||||
return;
|
||||
|
||||
QSize size = GetPixelSize(this);
|
||||
|
@ -13,8 +13,6 @@ class OBSQTDisplay : public QWidget {
|
||||
|
||||
OBSDisplay display;
|
||||
|
||||
void CreateDisplay();
|
||||
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
|
||||
@ -36,4 +34,5 @@ public:
|
||||
QColor GetDisplayBackgroundColor() const;
|
||||
void SetDisplayBackgroundColor(const QColor &color);
|
||||
void UpdateDisplayBackgroundColor();
|
||||
void CreateDisplay(bool force = false);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user