joewing / jwm

Joe's Window Manager
http://joewing.net/projects/jwm
MIT License
520 stars 84 forks source link

Fix sloppy focus issues around desktop windows (file managers, etc), fix uninitialized windowType #617

Closed achadwick closed 2 months ago

achadwick commented 3 months ago

This combines two separate commits that fix some issues with background/desktop windows and JWM's sloppy focus.

The user probably considers background widows, like those provided by file managers, to be something other than a regular window, and might consider sloppy focus to be broken by them (see joewing/jwm#613). In point of fact, these windows should probably not receive sloppy focus; however they can still be usefully focussed and interacted with.

Therefore, require clicks before interaction even in sloppy focus mode.

They also may not appreciate a giant rectangle in the pager behind all the other ones. You can't usefully move one of these background filer windows, and it probably shouldn't hide the pager's desktop number either if the current desktop happens to be empty.

achadwick commented 3 months ago

For some reason, I wasn't able to test with np->state.windowType != WINDOW_TYPE_DESKTOP (the results felt like click-to-focus instead). Since that's 0 in the enum, is it being set correctly for regular windows? :thinking:

If you prefer, I can reimplement this patch and investigate.

achadwick commented 3 months ago

Looks like windowType wasn't being properly initialized during construction. I'm not sure what the full ramifications of that will be, but a default to WINDOW_TYPE_NORMAL seems safe.

@joewing Let me know if you want this rebasing before you accept it, since it changes the same lines twice.

achadwick commented 3 months ago

@joewing Does the exception this branch introduces for desktop windows while in sloppy focus modes need documenting? I don't think the pager stuff does, necessarily.

achadwick commented 3 months ago

I think the logic and behaviour is right now.

@joewing Let me know if you'd prefer me to rebase it into a couple of commits, and/or if anything needs to be changed stylistically.

joewing commented 2 months ago

This looks reasonable to me. Thanks!