Skip to content

Commit b14b655

Browse files
committed
Fixed Crash when XCB,X11,Qt grabber were configured and display manager changed to Wayland
1 parent f63322d commit b14b655

File tree

20 files changed

+263
-80
lines changed

20 files changed

+263
-80
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6464
- Fixed: Python 3.12 crashes (#1747)
6565
- osX Grabber: Use ScreenCaptureKit under macOS 15 and above
6666
- Removed maximum LED number constraint from Matrix layout schema which was not synced with the UI behaviour (#1804)
67+
- UI: Instance listings are sorted, enabled instances are high-lighted in drop-downs
6768
- Fixed bespoke WebSocket implementation by using of QWebSockets (#1816, #1448, #1247, #1130)
6869
- Fixed mDNS Browser deadlock, plus run in own thread now
6970
- Fixed that LED Buffer and Layout might get out of sync.
@@ -72,7 +73,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7273
- Fixed Last update of an effect event is not removed in sources overview
7374
- Fixed Removed stale _logger object
7475
- Fixed Smoothing (#1863)
75-
- UI: Instance listings are sorted, enabled instances are high-lighted in drop-downs
76+
- Fixed Crash when XCB,X11 was configured and display manager changed to Wayland
7677

7778
**JSON-API**
7879
- Refactored JSON-API to ensure consistent authorization behaviour across sessions and single requests with token authorization.

include/grabber/dispmanx/DispmanxFrameGrabber.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class DispmanxFrameGrabber : public Grabber
3838
///
3939
/// @return true, on success (i.e. library is present), else false
4040
///
41-
bool isAvailable() override;
41+
bool isAvailable(bool logError = true) override;
4242

4343
///
4444
/// @brief Opens the input device.

include/grabber/qt/QtGrabber.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ class QtGrabber : public Grabber
7272
///
7373
bool setupDisplay();
7474

75+
///
76+
/// @brief Determine if the grabber is available.
77+
///
78+
/// @return true, on success (i.e. Window Manager is not Wayland), else false
79+
///
80+
bool isAvailable(bool logError = true) override;
81+
7582
///
7683
/// @brief Opens the input device.
7784
///

include/grabber/qt/QtWrapper.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,18 @@ class QtWrapper: public GrabberWrapper
3838
///
3939
QtWrapper(const QJsonDocument& grabberConfig = QJsonDocument());
4040

41+
///
42+
/// @brief Determine if the grabber is available for usage on the platform
43+
///
44+
/// @return true, on success, else false
45+
///
46+
bool isAvailable() override;
47+
48+
///
49+
/// Starts the grabber, if available
50+
///
51+
bool start() override;
52+
4153
///
4254
/// Starts the grabber which produces led values with the specified update rate
4355
///

include/grabber/x11/X11Grabber.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,14 @@ class X11Grabber : public Grabber , public QAbstractNativeEventFilter
3434

3535
~X11Grabber() override;
3636

37-
bool open();
37+
///
38+
/// @brief Determine if the grabber is available.
39+
///
40+
/// @return true, on success (i.e. Window Manager is not Wayland), else false
41+
///
42+
bool isAvailable(bool logError = true) override;
3843

44+
bool open();
3945
bool setupDisplay();
4046

4147
///

include/grabber/x11/X11Wrapper.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,23 @@ class X11Wrapper: public GrabberWrapper
3838
///
3939
~X11Wrapper() override;
4040

41+
///
42+
/// @brief Determine if the grabber is available for usage on the platform
43+
///
44+
/// @return true, on success, else false
45+
///
46+
bool isAvailable() override;
47+
48+
///
49+
/// Starts the grabber, if available
50+
///
51+
bool start() override;
52+
53+
///
54+
/// Starts the grabber which produces led values with the specified update rate
55+
///
56+
bool open() override;
57+
4158
public slots:
4259
///
4360
/// Performs a single frame grab and computes the led-colors

include/grabber/xcb/XcbGrabber.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ class XcbGrabber : public Grabber, public QAbstractNativeEventFilter
2929

3030
~XcbGrabber() override;
3131

32+
///
33+
/// @brief Determine if the grabber is available.
34+
///
35+
/// @return true, on success (i.e. Window Manager is not Wayland), else false
36+
///
37+
bool isAvailable(bool logError = true) override;
38+
3239
bool open();
3340
bool setupDisplay();
3441

include/grabber/xcb/XcbWrapper.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,23 @@ class XcbWrapper: public GrabberWrapper
3737

3838
~XcbWrapper() override;
3939

40+
///
41+
/// @brief Determine if the grabber is available for usage on the platform
42+
///
43+
/// @return true, on success, else false
44+
///
45+
bool isAvailable() override;
46+
47+
///
48+
/// Starts the grabber, if available
49+
///
50+
bool start() override;
51+
52+
///
53+
/// Starts the grabber which produces led values with the specified update rate
54+
///
55+
bool open() override;
56+
4057
public slots:
4158
void action() override;
4259

include/hyperion/Grabber.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class Grabber : public QObject
118118
///
119119
/// @return true, on success (i.e. library is present), else false
120120
///
121-
virtual bool isAvailable() { return _isAvailable; }
121+
virtual bool isAvailable(bool logError = true) { return _isAvailable; }
122122

123123
public slots:
124124

include/hyperion/GrabberWrapper.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,6 @@ private slots:
168168
/// Will start and stop grabber based on active listeners count
169169
void handleSourceRequest(hyperion::Components component, int hyperionInd, bool listen);
170170

171-
///
172-
173-
174171
protected:
175172

176173
///

0 commit comments

Comments
 (0)