CyberShadow / hax11

Hackbrary to Hook and Augment X11 protocol calls
MIT License
116 stars 9 forks source link

New features, logging improvements, other internal changes #13

Closed acuifex closed 3 months ago

acuifex commented 4 months ago

Added resolution faking on X11 handshake. Portal 2 (sdl2) was desperately trying to use both monitors as my resolution.

Added NoWindowStackMove which filters out window stack move requests. Prevents some applications (Portal 2) from moving to the top for no good reason.

Added NoWMRaise which filters out _NET_ACTIVE_WINDOW messages. Pretty similar to NoWindowStackMove, but instead of filtering X11 requests, it filters messages for the window manager.

Added timestamps to log messages and improved request/response logging.

I'd suggest to not fopen on each log and instead just fflush because thunar just dies if i'm in /tmp

I also thought about refactoring a lot of the code, is that something you'd be interested in?

Screenshot_2024-06-24_03-09-28

acuifex commented 4 months ago

I've set _NET_ACTIVE_WINDOW's request type to noop, and now it's working. I think i was messing up sequence numbers. Give me some time to figure all of this out, and i'll add _NET_ACTIVE_WINDOW and CWStackMode filters to this.

edit: Done. If only i figured this out earlier, instead of wasting entire days.

acuifex commented 3 months ago

Did you have anything specific in mind?

Mostly move stuff into more files, remove some of the dirty hacks and macros. Just make it not a pain to look at.

I tried to create an experimental second way to use hax11: instead of LD_PRELOAD, you start the server program then tell other programs to connect to it by setting DISPLAY, the big problem with that is that there's no easy way to tell which application is connected (but maybe possible with SO_PEERCRED.

That sounds incredibly cool. I will for sure check it out.

acuifex commented 3 months ago

I've done the changes. Had to move config definition so that it's visible to the log function.

CyberShadow commented 3 months ago

Thanks!