mayo icon indicating copy to clipboard operation
mayo copied to clipboard

QOpenGLWidget displays black screen

Open FrankZNL opened this issue 1 year ago • 6 comments

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

FrankZNL avatar Jul 26 '24 11:07 FrankZNL

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)?

HuguesDelorme avatar Jul 26 '24 11:07 HuguesDelorme

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 avatar Jul 26 '24 11:07 FrankZNL

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 avatar Jul 26 '24 12:07 FrankZNL

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

FrankZNL avatar Jul 29 '24 02:07 FrankZNL

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!

HuguesDelorme avatar Jul 29 '24 07:07 HuguesDelorme

Have the same problem. On Friday I used Mayo to show a file. Then left the PC. Now I came back and the screen is black.

It seems only a temporary problem. I could open other files that works flawless beside this file and if I close it and reopen it also appear correct again. I assume that either standby mode or another influence has caused the problem.

Mannshoch avatar Jan 27 '25 07:01 Mannshoch