Compare commits

..

3 Commits

Author SHA1 Message Date
Petr Mrázek
d746deb35a WIP use EnumDisplayDevicesW to list devices and monitors, maybe 2019-07-13 23:32:49 +02:00
Petr Mrázek
62e1bf327d Merge pull request #2740 from jturnism/patch-1
Update changelog.md
2019-07-12 08:19:20 +02:00
Joseph Turner
280e0e6e36 Update changelog.md
Just installing "qt5-qtbase" on Fedora 30 does not allow MultiMC to run. It still needs "libQt5Widgets.so.5" and by running "dnf whatprovides" it tells me "qt5-qtbase-gui" provides that file and also pulls in "qt5-qtbase" as a dependency if not already installed. I am assuming this is the same situation for CentOS/RHEL
2019-07-11 21:00:55 -05:00
2 changed files with 56 additions and 2 deletions

View File

@@ -89,6 +89,56 @@ void runGlxinfo(QStringList & log)
} }
#endif #endif
#ifdef Q_OS_WIN32
#include <windows.h>
namespace {
void printDisplayFlags(QStringList & log, const DWORD flags, const char * spacing)
{
QStringList flagStrings;
if(flags & DISPLAY_DEVICE_ACTIVE)
{
flags << "Active";
}
if(flags & DISPLAY_DEVICE_PRIMARY_DEVICE)
{
flags << "Primary";
}
if(flags & DISPLAY_DEVICE_MIRRORING_DRIVER)
{
flags << "Mirroring";
}
if(flagStrings.size())
{
log << QString("%1%2").arg(spacing, flagStrings.join(','));
}
}
void probeWinAPIForDevices(QStringList & log)
{
DISPLAY_DEVICEW dd;
memset(&dd, 0, sizeof(DISPLAY_DEVICEW));
int i = 0;
// enumerate devices
while(EnumDisplayDevicesW(NULL, i, &dd, 0))
{
log << "Display devices:";
log << QString("Device Name: %1 | Device String: %2").arg(QString::fromWCharArray(dd.DeviceName), QString::fromWCharArray(dd.DeviceString));
printDisplayFlags(log, dd.StateFlags, " ");
// enumerate monitors
if(EnumDisplayDevicesW(dd.DeviceName, 0, &dd, 0))
{
log << QString(" Monitor Name: %1 | Monitor String: %2").arg(QString::fromWCharArray(dd.DeviceName), QString::fromWCharArray(dd.DeviceString));
printDisplayFlags(log, dd.StateFlags, " ");
}
i++;
}
}
}
#endif
void PrintInstanceInfo::executeTask() void PrintInstanceInfo::executeTask()
{ {
auto instance = m_parent->instance(); auto instance = m_parent->instance();
@@ -100,6 +150,10 @@ void PrintInstanceInfo::executeTask()
::runGlxinfo(log); ::runGlxinfo(log);
#endif #endif
#ifdef Q_OS_WIN32
::probeWinAPIForDevices(log);
#endif
logLines(log, MessageLevel::MultiMC); logLines(log, MessageLevel::MultiMC);
logLines(instance->verboseDescription(m_session), MessageLevel::MultiMC); logLines(instance->verboseDescription(m_session), MessageLevel::MultiMC);
emitSucceeded(); emitSucceeded();

View File

@@ -12,7 +12,7 @@ Make sure you have the following packages before you update:
- Arch: `qt5-base` - Arch: `qt5-base`
- Debian/Ubuntu: `qt5-default` - Debian/Ubuntu: `qt5-default`
- CentOS/RHEL: `qt5-qtbase` - CentOS/RHEL/Fedora: `qt5-qtbase-gui`
- Suse: `libqt5-qtbase` - Suse: `libqt5-qtbase`
MultiMC on linux is built with Qt 5.4 and older versions of Qt will not work. MultiMC on linux is built with Qt 5.4 and older versions of Qt will not work.
@@ -1170,4 +1170,4 @@ Long time coming, this release brought a lot of incremental improvements and fix
- Added additional information to the about dialog. - Added additional information to the about dialog.
## MultiMC 0.0 ## MultiMC 0.0
- Initial release. - Initial release.