UI: Use Qt lib for screen info instead of x11 libs
All of the monitor discovery logic can be implemented with Qt. This change removes all the x11 implementations in favor of Qt and removes a fair amount of platform specific code.
This commit is contained in:
parent
580cfc1a95
commit
f3eb8aacfe
9 changed files with 33 additions and 156 deletions
|
|
@ -23,6 +23,7 @@
|
|||
#include <initializer_list>
|
||||
#include <sstream>
|
||||
#include <QCompleter>
|
||||
#include <QGuiApplication>
|
||||
#include <QLineEdit>
|
||||
#include <QMessageBox>
|
||||
#include <QCloseEvent>
|
||||
|
|
@ -30,6 +31,7 @@
|
|||
#include <QDirIterator>
|
||||
#include <QVariant>
|
||||
#include <QTreeView>
|
||||
#include <QScreen>
|
||||
#include <QStandardItemModel>
|
||||
#include <QSpacerItem>
|
||||
|
||||
|
|
@ -950,8 +952,6 @@ void OBSBasicSettings::LoadRendererList()
|
|||
#endif
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE(MonitorInfo);
|
||||
|
||||
static string ResString(uint32_t cx, uint32_t cy)
|
||||
{
|
||||
stringstream res;
|
||||
|
|
@ -1097,14 +1097,12 @@ void OBSBasicSettings::LoadResolutionLists()
|
|||
uint32_t cy = config_get_uint(main->Config(), "Video", "BaseCY");
|
||||
uint32_t out_cx = config_get_uint(main->Config(), "Video", "OutputCX");
|
||||
uint32_t out_cy = config_get_uint(main->Config(), "Video", "OutputCY");
|
||||
vector<MonitorInfo> monitors;
|
||||
|
||||
ui->baseResolution->clear();
|
||||
|
||||
GetMonitors(monitors);
|
||||
|
||||
for (MonitorInfo &monitor : monitors) {
|
||||
string res = ResString(monitor.cx, monitor.cy);
|
||||
for (QScreen* screen: QGuiApplication::screens()) {
|
||||
QSize as = screen->availableSize();
|
||||
string res = ResString(as.width(), as.height());
|
||||
ui->baseResolution->addItem(res.c_str());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue