aboutsummaryrefslogtreecommitdiffstats
path: root/sway/ipc-json.c
Commit message (Collapse)AuthorAge
...
* ipc: change {,deco_}rect to match i3Libravatar Brian Ashworth2019-03-06
| | | | | | | | | | | | This fixes the `deco_rect` and `rect` properties in the IPC responses to match i3's behavior. `deco_rect` should be relative to the parent node, not the current node. This also takes tabbed and stacked decorations into account and will calculate `deco_rect` for all containers since tabbed and stacked child containers will have decorations. `rect` should exclude the window decorations.
* ipc: add missing fields to disabled outputsLibravatar Caleb Bassi2019-02-23
| | | | | | i3 requires all outputs to have certain fields, including 'primary', 'current_workspace', and 'rect' which were missing on disabled outputs. https://i3wm.org/docs/ipc.html#_outputs_reply
* Handle NULL from output_get_active_workspaceLibravatar Brian Ashworth2019-02-21
| | | | | | | | | | This modifies the places where output_get_active_workspace is called to handle a NULL result. Some places already handled it and did not need a change, some just have guard off code blocks, others return errors, and some have sway_asserts since the case should never happen. A lot of this is probably just safety precautions since they probably will never be called when `output_get_active_workspace` is not fully configured with a workspace.
* Add 'visible' key to view json responseLibravatar Yorick van Pelt2019-02-18
|
* ipc: handle unnamed xkb_active_layout_nameLibravatar Brian Ashworth2019-02-11
| | | | | | If the active xkb_layout does not have a name, use `NULL` instead of `json_object_new_string(NULL)`. This also makes it so swaymsg will pretty print this as `(unnamed)`.
* Introduce container_is_scratchpad_hiddenLibravatar Ryan Dwyer2019-01-28
| | | | | | | | | | | | Just a convenience function that improves readability of the code. Other things worth noting: * container_get_siblings and container_sibling_index no longer use the const keyword * container_handle_fullscreen_reparent is only ever called after attaching the container to a workspace, so its con->workspace check has been changed to an assertion
* Implement fullscreen globalLibravatar Ryan Dwyer2019-01-25
|
* Make json-c include respect pkg-config --cflagsLibravatar Jan Beich2019-01-23
| | | | | json-c.pc contains `Cflags: -I${includedir}/json-c`, so `<json-c/json.h>` won't be found unless the parent directory is searched by default.
* bar_cmd_tray_bind: Use mouse button helpersLibravatar Brian Ashworth2019-01-16
| | | | | | | | | | | | | | | | This modifies `bar_cmd_tray_bindsym` to use `get_mouse_bindsym` for parsing mouse buttons. This also introduces `bar_cmd_tray_bindcode`, which will use `get_mouse_bindcode` for parsing mouse buttons. Like with sway bindings, the two commands are encapsulated in a single file to maximize shared code. This also modifies tray bindings to work off of events codes rather than x11 buttons, which allows for any mouse buttons to be used. For `get_bar_config`, `event_code` has been added to the `tray_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`.
* Merge pull request #3344 from RedSoxFan/bar-mouse-bindings-improvedLibravatar Drew DeVault2019-01-13
|\ | | | | Improve mouse button parsing: bar mouse bindings
| * bar_cmd_bind: utilize mouse button helpersLibravatar Brian Ashworth2019-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.
* | Merge pull request #3398 from RedSoxFan/toggle-input-eventsLibravatar Drew DeVault2019-01-13
|\ \ | | | | | | input events: toggle and ipc get_inputs
| * | get_inputs: add libinput send events modeLibravatar Brian Ashworth2019-01-09
| |/ | | | | | | | | Add `libinput_send_events` to the IPC output for `get_inputs` to allow scripting of mode changes.
* | swaybar: add status_edge_padding commandLibravatar Brian Ashworth2019-01-11
| | | | | | | | | | This adds the bar subcommand `status_edge_padding <padding>` to set the padding used when the status line is on the right edge of the bar.
* | swaybar: add status_padding commandLibravatar Brian Ashworth2019-01-11
|/ | | | | | Adds the bar subcommand `status_padding <padding>` which allows setting the padding used for swaybar. If `status_padding` is set to `0`, blocks will be able to take up the full height of the bar.
* swaybar: implement tray configLibravatar Ian Fan2018-12-31
|
* added fullscreen_mode to get_tree outputLibravatar NokiDev2018-12-25
| | | | Signed-off-by: NokiDev <noki.dev@gmail.com>
* Update for swaywm/wlroots#1377Libravatar Rostislav Pehlivanov2018-12-16
| | | | -Werror is eͫ̐ͭ҉vi͆ͦ̏ͦlͥ̀͒̊͂͛
* Implement bar gapsLibravatar Brian Ashworth2018-11-28
| | | | | | | | | Adds the bar subcommand `gaps <amount>|<horizontal> <vertical>|<top> <right> <bottom> <left>` to set gaps for swaybar. Due to restrictions on margins for a layer_surface, only the sides that are anchored to an edge of the screen can have gaps. Since there is support for per-side outer gaps for workspaces, those should be able to be used instead for the last side.
* IPC: Use consistent function names across ipc-jsonLibravatar Mihai Coman2018-11-26
|
* IPC: Add scratchpad containers to get_tree replyLibravatar Mihai Coman2018-11-26
| | | | | This patch lists all hidden scratchpad containers as floating nodes on "__i3_scratch" workspace. This workspace resides on "__i3" output.
* Merge pull request #3083 from c-edw/feature/StripWorkspaceNameLibravatar emersion2018-11-19
|\ | | | | Implement strip_workspace_name.
| * Implement strip_workspace_name.Libravatar Connor E2018-11-17
| |
* | Use #if instead of #ifdefLibravatar emersion2018-11-18
| |
* | Move view {x,y,width,height} into container structLibravatar Ryan Dwyer2018-11-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This renames/moves the following properties: * sway_view.{x,y,width,height} -> sway_container.content_{x,y,width,height} * This is required to support placeholder containers as they don't have a view. * sway_container_state.view_{x,y,width,height} -> sway_container_state.content_{x,y,width,height} * To remain consistent with the above. * sway_container_state.con_{x,y,width,height} -> sway_container_state.{x,y,width,height} * The con prefix was there to give it contrast from the view properties, and is no longer useful. The function container_set_geometry_from_floating_view has also been renamed to container_set_geometry_from_content.
* | IPC: Send keyboard layout info in IPC_GET_INPUTSLibravatar Harish Krupo2018-11-12
|/ | | | Signed-off-by: Harish Krupo <harishkrupo@gmail.com>
* ipc: move refresh from output to output->current_modeLibravatar Cole Mickens2018-11-03
|
* fix: restore refresh to the modes_arrayLibravatar Cole Mickens2018-11-03
|
* sway-ipc: includes current_mode for each outputLibravatar Cole Mickens2018-11-03
|
* Move view marks properties to container structLibravatar Ryan Dwyer2018-11-01
| | | | | Like border properties, this will be needed to implement layout saving and restoring.
* ipc: make class, instance, and title window properties optionalLibravatar Franklin "Snaipe" Mathieu2018-10-27
| | | | | | | | | i3 seems to make all window properties, with the exception of transient_for, optional[1]. [1]: https://github.com/i3/i3/blob/315ff17563fd703b2f5117b2ec4d46e89389d323/src/ipc.c#L435-L450 Signed-off-by: Franklin "Snaipe" Mathieu <snaipe@diacritic.io>
* ipc: remove class key from view jsonLibravatar Franklin "Snaipe" Mathieu2018-10-27
| | | | | | | | | It turns out that i3 does not have a `class` key in the json description of a view, but provides it through `window_properties.class`. Since `window_properties` has been added by 8fc9328, we can remove `class` altogether. Signed-off-by: Franklin "Snaipe" Mathieu <snaipe@diacritic.io>
* xwayland: populate window_properties in json for viewsLibravatar Franklin "Snaipe" Mathieu2018-10-23
| | | | | | | | | | | window_properties is documented to contain a subset of the X11 properties of a window (its title, class, instance, role, and transient ID). This commit adds the missing json object from the get_tree output for xwayland windows only. This is a follow-up of #2911. Signed-off-by: Franklin "Snaipe" Mathieu <me@snai.pe>
* Minor refactor of input managerLibravatar Ryan Dwyer2018-10-20
| | | | | | | | | | | | | | | | | | | | | The input manager is a singleton object. Passing the sway_input_manager argument to each of its functions is unnecessary, while removing the argument makes it obvious to the caller that it's a singleton. This patch removes the argument and makes the input manager use server.input instead. On a similar note: * sway_input_manager.server is removed in favour of using the server global. * seat.input is removed because it can get it from server.input. Due to a circular dependency, creating seat0 is now done directly in server_init rather than in input_manager_create. This is because creating seats must be done after server.input is set. Lastly, it now stores the default seat name using a constant and removes a second reference to seat0 (in input_manager_get_default_seat).
* Implement bar bindsymLibravatar Brian Ashworth2018-10-09
|
* swaybar: allow null status_commandLibravatar Ryan Dwyer2018-10-08
| | | | | | | | | Sway sets a default status_command which runs date every second. This patch removes this behaviour so the user can have a NULL status bar if desired. I had to swap swaybar's event_loop_poll and wl_display_flush so that it would map the initial surface.
* ipc: set "type" of floating containers to "floating_con"Libravatar Ian Fan2018-10-06
|
* Merge pull request #2703 from RyanDwyer/csd-borderLibravatar Drew DeVault2018-10-03
|\ | | | | Add CSD to border modes
| * Add CSD to border modesLibravatar Ryan Dwyer2018-09-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces view.using_csd with a new border mode: B_CSD. This also removes sway_xdg_shell{_v6}_view.deco_mode and view->has_client_side_decorations as we can now get these from the border. You can use `border toggle` to cycle through the modes including CSD, or use `border csd` to set it directly. The client must support the xdg-decoration protocol, and the only client I know of that does is the example in wlroots. If the client switches from SSD to CSD without us expecting it (via the server-decoration protocol), we stash the previous border type into view.saved_border so we can restore it if the client returns to SSD. I haven't found a way to test this though.
* | Turn funcs() into funcs(void)Libravatar Arkadiusz Hiler2018-09-30
|/ | | | If they really do not take undefined number of arguments.
* ipc: add pid information for views in layout treeLibravatar Ian Fan2018-09-19
|
* ipc: handle NULL cases for node_get_outputLibravatar Ian Fan2018-09-15
|
* ipc: add focus information to root nodeLibravatar Ian Fan2018-09-15
|
* code style fixesLibravatar Armin Preiml2018-09-08
|
* get_tree: percent cast to double on divisionLibravatar Armin Preiml2018-09-08
|
* get_tree: default valuesLibravatar Armin Preiml2018-09-08
| | | | | | | | | | Added default values for all nodes, because the i3 get_tree always returns all fields inside the json objects. Add geometry and window for views. Window is only availabel on x11 windows otherwise it's NULL. Calculate percent only if parent is not empty to avoid division by 0.
* missing ipc stuff: rebase to typesafetyLibravatar Armin Preiml2018-09-08
|
* Fix swaybars with no defined outputLibravatar Ryan Dwyer2018-09-05
|
* Implement type safe arguments and demote sway_containerLibravatar Ryan Dwyer2018-09-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit changes the meaning of sway_container so that it only refers to layout containers and view containers. Workspaces, outputs and the root are no longer known as containers. Instead, root, outputs, workspaces and containers are all a type of node, and containers come in two types: layout containers and view containers. In addition to the above, this implements type safe variables. This means we use specific types such as sway_output and sway_workspace instead of generic containers or nodes. However, it's worth noting that in a few places places (eg. seat focus and transactions) referring to them in a generic way is unavoidable which is why we still use nodes in some places. If you want a TL;DR, look at node.h, as well as the struct definitions for root, output, workspace and container. Note that sway_output now contains a workspaces list, and workspaces now contain a tiling and floating list, and containers now contain a pointer back to the workspace. There are now functions for seat_get_focused_workspace and seat_get_focused_container. The latter will return NULL if a workspace itself is focused. Most other seat functions like seat_get_focus and seat_set_focus now accept and return nodes. In the config->handler_context struct, current_container has been replaced with three pointers: node, container and workspace. node is the same as what current_container was, while workspace is the workspace that the node resides on and container is the actual container, which may be NULL if a workspace itself is focused. The global root_container variable has been replaced with one simply called root, which is a pointer to the sway_root instance. The way outputs are created, enabled, disabled and destroyed has changed. Previously we'd wrap the sway_output in a container when it is enabled, but as we don't have containers any more it needs a different approach. The output_create and output_destroy functions previously created/destroyed the container, but now they create/destroy the sway_output. There is a new function output_disable to disable an output without destroying it. Containers have a new view property. If this is populated then the container is a view container, otherwise it's a layout container. Like before, this property is immutable for the life of the container. Containers have both a `sway_container *parent` and `sway_workspace *workspace`. As we use specific types now, parent cannot point to a workspace so it'll be NULL for containers which are direct children of the workspace. The workspace property is set for all containers, except those which are hidden in the scratchpad as they have no workspace. In some cases we need to refer to workspaces in a container-like way. For example, workspaces have layout and children, but when using specific types this makes it difficult. Likewise, it's difficult for a container to get its parent's layout when the parent could be another container or a workspace. To make it easier, some helper functions have been created: container_parent_layout and container_get_siblings. container_remove_child has been renamed to container_detach and container_replace_child has been renamed to container_replace. `container_handle_fullscreen_reparent(con, old_parent)` has had the old_parent removed. We now unfullscreen the workspace when detaching the container, so this function is simplified and only needs one argument now. container_notify_subtree_changed has been renamed to container_update_representation. This is more descriptive of its purpose. I also wanted to be able to call it with whatever container was changed rather than the container's parent, which makes bubbling up to the workspace easier. There are now state structs per node thing. ie. sway_output_state, sway_workspace_state and sway_container_state. The focus, move and layout commands have been completely refactored to work with the specific types. I considered making these a separate PR, but I'd be backporting my changes only to replace them again, and it's easier just to test everything at once.
* Add app_id and class to get_tree outputLibravatar vilhalmer2018-08-21
|