3 #include <QGuiApplication>
22 #ifdef USING_WAYLANDEXTRAS
26 #define MYTH_PAINTER_QT QString("Qt")
61 QVector<TryPainter> painterstotry;
68 if (glwindow && glwindow->IsValid())
70 PaintWindow = glwindow;
80 painterstotry.prepend(TryOpenGL);
82 painterstotry.append(TryOpenGL);
90 if (vulkan && vulkan->IsValid())
102 painterstotry.prepend(TryVulkan);
104 painterstotry.append(TryVulkan);
111 LOG(VB_GENERAL, LOG_INFO,
"Using the Qt painter. Video playback will not work!");
121 painterstotry.prepend(TryQt);
123 painterstotry.append(TryQt);
125 for (
auto & trypainter : painterstotry)
126 if (trypainter(MainWin, PaintWin, Paint, warn))
129 return warn ? tr(
"Warning: No GPU acceleration") : QString();
143 #ifdef USING_WAYLANDEXTRAS
144 if (QGuiApplication::platformName().toLower().contains(
"wayland"))
152 #ifdef USING_WAYLAND_EXPOSE_HACK
153 delete m_exposureCheckTimer;
155 #ifdef USING_WAYLANDEXTRAS
170 #if defined(DEBUG_PAINTERWIN_EVENTS)
171 bool MythPainterWindow::event(QEvent *
Event)
174 return QWidget::event(
Event);
180 #ifdef USING_WAYLANDEXTRAS
182 m_waylandDev->SetOpaqueRegion(rect());
185 #ifdef USING_WAYLAND_EXPOSE_HACK
186 if (!m_exposureCheckTimer && (QGuiApplication::platformName().toLower().contains(
"wayland")))
188 m_exposureCheckTimer =
new QTimer();
189 connect(m_exposureCheckTimer, &
QTimer::timeout,
this, &MythPainterWindow::CheckWindowIsExposed);
190 m_exposureCheckTimer->start(100ms);
194 void MythPainterWindow::CheckWindowIsExposed()
196 if (
auto handle = windowHandle(); handle && handle->isVisible())
198 if (handle->isExposed())
201 LOG(VB_GENERAL, LOG_INFO,
"Stopping exposure check timer");
202 m_exposureCheckTimer->stop();
206 LOG(VB_GENERAL, LOG_INFO,
"Trying to force window exposure");