Commit graph

169 commits

Author SHA1 Message Date
Mikkel Oscar Lyderik 15cbc53a77 Make IPC binding event support a compile time opt. 2016-01-08 15:03:25 +01:00
Mikkel Oscar Lyderik 6392abe35b Implement IPC binding event (keyboard)
This implements the IPC binding event for keyboard bindings.  It is
slightly different from the i3 implementation [1] since sway supports
more than one non-modifier key in a binding. Thus the json interface has
been changed from:

    {
      ...
      "symbol": "t",
      ...
    }

to:

    {
      ...
      "symbols": [ "t" ],
      ...
    }

[1] http://i3wm.org/docs/ipc.html#_binding_event
2016-01-08 03:03:55 +01:00
Mikkel Oscar Lyderik a8402035e9 Add modifier key to bar_config json 2016-01-05 18:36:26 +01:00
Mikkel Oscar Lyderik 95e0f44c73 Move modifier name table to common/util.c
Lookup of modifier names is required in several places, thus it makes
sense to move it to a general place.
2016-01-05 18:36:24 +01:00
Mikkel Oscar Lyderik c20c63b677 Send IPC modifier event on bar_modifier up/down
Detects when a bar modifier key is pressed/released and sends a modifier
IPC event to any listeners (usually swaybars).

This way a swaybar can listen on the modifier event and hide/show the
bar accordingly (not implemented yet)

The modifier event looks like this:

    {
      "change": "pressed", // or released
      "modifier": "Mod4"
    }
2016-01-05 02:25:56 +01:00
Mikkel Oscar Lyderik aa2f754c64 swaybar: Implement binding_mode_indicator 2016-01-03 22:16:36 +01:00
Mikkel Oscar Lyderik 19833fbc8b Add IPC event types
Adds custom IPC_EVENT_* types
2016-01-03 20:37:10 +01:00
Mikkel Oscar Lyderik 50b04884b6 Trigger ipc_event_workspace in all cases
This makes sure that the workspace IPC event is triggered when needed.

Fixes #382 while making sure that the IPC event is only triggered once.
2015-12-21 23:07:52 +01:00
Drew DeVault 442a54c38b Merge pull request #390 from mikkeloscar/workspace-ipc-event
Don't skip all clients on ipc_workspace_event.
2015-12-21 09:49:55 -05:00
Mikkel Oscar Lyderik 42e5b4b032 Don't skip all clients on ipc_workspace_event.
Only clients not subcriped to the workspace event should be skipped.
2015-12-21 15:40:01 +01:00
Mikkel Oscar Lyderik 66c66c7304 Implement barconfig_update IPC event 2015-12-21 15:28:34 +01:00
Mikkel Oscar Lyderik 2fd7dd64ec Implement bar option: separator_symbol 2015-12-16 13:01:11 +01:00
Drew DeVault 473ac4531f [swaybar] Get bar config via IPC 2015-12-15 22:22:22 -05:00
Drew DeVault 809c251df8 Merge pull request #328 from mikkeloscar/bar-height
Add bar height option (Airblader/i3)
2015-12-15 09:08:40 -05:00
Mikkel Oscar Lyderik 6834a33290 Add bar height option (Airblader/i3) 2015-12-15 15:02:13 +01:00
Drew DeVault 432e3310f6 Fix crash from ipc_json_describe_workspace
destroying workspace '10'
Error: Signal 11. Printing backtrace
Backtrace: sway(error_handler+0x2f) [0x41478f]
Backtrace: /usr/lib/libc.so.6(+0x33680) [0x7f06d9a99680]
Backtrace: /usr/lib/libc.so.6(strlen+0x2a) [0x7f06d9ae70ca]
Backtrace: /usr/lib/libc.so.6(__strdup+0xe) [0x7f06d9ae6dfe]
Backtrace: /usr/lib/libjson-c.so.2(json_object_new_string+0x39) [0x7f06da01ffe9]
Backtrace: sway(ipc_json_describe_workspace+0xd8) [0x410408]
Backtrace: sway(ipc_event_workspace+0x38) [0x410618]
Backtrace: sway(set_focused_container+0x190) [0x40daf0]
Backtrace: sway(workspace_switch+0x1a1) [0x4142b1]
Backtrace: sway() [0x4096c6]
Backtrace: sway(handle_command+0x178) [0x405eb8]
Backtrace: sway() [0x40e6ee]
Backtrace: /usr/lib/libwlc.so.0(+0x19a1b) [0x7f06da6f0a1b]
Backtrace: /usr/lib/libwlc.so.0(+0x11b0c) [0x7f06da6e8b0c]
Backtrace: /usr/lib/libwayland-server.so.0(wl_event_loop_dispatch+0x72) [0x7f06d9e13242]
Backtrace: /usr/lib/libwayland-server.so.0(wl_display_run+0x25) [0x7f06d9e119a5]
Backtrace: /usr/lib/libwlc.so.0(wlc_run+0xfc) [0x7f06da6fda1c]
Backtrace: sway(main+0x25f) [0x4125cf]
Backtrace: /usr/lib/libc.so.6(__libc_start_main+0xf0) [0x7f06d9a86610]
Backtrace: sway(_start+0x29) [0x405bf9]
2015-12-15 08:41:10 -05:00
Drew DeVault b76acbaf4f Implement IPC_GET_BAR_CONFIG 2015-12-15 08:25:53 -05:00
Kevin Hamacher 64a183b23d Fix dangling pointer on focus swap/describe WS 2015-12-14 11:43:17 +01:00
Drew DeVault 27f03c705d Move IPC client into common, refactor IPC 2015-11-27 09:50:04 -05:00
Renamed from sway/ipc.c (Browse further)