Dark grey/black semi-transparent rectangle covers Gnome Terminal (bug in Enhanced Tiling?)
The bug I'm experiencing is that my (one almighty many-tabbed to multiple screen
sessions in other places) Gnome Terminal started acquiring a dark semi-transparent rectangle over it.
I'm using Ubuntu 24.04.2 LTS (noble), and have been using LTS Ubuntu flavours for a long time. The switch from X11 to Wayland didn't trouble me much and I've only just had reason to go delving into the mechanics...
When the bug has triggered, the terminal window has been maximised to full screen, either on the laptop or the external monitor. Also the screensaver has been on, and the bug presents when I unlock. The dark rectangle completely covers the whole of the affected screen.
- Sometimes it's mostly transparent, so the window looks greyed out or like there is a colour scheme problem.
- I spent a long time trying to adjust the external (native HDMI port) monitor. Then I realised the browser window had normal contrast.
- I spent a while adjusting Terminal colour schemes. Then I opened another Terminal window and it was unaffected.
- The window can still be dragged around, menus opened from it (they are not affected), and terminal interaction is normal except for visibility.
- Tabs detached from the affected window are "cleaned" of the Dreaded Rectangle of Obscurity. It's just a shame I can't insert them into a clean window.
- Moving and resizing the affected window shows the black rectangle to keep its size and be anchored about (64,64)px outside the top left of the window.
- After looking for an equivalent of
xprops
to examine this thing, I found the recipe- Open the Run dialog, usually Alt+F2
- Enter
lg <enter>
to invoke the Looking Glass. It seems to be not an executable one can call any other way - I have not read its fine manual. - You're now in an object browser console and can issue it some dialect of JavaScript. Poke around until you understand it, or something breaks properly!
- Credit to https://web.archive.org/web/20180402235234/https://fedoraproject.org/wiki/How_to_debug_Wayland_problems via Brian Redbeard's U.SE answer.
- Use the crosshair to pick an object. It will appear in the
r(n)
output results, and methods can be invoked by callingr
to reach the old results. - Use the
.get_children
and.get_parent
methods to navigate the tree. The most recentr(n+1)
result will get an orange highlight to help you.
- I discovered my window had two of these rectangles on it, possibly from multiple invocations of the same bug.
- I called
.set_height(n)
,.set_width(n)
and.set_opactity(n)
on the objects become sure that what I was looking at is the Dreaded Rectangle of Obscurity.
Now I know what these things are, but not how they arrived.
I suspect the "Enhanced Tiling" / "Tiling Popup" may be implicated, as I triggered that a few times before understanding what it is and how to use it.
I suspect the lockscreen is implicated, as I have never seen a Rectangle of Obscurity appear while I was watching.
I haven't figure out what triggers reduced opacity, or looked for a reliable recipe to discover how many rectangles are attached to my window.
I've found other old bug reports of "black rectangle around" but they seem to be some framing error. This looks like the Tiling "grey out the window just placed, while you pick another window for the other tile" got left in place.
Other than waiting for it to recur and poking it again... can you recommend a better debugging approach? A way to load my own code into the lg
inspector, or probe it from another interface? Anything to better visualise the stack or surfaces and understand what each of them is doing?
ETA: screenshot, after poking it with lg
.
Update
I see the similar-enough warning perhaps it's a driver issue. What have I done recently? Connected a different (larger/modern/widescreen) monitor, and possibly upgraded some packages.
The bug struck again, this time on a window which was not maximised.
Navigating Wayland object structure
lg
gives among other tools
- point-and-click access by the
inspect(x,y)
function and the cross-hair icon, yielding the topClutterActor
object for this bug - window browser access, yielding a comprehensible list of windows and their applications, from which you can bring your affected window into the evaluator
- I used
W = [ r(211), r(210) ]
for my two Terminal windows, so I can reach them more easily withW[0]
etc. - The Rectangles of Obscurity are among
C = W[1].get_compositor_private().get_children()
and this time I have a pile of ten of them, gathered overnight
- I used
- the only copy-paste I found is from the evaluator textbox, so getting information out of this thing is currently tedious
- the long history of
r(n)
is persistent, so you can pop in and out oflg
to gather stuff
An unaffected window has C
containing one MetaSurfaceContainerActorWayland
.
The covered window has C
containing the MetaSurfaceContainerActorWayland
followed by the ClutterActor
s. Calling C[n].set_width(50*n)
and C[n].set_opacity(50)
gives a pretty grading of grey across the window, demonstrating that I have the offending objects.
Viewing a collection of info on the array can be done with something like
II = function(a){ return [a, a.get_opacity(), a.get_width(), a.get_flags() ] }
W[1].get_compositor_private().get_children().map(II)
Update - timing and removal
They seem to accrete on the targeted window at a rate of about ten per overnight screensaver lock, or sometimes one or two for an hour or so locked. My impression is it's not a regular timing.
Simplest fix once you have the targeted window in a variable is
W[1].get_compositor_private().get_children()[1].destroy()
0 comment threads