wayscriber icon indicating copy to clipboard operation
wayscriber copied to clipboard

Getting a blank area top where toolbar was on Mangowm screen shots

Open xircon opened this issue 1 month ago • 9 comments

Image

Have I clicked on a setting in error?

also affects selection;

Image

xircon avatar Oct 18 '26 15:10 xircon

Thanks for the report and the screenshots. I found the most likely cause. Pull request #418 fixes it.

Try the fix from main

To use the fix, run these commands in the source checkout from your last build:

cd wayscriber
git pull
./tools/install.sh --replace-other   # builds, installs to /usr/bin, removes the /usr/local copy
systemctl --user restart wayscriber.service   # or stop your daemon and run /usr/bin/wayscriber --daemon

Make sure that the daemon uses the new build:

readlink -f /proc/$(systemctl --user show -p MainPID --value wayscriber.service)/exe
git rev-parse --short HEAD

The first command must show /usr/bin/wayscriber. The second command shows the commit of your build.

Wait for the release

If you prefer to wait for the release, use the built-in toolbar until then:

[ui.toolbar]
backend = "builtin"

Test

Please take a full-screen screenshot and a region screenshot with the GTK toolbar.

If the rectangle is still there, send me this information:

  • The commit of your build
  • Whether you have a ~/.config/gtk-4.0/gtk.css file
  • Whether you use a custom GTK theme.

Cause and fix

Cause: During a screenshot, the GTK toolbar makes its window transparent. GTK gives user stylesheets a higher priority than the styles of the app. A theme often installs a user stylesheet at ~/.config/gtk-4.0/gtk.css. If this stylesheet set a window background, GTK painted it on the toolbar window during the screenshot. As a result, the screenshot showed a solid rectangle with the size of the toolbar. I got the same rectangle with the 0.9.27 release on MangoWM and a user stylesheet.

Fix: During a screenshot, wayscriber applies its own styles above the user stylesheets. These styles make the toolbar window, its open popovers, and its tooltips transparent. After the screenshot, wayscriber removes these styles. Then your normal styles return. The fix does not need a configuration change.

Side effect: Toolbar popovers always use the wayscriber shadow. A user stylesheet cannot change this shadow, because a different shadow size can cancel the screenshot.

devmobasa avatar Oct 18 '26 22:10 devmobasa

readlink -f /proc/$(systemctl --user show -p MainPID --value wayscriber.service)/exe       
/usr/bin/wayscriber

 git rev-parse --short HEAD                                                            
0d855869
Image

and yes, I have a huge gtk.css - no idea where it came from - going to reboot, BRB.

OK - removed the gtk.css file and all seems OK:

Image

I have no idea what hijacked my gtk.css file!!!

xircon avatar Oct 18 '26 22:10 xircon

Thanks for the test. Your build is from commit 0d855869. That is the 0.9.27 release, without the fix. I merged the fix (ce68c7d8) a few minutes after your git pull. As a result, your screenshot still shows the same #23252e rectangle.

Please pull again and install the new build:

cd ~/git/wayscriber
git pull
./tools/install.sh --replace-other
systemctl --user restart wayscriber.service

Make sure that git rev-parse --short HEAD shows ce68c7d8 or a later commit.

You can keep your gtk.css for this test. It is the most likely cause of the rectangle, so it shows if the fix works. A reboot is not necessary. A restart of the service is sufficient.

devmobasa avatar Oct 18 '26 23:10 devmobasa

lrwxrwxrwx x x  69 B  2026-10-08 21:18 --  gtk.css-old3 ⇒ /home/xircon/.themes/Flat-Remix-GTK-Violet-Dark-Solid/gtk-4.0/gtk.css

It was a theme that hijacked it. Rebuilding now.

ce68c7d8
Image

xircon avatar Oct 18 '26 23:10 xircon

Can close - all appears OK, night and thanks for the help!!

xircon avatar Oct 18 '26 23:10 xircon

Thanks for reporting. Have a good one.

If you feel like testing the fix:

Put the theme link back and restart the daemon:

mv ~/.config/gtk-4.0/gtk.css-old3 ~/.config/gtk-4.0/gtk.css
systemctl --user restart wayscriber.service

Then take a full-screen screenshot and a region screenshot. With the fix (ce68c7d8), the rectangle must not show. After the test, you can keep the theme or remove the link again.

devmobasa avatar Oct 18 '26 23:10 devmobasa

Image

xircon avatar Oct 18 '26 23:10 xircon

All good - thinking back, was helping someone configure labwc on the endeavourOS forum and tested a few themes, that is probably the cause - mango does not really "use" themes.

xircon avatar Oct 18 '26 23:10 xircon

I see.

Thanks for testing with the theme back in place.

devmobasa avatar Oct 18 '26 23:10 devmobasa