dreamcat4 / skippy-xd

A full-screen Exposé-style standalone task switcher for X11.
GNU General Public License v2.0
100 stars 12 forks source link

Alt-Tab functionality and entry point redesign #122

Closed felixfung closed 1 year ago

felixfung commented 1 year ago

Given #120 and #121, redesign alt-tab logic and cmdline entry points:

For expose and paging, skippy invocation should always be toggling. It does not make too much sense to activate skippy more than once.

For alt-tab functionality (now renamed switch, because switch/expose/paging all has 6 characters :)), skippy invocation should always carry a next/prev annotation.

I also did away with deactivate cmdline entry point, since it kind of never serve too much purpose to begin with.

Hence, now skippy has these entry points:

Usage: skippy-xd [command]

The available commands are:
  [no command]        - activate expose once without daemon.
  --config-reload     - reload configuration file; currently the file path must remain unchanged.
  --config            - read the specified configuration file.
  --start-daemon      - starts the daemon running.
  --stop-daemon       - stops the daemon running.
  --switch            - connects to daemon and activate switch.
  --switch-prev       - connects to daemon and activate switch.
  --expose            - connects to daemon and activate expose.
  --paging            - connects to daemon and activate paging.

  --help              - show this message.
  -S                  - enable debugging logs.

In this redesigning of entry points, switch usage is performed by the user by setting up their hot key environment:

Alt + Tab -> skippy-xd --switch
Shift + Alt + Tab -> skippy-xd --switch-prev

Then, the code path is skippy-xd --switch or skippy-xd --switch-prev sending pipe commands to skippy daemon. Then, if skippy is not yet activated, activate in switch layout, and focus on next/prev window. If skippy is activated, focus on next/prev window.

This is perhaps a different design/code path from before, which involved using keys from config file, keysReverseDirection and modiferKeyMaskReverseDirection to do reverse Alt-Tab direction, by reversing window focus direction within clientwin_handle(). I am not able to set-up keysReverseDirection and modiferKeyMaskReverseDirection, and based on code-inspection and log, it looks like this double if statement is never triggered, and hence are not functional, @dreamcat4 ? In fact, if both code paths are working, then Shift + Alt + Tab would do a "reverse reverse next == next"? https://github.com/dreamcat4/skippy-xd/blob/5ea4756268717f8d540dcb130167ae99c4a6928a/src/clientwin.c#L596

felixfung commented 1 year ago

@dreamcat4 I am going to merge this now to focus on other tasks, but I would appreciate your input on keysReverseDirection and modiferKeyMaskReverseDirection at your leisure.

dreamcat4 commented 1 year ago

thank you @felixfung ...will be planning to get around to it (eventually). i very much hope within next 2 weeks timeframe. this is indeed a very much appreciated these efforts to restore back those recent loss of functionality