-
-
Notifications
You must be signed in to change notification settings - Fork 198
Window captures include non-transparent border of background on Gnome #460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Is there any way to fix this via a workaround please? |
Is this Wayland or X11? I don't think that there is a workaround. We take this kind of screenshot by asking the DE what the active window is and what the dimensions of the active window are. The DE provides basically Position, Width and Height of the active window. We don't know what part of those belongs to the window and what is just shadow for example. Then we take a screenshot of that provided region. We could have a look if there is a way to explicitly ask for only the window without shadow. If we cannot ask something like this via the X11 interface, then there is probably not much we can do. |
Ubuntu Mate 20.04-1 |
Thank you Fromn
How about having a look at the default capture source code for Ubuntu and matching the capture approach? |
Gnome is the DE, it doesn't have to relay on X11, it probably knows the stuff itself. I known for example that Spectacle under KDE Plasma doesn't speak directly to X11 or Wayland but rather to the kWin Desktop Manager and it provides all the stuff required for the screenshots, even the screenshots itself. We can't do that. |
Been looking into this issue and might be problematic to resolve it in a generic way, X11 seems to be unaware of this region so it's not possible for us to detect what that border is and what the actual window . What we could do here is for Gnome always reduce the rect for that size (seems to be a fixed size), you would get in that case only the window without the region around it. Problematic is that Mate has same border thickness around the window, Gnome on the other hand has a lot smaller border at the top but anyhow, we could detect if Gnome or Mate and cut appropriately. |
I think I have found a way how to get the width of this region, calling Problem will be probably the snap because we need to invoke another application here. @LyzardKing can we just add |
I believe I have found a workaround, it's a bit ugly, using an output from an external program, xprop to find out how much we should crop. My test on Ubuntu 20.10 worked and the window had no border anymore. @LyzardKing I have added xprop to the snap file, I hope it's not breaking anything: b94a972 |
Yes, sorry but I just read this today. EDIT: should we add it to the flatpak as well? |
Does flatpak has this limitation that it needs to allow applications that are used, like we had it for snap (curl and ftp so far)? Would be nice if someone could test the snap with Gnome and eventually the flatpak. |
Yes, the flatpak either needs to set explicit access to a binatry on the host system or to add the binary in the package. |
I have made the change already in the code and the snap package, would be nice if you could give it a try. To trigger it you just have to take a screenshot of an active window on Gnome. |
It takes a screenshot of something that is under the ksnip window... not of the currently active window.. |
You have clicked into the active window? Have you tried a small delay, like 1sec? |
Ok.. I need to set the delay, otherwise it doesn't work. But I still get the border |
The snap in the edge channel isn't updated yet... |
Yes, it's probably to fast, it takes the active window rect at the moment you trigger the screenshot and that is ksnip. |
yes, I imagined as such. Shouldn't there be a 1s delay by default? |
the package is not xprop but x11-utils |
I'm testing now... I'll open a PR with the necessary changes |
Of course, you can't get just that simple application you have to get the whole util package... |
yes, from before the change I think.. especially since it would have failed with the current change |
I opened a PR but that was the only change necessary |
I need to merge it into the 1.8.1 branch, will do it tonight. Thanks for providing the PR. |
I have ksnip 1.8.1 (installed via snap, on Ubuntu 20.04.2), yet I still see the borders around active window screenshots. Do I need any additional setup to fix this ? |
Windows captures include an annoying, non-uniform and non-transparent border of background contents:
(Example screenshot showing ~2 pixel border on top, 10-15 pixel border on right, left, bottom. Capture was done using keyboard shortcut for "Capture active window")
Window captures should capture windows only, nothing around it. Trying to crop it manually often fails with +/- 1 pixel so it is hard to handle.
Please fix this. OS is Ubuntu 20.04.1 LTS, installed via snap, version is 1.7.2.
The text was updated successfully, but these errors were encountered: