aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/input/seat.h
Commit message (Collapse)AuthorAge
* Update for swaywm/wlroots#1517Libravatar emersion2019-02-25
|
* Implement pointer-constraints-unstable-v1Libravatar Las2019-01-30
|
* Update for swaywm/wlroots#1402Libravatar emersion2019-01-24
|
* Merge pull request #3402 from RyanDwyer/refactor-seatopsLibravatar Drew DeVault2019-01-13
|\ | | | | Refactor seat operations to use an interface
| * Refactor seat operations to use an interfaceLibravatar Ryan Dwyer2019-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This splits each seat operation (drag/move tiling/floating etc) into a separate file and introduces a struct sway_seatop_impl to abstract the operation. The move_tiling_threshold operation has been merged into move_tiling. The main logic for each operation is untouched aside from variable renames. The following previously-static functions have been made public: * node_at_coords * container_raise_floating * render_rect * premultiply_alpha * scale_box
* | 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`.
* Implement tiling_drag_thresholdLibravatar Brian Ashworth2019-01-02
| | | | | | | | | Implements `tiling_drag_threshold <threshold>` to prevent accidental dragging of tiling containers. If a container (and all of its descendants) are unfocused and the tile bar is pressed, a threshold will be used before actually starting the drag. Once the threshold has been exceeded, the cursor will change to the grab icon and the operation will switch from `OP_MOVE_TILING_THRESHOLD` to `OP_MOVE_TILING`.
* hide_cursor: change to a seat subcommandLibravatar Brian Ashworth2018-12-30
| | | | | This makes hide_cursor a seat subcommand, which allows for seat specific timeouts.
* Make workspace back_and_forth seat-specificLibravatar Ryan Dwyer2018-10-21
| | | | | | | | * When using multiple seats, each seat has its own prev_workspace_name for the purpose of workspace back_and_forth. * Removes prev_workspace_name global variable. * Removes unused next_name_map function in tree/workspace.c. * Fixes memory leak in seat_destroy (seat was not freed).
* 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).
* Fix logic used for mouse_warping outputLibravatar Ryan Dwyer2018-10-19
| | | | | Turns out we don't need to store the previous focus, and it should be based on which output the cursor was in.
* Consider cursor warp when switching workspacesLibravatar Ryan Dwyer2018-10-19
| | | | | | | | | Fixes a regression introduced in 24a90e5d86441fc345356eb3767e5a6880dcedbd. consider_warp_to_focus has been renamed to seat_consider_warp_to_focus, moved to seat.c and made public. It is now called when switching workspaces via `workspace <ws>`.
* Remove cursor warping from seat_set_focusLibravatar Ryan Dwyer2018-10-18
| | | | | | | | | | | | Because cursor warping was the default behaviour in seat_set_focus, there may be cases where we may have been warping the cursor unintentionally. This patch removes cursor warping from seat_set_focus and only does it in the focus command. This is managed by a static function in focus.c. To know whether to warp or not, we need to know which node had focus previously. To keep track of this easily, seat->prev_focus has been introduced and is set to the previous in seat_set_focus.
* Prevent duplicate workspace::focus eventsLibravatar Ryan Dwyer2018-10-16
| | | | | | | | | | | | Previously we would compare the last focus's workspace with the new focus's workspace to determine if we need to emit an IPC workspace::focus event. This doesn't work when moving the focused container to a new workspace. This adds a workspace property to the seat which stores the last emitted workspace::focus workspace. Using this method, after moving the container, refocusing it will trigger exactly one workspace::focus event: from the old workspace to the new workspace.
* Introduce seat_set_raw_focus and remove notify argument from seat_set_focus_warpLibravatar Ryan Dwyer2018-10-15
| | | | | | | | | | | | | | | | | | | | | | This introduces seat_set_raw_focus: a function that manipulates the focus stack without doing any other behaviour whatsoever. There are a few places where this is useful, such as where we set focus_inactive followed by another call to set the real focus again. With this change, the notify argument to seat_set_focus_warp is also removed as these cases now use the raw function instead. A bonus of this is we are no longer emitting window::focus IPC events when setting focus_inactive, nor are we sending focus/unfocus events to the surface. This also fixes the following: * When running `move workspace to output <name>` and moving the last workspace from the source output, the workspace::focus IPC event is no longer emitted for the newly created workspace. * When splitting the currently focused container, unfocus/focus events will not be sent to the surface when giving focus_inactive to the newly created parent, and window::focus events will not be emitted.
* Rename seat_get_active_child to seat_get_active_tiling_childLibravatar Ryan Dwyer2018-09-16
| | | | | Also renames container to con in one function to prevent ugly line wrapping.
* Update for swaywm/wlroots#1243Libravatar emersion2018-09-14
|
* Implement tiling dragLibravatar Ryan Dwyer2018-09-11
| | | | Hold floating_modifier and drag a tiling view to a new location.
* Rename OP_MOVE to OP_MOVE_FLOATINGLibravatar Ryan Dwyer2018-09-11
| | | | In preparation for introducing OP_MOVE_TILING.
* Introduce seat_set_focus_container and seat_set_focus_workspaceLibravatar Ryan Dwyer2018-09-06
| | | | | | | | | | | These are the same as seat_set_focus, but accept a specific type rather than using nodes. Doing this adds more typesafety and lets us avoid using &con->node which looks a little ugly. This fixes a crash that pretty much nobody would ever come across. If you have a bindsym for "focus" with no arguments and run it from an empty workspace, sway would crash because it assumes `container` is not NULL.
* 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.
* Don't send motion if the cursor hasn't movedLibravatar Ryan Dwyer2018-08-18
| | | | Prevents GTK+ comboboxes from immediately closing.
* Rename mousedown to down and make seat operation a named enumLibravatar Ryan Dwyer2018-08-18
|
* Implement mousedown operationLibravatar Ryan Dwyer2018-08-18
| | | | | This allows you to move the cursor off the surface while dragging its scrollbar.
* Refactor seat_get_focus functionsLibravatar Ryan Dwyer2018-08-17
| | | | | | | | | | | | | | | | | Fixes #2467. This commit introduces seat_get_focus_inactive_floating to supplement seat_get_focus_inactive_tiling, and uses it during `focus mode_toggle` which fixes a focus bug. This also refactors the seat_get_focus_inactive functions so that they do their selection logic themselves rather than offloading it to seat_get_focus_by_type which was getting bloated. seat_get_focus_by_type is now removed. Lastly, this commit changes seat_get_focus to just return the first container in the focus stack rather than looping and calling seat_get_focus_by_type.
* Implement resizing tiled containers via cursorLibravatar Ryan Dwyer2018-08-12
| | | | | | | | | * The OP_RESIZE seat operation has been renamed to OP_RESIZE_FLOATING, and OP_RESIZE_TILING has been introduced. * Similar to the above, seat_begin_resize and handle_resize_motion have been renamed and tiling variants introduced. * resize.c's resize_tiled has to be used, so container_resize_tiled has been introduced in resize.c to allow external code to call it.
* ipc: prevent emitting a workspace::focus event when moving a container to a ↵Libravatar Ian Fan2018-08-01
| | | | | | different workspace or output When a container is moved from, say, workspace 1 to workspace 2, workspace 2 is focused in order to arrange the windows before focus is moved back to workspace 1, which caused a workspace:focus event from workspace 2 to workspace 1 to be emitted. This commit inhibits that event.
* When unfloating, return container to previously focused tiled containerLibravatar Ryan Dwyer2018-07-28
| | | | | | This introduces seat_get_focus_inactive_tiling and updates `focus mode_toggle` to use it instead, because the previous method wasn't guaranteed to return a tiling view.
* Store last button and use it when views request to move or resizeLibravatar Ryan Dwyer2018-07-22
|
* Replace static handle_end_operation with seat_end_mouse_operationLibravatar Ryan Dwyer2018-07-22
|
* Implement xdg shell request_move and request_resize eventsLibravatar Ryan Dwyer2018-07-22
| | | | | | | | | Also does a few other related things: * Now uses enum wlr_edges instead of our own enum resize_edge * Now uses wlr_xcursor_get_resize_name and removes our own find_resize_edge_name * Renames drag to move for consistency
* Implement floating_modifier and mouse operations for floating viewsLibravatar Ryan Dwyer2018-07-22
| | | | | | | | | | | | | | This implements the following: * `floating_modifier` configuration directive * Drag a floating window by its title bar * Hold mod + drag a floating window from anywhere * Resize a floating view by dragging the border * Resize a floating view by holding mod and right clicking anywhere on the view * Resize a floating view and keep aspect ratio by holding shift while resizing using either method * Mouse cursor turns into resize when hovering floating border or corner
* Don't unfocus when an override redirect window is mappedLibravatar emersion2018-07-18
|
* Make focus part of transactionsLibravatar Ryan Dwyer2018-07-15
| | | | | | | | | | | | Rather than maintain copies of the entire focus stack, this PR transactionises the focus by introducing two new properties to the container state and using those when rendering. * `bool focused` means this container has actual focus. Only one container should have this equalling true in its current state. * `struct sway_container *focus_inactive_child` points to the immediate child that was most recently focused (eg. for tabbed and stacked containers).
* Fix crash when deleting last child in a tabbed or stacked containerLibravatar Ryan Dwyer2018-06-23
| | | | | There was no `current` child because the container was destroyed. This makes it fall back to looking in the parent's current children list.
* Render drag iconsLibravatar emersion2018-06-09
|
* Don't track damage for views on inactive tabsLibravatar Ryan Dwyer2018-05-21
|
* 80charLibravatar Tony Crisci2018-04-08
|
* seat focus inactive children foreachLibravatar Tony Crisci2018-04-07
|
* seat get focus inactive viewLibravatar Tony Crisci2018-04-07
|
* Give keyboard focus to unmanaged xwayland surfacesLibravatar emersion2018-04-07
| | | | This fixes dmenu
* Address review feedbackLibravatar Drew DeVault2018-04-04
|
* Implement input-inhibit in sway, swaylockLibravatar Drew DeVault2018-04-04
|
* Add input inhibitor to input managerLibravatar Drew DeVault2018-04-04
|
* Give exclusive focus to layers above shell layerLibravatar Drew DeVault2018-04-02
|
* Merge branch 'wlroots' into split-containersLibravatar Tony Crisci2018-04-02
|\
| * remove unused attachment configLibravatar Tony Crisci2018-04-02
| |
| * dont copy seat config on the seatLibravatar Tony Crisci2018-04-02
| |
| * rename seat functionsLibravatar Tony Crisci2018-04-02
| |
* | basic split containersLibravatar Tony Crisci2018-03-31
|/