Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve mouse button parsing: bar mouse bindings #3344

Merged
merged 1 commit into from
Jan 14, 2019

Conversation

RedSoxFan
Copy link
Member

@RedSoxFan RedSoxFan commented Dec 28, 2018

DO NOT MERGE UNTIL AFTER #3341

This is the fourth in a series of follow-up PRs for #3313.

This modifies bar_cmd_bindsym to use get_mouse_bindsym for parsing
mouse buttons. This also introduces cmd_bar_bindcode, which will use
get_mouse_bindcode for parsing mouse buttons. Like sway bindings, the
two commands are encapsulated in a single file with shared code.

This also modifies swaybar to operate off of event codes rather than x11
button numbers, which allows for any mouse button to be used. Tray bindings
will be modified in a separate PR.

This introduces two new IPC properties:

  • For get_bar_config, event_code has been added to the bindings
    section and will include to event code for the button. If the event code
    can be mapped to a x11 button, input_code will still be the x11 button
    number. Otherwise, input_code will be 0.
  • Likewise for click_events, event has been added and will include
    the event code for the button clicked. If the event code can be mapped
    to a x11 button, button will still be the x11 button number.
    Otherwise, button will be 0.

This modifies `bar_cmd_bindsym` to use `get_mouse_bindsym` for parsing
mouse buttons. This also introduces `cmd_bar_bindcode`, which will use
`get_mouse_bindcode` for parsing mouse buttons. Like sway bindings, the
two commands are encapsulated in a single file with shared code.

This also modifies swaybar to operate off of event codes rather than x11
button numbers, which allows for any mouse button to be used.

This introduces two new IPC properties:
- For `get_bar_config`, `event_code` has been added to the `bindings`
section and will include to event code for the button. If the event code
can be mapped to a x11 button, `input_code` will still be the x11 button
number. Otherwise, `input_code` will be `0`.
- Likewise for `click_events`, `event` has been added and will include
the event code for the button clicked. If the event code can be mapped
to a x11 button, `button` will still be the x11 button number.
Otherwise, `button` will be `0`.
@RedSoxFan RedSoxFan changed the title [DO NOT MERGE] Improve mouse button parsing: bar mouse bindings Improve mouse button parsing: bar mouse bindings Jan 10, 2019
@RedSoxFan
Copy link
Member Author

Rebased and ready for review

@ddevault ddevault merged commit 81bb675 into swaywm:master Jan 14, 2019
@ddevault
Copy link
Contributor

Thanks!

@RedSoxFan RedSoxFan deleted the bar-mouse-bindings-improved branch January 14, 2019 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants