Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-11-10 08:50:59 +0300
committerCampbell Barton <campbell@blender.org>2022-11-10 08:51:44 +0300
commit2a6a492a82eb4937834b8f110f0479cbe8eb2708 (patch)
tree92a3ac0fa1ed2035e95694e3f0f952a34063acef
parent4b6d58fd6d5fd3d6f8a64bb9b57dba504b9b62a6 (diff)
GHOST/Wayland: report a message when there is a fatal error
Help troubleshooting T100855.
-rw-r--r--intern/ghost/intern/GHOST_SystemWayland.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/intern/ghost/intern/GHOST_SystemWayland.cpp b/intern/ghost/intern/GHOST_SystemWayland.cpp
index 42da4a3ebbf..528aa6e1884 100644
--- a/intern/ghost/intern/GHOST_SystemWayland.cpp
+++ b/intern/ghost/intern/GHOST_SystemWayland.cpp
@@ -1157,6 +1157,18 @@ static void gwl_registry_entry_update_all(GWL_Display *display, const int interf
/** \name Private Utility Functions
* \{ */
+static void ghost_wl_display_report_error(struct wl_display *display)
+{
+ int ecode = wl_display_get_error(display);
+ GHOST_ASSERT(ecode, "Error not set!");
+ if ((ecode == EPIPE || ecode == ECONNRESET)) {
+ fprintf(stderr, "The Wayland connection broke. Did the Wayland compositor die?\n");
+ }
+ else {
+ fprintf(stderr, "The Wayland connection experienced a fatal error: %s\n", strerror(ecode));
+ }
+}
+
/**
* Callback for WAYLAND to run when there is an error.
*
@@ -5152,10 +5164,14 @@ bool GHOST_SystemWayland::processEvents(bool waitForEvent)
#endif /* WITH_INPUT_NDOF */
if (waitForEvent) {
- wl_display_dispatch(display_->wl_display);
+ if (wl_display_dispatch(display_->wl_display) == -1) {
+ ghost_wl_display_report_error(display_->wl_display);
+ }
}
else {
- wl_display_roundtrip(display_->wl_display);
+ if (wl_display_roundtrip(display_->wl_display) == -1) {
+ ghost_wl_display_report_error(display_->wl_display);
+ }
}
if (getEventManager()->getNumEvents() > 0) {