orhun / menyoki

Screen{shot,cast} and perform ImageOps on the command line 🌱 🏞️
https://menyoki.cli.rs
GNU General Public License v3.0
605 stars 13 forks source link

Doesn't capture window decorations #14

Open kattjevfel opened 3 years ago

kattjevfel commented 3 years ago

Describe the bug When trying to select a window with either capture or record, it will only select the area excluding the top border, and if I had any on the sides I'd assume those would be missing too.

To Reproduce Steps to reproduce the behavior:

  1. Run menyoki capture
  2. Select a window
  3. See marked area excludes the window decorations

Expected behavior The entire window to be captured

Screenshots/Logs The top part of the window is cut off: 2020-12-16_01-30-21

System Information

orhun commented 3 years ago

Hey!

As far as I know, window decorations are generally a part of the parent window (although it depends on the compositor). So I added --parent flag to record/capture subcommands for using the parent window for those operations. (5e7b057) I'm not sure if this approach will fix your issue but it was a necessary flag to add at the end of the day.

Please let me know if it works or not for further research.

kattjevfel commented 3 years ago

Doesn't seem to work with --parent, in fact all it changes is that there's no longer a green border visible, other than for seemingly only firefox (my only gtk application, so that could be it), but it also didn't show with steam so I'm not 100% sure.

On another perhaps relevant note, slop is listed as an optdepend for window selection, but it doesn't make a difference whatsoever having it installed or not.

orhun commented 3 years ago

Doesn't seem to work with --parent, in fact all it changes is that there's no longer a green border visible, other than for seemingly only firefox (my only gtk application, so that could be it), but it also didn't show with steam so I'm not 100% sure.

What are the window names (logs) changing into when you use --parent? What happens when you capture the window although there's not a green border?

On another perhaps relevant note, slop is listed as an optdepend for window selection, but it doesn't make a difference whatsoever having it installed or not.

Here. Maybe I should remove that since it doesn't affect the runtime.

kattjevfel commented 3 years ago

What are the window names (logs) changing into when you use --parent? What happens when you capture the window although there's not a green border?

Sorry if I wasn't clear, it's only visual, the screenshot is exactly the same just that the border doesnt show up.

Anyway here's comparing with and without --parent:

katt@main ~ » menyoki capture --parent
[2020-12-16T17:04:31 INFO menyoki::x11::display] 
 Window title  -> "(?)"
 Window size   -> [1207x1019]
^Celected area -> [1207x1019] 
katt@main ~ » menyoki capture
[2020-12-16T17:04:35 INFO menyoki::x11::display] 
 Window title  -> "katt@main:~"
 Window size   -> [1207x1019]
^Celected area -> [1207x1019]

Both are focusing my terminal emulator

On another perhaps relevant note, slop is listed as an optdepend for window selection, but it doesn't make a difference whatsoever having it installed or not.

Here. Maybe I should remove that since it doesn't affect the runtime.

Ah, right, I assumed the program would make use of it directly, I hadn't read that part, my bad.

orhun commented 3 years ago

I've been looking into this issue and I'm afraid it might be a limitation about Xlib. I'll keep searching for alternative implementations and post results here.