aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/input-manager.c
Commit message (Collapse)AuthorAge
* seat_cmd_cursor: do not create non-existing seatLibravatar Brian Ashworth2019-02-11
| | | | | | | | If a seat does not exist in seat_cmd_cursor, do not create it. A seat without any attachments is useless since it will have no capabilities. This changes `input_manager_get_seat` to have an additional argument that dictates whether or not to create the seat if it does not exist.
* Fix one remaining wlr_log callLibravatar emersion2019-01-21
|
* Replace wlr_log with sway_logLibravatar M Stoeckl2019-01-21
| | | | | | | | | | | | | This commit mostly duplicates the wlr_log functions, although with a sway_* prefix. (This is very similar to PR #2009.) However, the logging function no longer needs to be replaceable, so sway_log_init's second argument is used to set the exit callback for sway_abort. wlr_log_init is still invoked in sway/main.c This commit makes it easier to remove the wlroots dependency for the helper programs swaymsg, swaybg, swaybar, and swaynag.
* Log libinput_config_status errorsLibravatar Brian Ashworth2019-01-21
| | | | | | This add errors from calls to `libinput_device_config_*_set` to the debug log. This may be useful when looking at issues related to input devices and config settings not working.
* reload: reset input configsLibravatar Brian Ashworth2019-01-09
| | | | | This resets all input options to their defaults on reload. This also fixes some debug log typos in `input_manager_libinput_config_pointer`.
* stringop.c: rewrite strip_whitespaceLibravatar Ian Fan2019-01-01
|
* Apply implicit fallback seat configLibravatar Brian Ashworth2018-12-31
| | | | | | The implicit fallback seat config needs to be applied (if created). Otherwise, the input devices will still be removed from the implicit default seat on reload when there is any seat config.
* Verify seat fallback settings on reloadLibravatar Brian Ashworth2018-12-30
| | | | | | | | | | | | | This fixes an issue where on reload, all input devices that were added via an implicit fallback to the default seat would be removed from the default seat and applications would crash due to the seat having no capabilities. On reload, there is a query for a seat config with the fallback setting set (it can either be true or false). If no such seat config exists, the default seat is created (if needed) and has the implicit fallback true applied to its seat config. This is the same procedure that occurs when a new input is detected.
* Revamp seat configsLibravatar Brian Ashworth2018-12-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes seat configs work like output and input configs do. This also adds support for wildcard seat configs. A seat config is still created in the main seat command handler, but instead of creating a new one in the subcommands and destroying the main seat command's instance, the seat subcommands modify the main one. The seat config is then stored, where it is merged appropriately. The seat config returned from `store_seat_config` is then applied. When attempting to apply a wildcard seat config, a seat specific config is queried for and if found, that is used. Otherwise, the wildcard config is applied directly. Additionally, instead of adding input devices to the default seat directly when there is no seat configs, a seat config for the default seat is created with only fallback set to true, which is more explicit. It also fixes an issue where running a seat command at runtime (with no seat config in the sway config), would result in all input devices being removed from the default seat and leaving sway in an unusable state. Also, instead of checking for any seat config, the search is for a seat config with a fallback option seat. This makes it so if there are only seat configs with fallback set to -1, the default seat is still created since there is no explicit notion on what to do regarding fallbacks. However, if there is even a single fallback 0, then the default seat is not used as a fallback. This will be needed for seat subcommands like hide_cursor where the user may only want to set that property without effecting anything else.
* Replace _XOPEN_SOURCE with _POSIX_C_SOURCELibravatar emersion2018-11-25
| | | | And make sure we don't define both in the same source file.
* input-manager: consider cursor warping on input_manager_set_focusLibravatar Rouven Czerwinski2018-10-28
| | | | | | input_manager_set_focus is used to set the focus after mapping the view in view_map. This needs to consider to warp the cursor as well, since for WARP_CONTAINER, the cursor should warp to the newly created view.
* Fix crash when defaut seat is not createdLibravatar Mihai Coman2018-10-20
| | | | Function input_manager_get_default_seat should always return a seat.
* 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).
* cmd_bind{sym,code}: Implement per-device bindingsLibravatar Brian Ashworth2018-10-18
| | | | | bindsym --input-device=<identifier> ... bindcode --input-device=<identifier> ...
* Add libinput send_events config for touchLibravatar Thiago Mendes2018-10-10
|
* add libinput config for keyboardLibravatar Vincent Gu2018-10-09
| | | | add send_events support
* add tap-and-drag setting to sway-inputLibravatar PP2018-09-29
|
* input: enable configuring tablets with libinputLibravatar Ian Fan2018-09-24
|
* Implement support for input wildcardLibravatar Brian Ashworth2018-09-23
|
* 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 virtual keyboard protocolLibravatar Drew DeVault2018-07-28
| | | | Ref #2373
* Implement tap_button_map for input devicesLibravatar Brian Ashworth2018-07-14
|
* add scroll button optionLibravatar Robert Kubosz2018-07-11
| | | | | | This commit introduces a scroll_button option, which is intended to be used with scroll_method. Now user can edit his sway config and add an scroll_button option to device section.
* Update for swaywm/wlroots#1126Libravatar emersion2018-07-09
|
* Attach destroy handler earlierLibravatar Ian Fan2018-07-06
| | | | This prevents it from being bypassed when the device has no seat configuration
* Add map_from_region commandLibravatar emersion2018-04-26
|
* Give keyboard focus to unmanaged xwayland surfacesLibravatar emersion2018-04-07
| | | | This fixes dmenu
* Implement input-inhibit in sway, swaylockLibravatar Drew DeVault2018-04-04
|
* Add input inhibitor to input managerLibravatar Drew DeVault2018-04-04
|
* fix segfaultLibravatar Tony Crisci2018-04-02
|
* dont copy input configLibravatar Tony Crisci2018-04-02
|
* 80colLibravatar Tony Crisci2018-04-02
|
* dont copy seat config on the seatLibravatar Tony Crisci2018-04-02
|
* rename input-manager functionsLibravatar Tony Crisci2018-04-02
|
* rename seat functionsLibravatar Tony Crisci2018-04-02
|
* Revert "Merge pull request #1653 from swaywm/revert-1647-refactor-tree"Libravatar Tony Crisci2018-03-29
| | | | | This reverts commit 472e81f35d689d67cda241acafda91c688d61046, reversing changes made to 6b7841b11ff4cd35f54d69dc92029855893e5ce0.
* Revert "Refactor tree"Libravatar Drew DeVault2018-03-29
|
* remove swayc_t typedefLibravatar Tony Crisci2018-03-29
|
* rename new_input listener on input-managerLibravatar Tony Crisci2018-02-20
|
* fix build for latest apiLibravatar Tony Crisci2018-02-14
|\
| * input device destroyLibravatar Tony Crisci2018-02-14
| |
* | separate seat get focus and seat get focus inactiveLibravatar Tony Crisci2018-02-07
| |
* | basic focus overhaulLibravatar Tony Crisci2018-02-04
|/
* Implement workspacesLibravatar Drew DeVault2018-01-30
|
* config reload: destroy old seat when removed from configLibravatar Dominique Martinet2018-01-22
| | | | | This adds new sway_seat_destroy and sway_cursor_destroy helpers and compare new and old config on free
* Merge pull request #1574 from acrisci/config-refactorLibravatar emersion2018-01-22
|\ | | | | Command criteria
| * add kill commandLibravatar Tony Crisci2018-01-20
| |
* | copy config references for input and seatLibravatar Tony Crisci2018-01-17
|/
* sway: change all sway_log to wlr_logLibravatar Dominique Martinet2018-01-05
|
* seat_configure_pointer: apply libinput configLibravatar Dominique Martinet2017-12-24
| | | | Restore the code that used to be in config.c:apply_input_config() pre-wlroots