mate-screenshot: Prefer X11 backend in X11 sessions #405
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.37) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 217 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.322
Real PR Conversation Timeline
1 comments
"Review active on #405"
general
weight: 0.35
lukefromdc
Summary
Fix a segmentation fault in
mate-screenshotwhen a nested Wayland compositor (such as Cage) is running inside an X11 desktop session.Problem
When Cage runs as a nested Wayland compositor under MATE/X11, GTK may select the Wayland backend instead of the host X11 backend.
mate-screenshotsubsequently calls X11-specific functions, includinggdk_x11_display_grab(), which leads to a segmentation fault insideXGrabServer().This occurs even when the Cage window is not focused and prevents the Print Screen shortcut from working.
Solution
When the session type is X11 and
DISPLAYis available, explicitly restrict GTK to the X11 backend usinggdk_set_allowed_backends("x11").The change:
GDK_BACKEND.Steps to reproduce
1. Log into a MATE/X11 session.
2. Start Cage as a nested compositor:
3. Run
mate-screenshotfrom another terminal.Before: Segmentation fault in
XGrabServer().After: Screenshot capture works normally.
Testing
Tested on Linux Mint with MATE/X11.
GDK_BACKEND=x11 mate-screenshotavoids the crash.GDK_BACKEND.git diff --checkpassed.The local build used MATE Desktop 1.26.2 compatibility overrides and the source tree's GSettings schema. Testing against the upstream-supported MATE Desktop version remains to be done.