MythTV master
mythpainterwindow.h
Go to the documentation of this file.
1#ifndef MYTHPAINTERWINDOW_H
2#define MYTHPAINTERWINDOW_H
3
4// Qt
5#include <QTimer>
6#include <QWidget>
7
8// MythTV
9#include "libmythbase/mythconfig.h"
10#include "mythuiexp.h"
11#include "mythrender_base.h"
12
13#if CONFIG_WAYLANDEXTRAS
15#endif
16
17// Not entirely sure when this started and was fixed (if it is fixed?)
18// no issue with 5.11 - broken in 5.14.2, I'm guessing introduced with:-
19// https://github.com/qt/qtwayland/commit/88a0246a46c30e08e9730d16cf8739773447d058
20// but that was meant to be fixed in:-
21// https://github.com/qt/qtwayland/commit/7451faab740ec6294159be60d8a713f5e8070c09
22// Ringfence here to ensure the workaround does not live on forever.
23//
24// Note: There appears to be an additional, possibly related issue running Ubuntu under
25// Wayland (20.10, Qt 5.14.2) and using XCB (not Wayland directly). On startup
26// the UI is unresponsive and paint events are received roughly once per second.
27// Forcing an expose event (al-tab away and back) fixes it - otherwise it resolves
28// itself after 10-15seconds. The following define can be enabled to debug events
29// received by the window
30//#define DEBUG_PAINTERWIN_EVENTS
31
32class MythMainWindow;
33class MythPainter;
34
35class MythPainterWindow : public QWidget
36{
37 Q_OBJECT
38
39 public:
40 static MUI_PUBLIC QString GetDefaultPainter();
41 static MUI_PUBLIC QStringList GetPainters();
42 static QString CreatePainters(MythMainWindow* MainWin,
43 MythPainterWindow*& PaintWin,
44 MythPainter*& Paint);
45 static void DestroyPainters(MythPainterWindow*& PaintWin,
46 MythPainter*& Painter);
47
49 bool RenderIsShared ();
50 void resizeEvent (QResizeEvent* /*ResizeEvent*/) override;
51#if defined(DEBUG_PAINTERWIN_EVENTS)
52 bool event(QEvent* Event) override;
53#endif
54
55 protected:
56 explicit MythPainterWindow(MythMainWindow* MainWin);
57 ~MythPainterWindow() override;
58
59 MythRender* m_render { nullptr };
60
61 private:
62 Q_DISABLE_COPY(MythPainterWindow)
63
64
65#if CONFIG_WAYLANDEXTRAS
66 MythWaylandDevice* m_waylandDev { nullptr };
67#endif
68};
69
70#endif
Event details.
Definition: zmdefines.h:28
void resizeEvent(QResizeEvent *) override
static void DestroyPainters(MythPainterWindow *&PaintWin, MythPainter *&Painter)
static QString CreatePainters(MythMainWindow *MainWin, MythPainterWindow *&PaintWin, MythPainter *&Paint)
MythRender * GetRenderDevice()
MythPainterWindow(MythMainWindow *MainWin)
static MUI_PUBLIC QStringList GetPainters()
MythRender * m_render
static MUI_PUBLIC QString GetDefaultPainter()
A simple wrapper to retrieve the major Wayland objects from the Qt Wayland native interface.
#define MUI_PUBLIC
Definition: mythuiexp.h:9