Hi all,

Last time I shared my tool selx on the mailing list [0] it received
positive responses. Recently I've reworked the drawing method for it.

Previously it was using XShape extension but it doesn't seem to work
when a compositor is running (tested using fastcompmgr [1]). It draws
the rectangle initially but then gets frozen and doesn't draw anything
further. I'm unsure of why that is but scrot's `--line mode=edge` and
slop's non-opengl backend (-o) also use XShape and suffer from the same
issue.

Now I've reworked selx to simply use 4 different windows to compose the
rectangle. This works both on compositor and non-compositor setups from
my limited testing and performs similar to XShape approach. This is
currently in the master branch [2] (commit ee7481c62) and so if anyone
is interested in trying it out and reporting back how it works that'd be
appreciated.

Also worth noting that before using the 4 window approach I was trying
out using a transparent window and drawing the rectangle on it. This
worked, but (a) was quite a lot of code (b) required different drawing
code for compositor and non-compositor case since non-compositor case
can't have transparent windows. The code for this can be found on the
transparent-window branch [3] if someone's interested and wants to check
it out.

One more thing I'd like some feedback on is how the current window
selection works: if you right-click to select a window that's partially
off-screen selx will clip the selection to only include the part that's
on-screen.

This was done in order to avoid feeding junk co-ordinates to sxot but
this behavior is different from other similar tools and so a user
suggested [4] that it's better for selx to follow "standard" behavior
and sxot should do the clamping instead. This would increase sxot's
complexity a tad bit but maybe makes more sense from a user experience
perspective.

Any users of selx/sxot wants to share their thoughts on this?

[0]: https://lists.suckless.org/dev/2307/35301.html
[1]: https://github.com/tycho-kirchner/fastcompmgr
[2]: https://codeberg.org/NRK/selx/src/branch/master
[3]: https://codeberg.org/NRK/selx/src/branch/transparent-window
[4]: https://codeberg.org/NRK/sxot/issues/32#issuecomment-10253308

- NRK

Reply via email to