Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QOpenGLWidget displays black screen #281

Open
FrankZNL opened this issue Jul 26, 2024 · 5 comments
Open

QOpenGLWidget displays black screen #281

FrankZNL opened this issue Jul 26, 2024 · 5 comments

Comments

@FrankZNL
Copy link

20240726185537 1. Under Windows system, the opencascade version is 7.7, use a laptop to connect the external screen, and set the external screen as the main screen 2. Turn off the external screen or unplug the HDMI cable; 3. The software automatically switches to the laptop and the software displays black screen
@HuguesDelorme
Copy link
Member

Can you please post what's reported by Help->System Information... dialog?
Use the Copy to Clipboard button

Seems like a minor bug to me, what's the behavior if you set back the main screen to laptop with Windows(instead of unplugging HDMI cable)?

@FrankZNL
Copy link
Author

Thank you!
20240726194139
If I use win+P to set it to the main screen to laptop only, a black screen will also appear.

Looking forward to your reply!

@FrankZNL
Copy link
Author

I captured the event using QAbstractNativeEventFilter, but I haven’t found a suitable way to reconnect the context later. Thanks!
bool nativeEventFilter(const QByteArray& event_type, void* message, long* result)
{
#ifdef Q_OS_WIN
if (event_type == "windows_generic_MSG")
{
MSG* msg = reinterpret_cast<MSG*>(message);
if (msg->message == WM_DISPLAYCHANGE)
{
QMetaObject::invokeMethod(this, "SlotDisplayChanged", Qt::QueuedConnection);
}
}
#endif
}

@FrankZNL
Copy link
Author

I fixed the issue by recreating a new Aspect_NeutralWindow(). Thanks!

@HuguesDelorme
Copy link
Member

HuguesDelorme commented Jul 29, 2024

That's good news you could fix this issue. Can you share your changes with a pull request to Mayo project?
Maybe this will be helpful to the users, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants