aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input
Commit message (Collapse)AuthorAge
...
* Fix dormant cursor when using multiple seatsLibravatar Ryan Dwyer2018-10-23
| | | | | | The cursor's image would be removed or set when the seat's capabilities were updated, but there was nothing to prevent the image from being set at other times.
* 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).
* Merge pull request #2888 from RyanDwyer/remove-raise-floatingLibravatar Drew DeVault2018-10-20
|\ | | | | Remove raise_floating directive
| * Remove raise_floating directiveLibravatar Ryan Dwyer2018-10-20
| | | | | | | | | | | | | | | | | | | | | | | | | | The directive controlled whether floating views should raise to the top when the cursor is moved over it while using focus_follows_mouse. The default was enabled, which is undesirable. For example, if you have two floating views where one completely covers the other, the smaller one would be inaccessible because moving the mouse over the bigger one would raise it above the smaller one. There is no known use case for having raise_floating enabled, so this patch removes the directive and implements the raise_floating disabled behaviour instead.
* | 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).
* Merge pull request #2872 from RyanDwyer/cursor-rebaseLibravatar Drew DeVault2018-10-20
|\ | | | | Introduce cursor_rebase
| * Introduce cursor_rebaseLibravatar Ryan Dwyer2018-10-19
| | | | | | | | | | This function "rebases" the cursor on top of whatever is underneath it, without triggering any focus changes.
* | Fix crash when ending tiling dragLibravatar Ryan Dwyer2018-10-20
|/ | | | | | | If the container being dragged has a parent that needs to be reaped, it must be reaped after we've reinserted the dragging container into the tree. During reaping, handle_seat_node_destroy tries to refocus the dragging container which isn't possible while it's detached.
* 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.
* Merge pull request #2875 from RedSoxFan/input-device-bindingsLibravatar Drew DeVault2018-10-19
|\ | | | | cmd_bind{sym,code}: Implement per-device bindings
| * cmd_bind{sym,code}: Implement per-device bindingsLibravatar Brian Ashworth2018-10-18
| | | | | | | | | | bindsym --input-device=<identifier> ... bindcode --input-device=<identifier> ...
* | 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.
* Merge pull request #2820 from Emantor/fix-mouse-warping-containerLibravatar Drew DeVault2018-10-17
|\ | | | | Fix mouse warping container
| * seat: use new warping functions for cursor warping during focus warpLibravatar Rouven Czerwinski2018-10-16
| |
| * cursor: functions to warp cursor to container and workspaceLibravatar Rouven Czerwinski2018-10-16
| | | | | | | | | | | | The new functions allow a cursor to be warped without changing the focus. This is a preparation commit to handle cursor warping not only in seat_set_focus_warp.
* | 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.
* | swaybar: show hidden bar on key eventLibravatar Ian Fan2018-10-14
|/ | | | | | Since wayland does not currently allow swaybar to create global keybinds, this is handled within sway and sent to the bar using a custom event, so as not to pollute existing events, called bar_state_update.
* Add libinput send_events config for touchLibravatar Thiago Mendes2018-10-10
|
* Merge pull request #2806 from v-gu/add-libinput-support-for-keyboardLibravatar Drew DeVault2018-10-10
|\ | | | | add libinput config for keyboard
| * add libinput config for keyboardLibravatar Vincent Gu2018-10-09
| | | | | | | | add send_events support
* | Merge branch 'master' into mouse-warping-containerLibravatar Ryan Dwyer2018-10-10
|\ \
| * | Fix floating click eventsLibravatar Ryan Dwyer2018-10-10
| |/ | | | | | | | | | | | | | | * Set focus to a floating container when clicking its title bar. * Raise floating when user clicks title bar or decorations (in the seat_begin functions). * In container_at, it only returned a floating container if the user had clicked the surface. This makes it use floating_container_at instead.
* / Add mouse_warping containerLibravatar Rouven Czerwinski2018-10-10
|/ | | | | | | This option always moves the cursor into the middle of the container if the warp variable is true in seat_set_focus_warp. Fixes #2577
* Introduce container_is_transient_forLibravatar Ryan Dwyer2018-10-08
|
* Implement popup_during_fullscreenLibravatar Ryan Dwyer2018-10-08
| | | | | | | | | | This introduces a new view_impl function: is_transient_for. Similar to container_has_ancestor but works using the surface parents rather than the tree. This patch modifies view_is_visible, container_at and so on to allow transient views to function normally when they're in front of a fullscreen view.
* Remove unneeded variableLibravatar Ryan Dwyer2018-10-08
|
* Reload config using idle eventLibravatar Ryan Dwyer2018-10-08
| | | | | | | | | | | | | | | | This patch makes it so when you run reload, the actual reloading is deferred to the next time the event loop becomes idle. This avoids several use-after-frees and removes the workarounds we have to avoid them. When you run reload, we validate the config before creating the idle event. This is so the reload command will still return an error if there are validation errors. To allow this, load_main_config has been adjusted so it doesn't apply the config if validating is true rather than applying it unconditionally. This also fixes a memory leak in the reload command where if the config failed to load, the bar_ids list would not be freed.
* Move sticky containers when switching workspace via criteriaLibravatar Ryan Dwyer2018-10-06
| | | | | | | | | | | | | | | | | | | | | | * Create a view on workspace 1 * Switch to workspace 2 (on the same output) and create a floating sticky view * Use criteria to focus the view on workspace 1 Previously, we only moved the sticky containers when using workspace_switch, but the above method of focusing doesn't call it. This patch relocates the sticky-moving code into seat_set_focus_warp. A side effect of this patch is that if you have a sticky container focused and then switch workspaces, the sticky container will no longer be focused. It would previously retain focus. In seat_set_focus_warp, new_output_last_ws was only set when changing outputs, but now it's always set. This means new_output_last_ws and last_workspace might point to the same workspace, which means we have to make sure we don't destroy it twice. It now checks to make sure they're different, and to make this more obvious I've moved both calls to workspace_consider_destroy to be next to each other.
* Fix crash when flattening container after movingLibravatar Ryan Dwyer2018-10-05
| | | | | | | | | | container_flatten removes the container from the tree (via container_replace) before destroying it. When destroying, the recent changes to handle_seat_node_destroy incorrectly assumes that the container has a parent. This adds a check for destroying a container which is no longer in the tree. If this is the case, focus does not need to be changed.
* Fix #2763Libravatar Drew DeVault2018-10-04
|
* Merge pull request #2760 from RyanDwyer/swaylock-handle-output-disconnectLibravatar emersion2018-10-04
|\ | | | | Give focus to another swaylock surface when output is disconnected
| * Give focus to another swaylock surface when output is disconnectedLibravatar Ryan Dwyer2018-10-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Have multiple outputs * Launch swaylock * Unplug an output (possibly has to be the last "connected" one) * The swaylock surface on the remaining output would not respond to key events This was happening because when the output destroys, focus was not given to the other swaylock surface. This patch makes focus be transferred to another surface owned by the same Wayland client, but only if input was inhibited by the surface being destroyed, and only if it's in the overlay layer. I figure it's best to be overly specific and relax the requirements later if needed. This patch removes a check in seat_set_focus_surface which was preventing focus from being passed from a layer surface to any other surface. I don't know of a use case for this check, but it's possible that this change could produce issues.
* | Ignore unrelated cursor buttons while doing seat operationsLibravatar Ryan Dwyer2018-10-04
|/ | | | | | | | | | | | | | * Click and hold a scrollbar * Drag the cursor onto another surface * While still holding the original button, press and release another cursor button * Things get weird There's two ways to fix this. Either cancel the seat operation and do the other click, or continue the seat operation and ignore the other click. I opted for the latter (ignoring the click) because it's easier to implement, and I suspect a second click during a seat operation is probably unintentional anyway.
* Fix focusing topmost floating windowsLibravatar Jonathan Buch2018-10-03
| | | | | | | | | | | | Re-focus on the container on which the cursor hovers over. A special case is, if there are menus or other subsurfaces open in the focused container. It will prefer the focused container as long as there are subsurfaces. This commit starts caching the previous node as well as the previous x/y cursor position. Re-calculating the previous focused node by looking at the current state of the cursor position does not work, if the environment changes.
* Simplify raising a container in seatLibravatar Jonathan Buch2018-10-03
| | | | | * Factor out raising a floating window into s separate function to enable reuse.
* Add configuration for raising containers on focusLibravatar Jonathan Buch2018-10-03
| | | | | | | * New configuration option: raise_floating (From the discussion on https://github.com/i3/i3/issues/2990) * By default, it still raises the window on focus, otherwise it will raise the window on click.
* Add sanity check for empty focus stackLibravatar Ryan Dwyer2018-10-03
|
* 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.
* | Set focus_inactive on a sibling when a container closes in an inactive workspaceLibravatar Ryan Dwyer2018-10-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To reproduce the problem, create layout H[view V[view view view-focused]], then switch to another workspace and have the previously focused view in the vsplit close (eg. using criteria, or an mpv video finishing). Return to the workspace using `$mod+<num>` and the entire vsplit would be focused. This happens because handle_seat_node_destroy would only set a new focus if the currently focused view or a parent was being destroyed. To fix it, it needs to set a sibling of the destroying container to focus_inactive regardless of the current focus, then restore current focus if needed. This patch changes the function accordingly. Additionally: * The function now makes an early return if the node being destroyed is a workspace. * set_focus has been renamed to needs_new_focus. This variable is true if the head focus needs to be changed.
* | Fix smart gapsLibravatar Brian Ashworth2018-10-01
| |
* | Merge pull request #2725 from PumbaPe/add-tap-and-dragLibravatar Drew DeVault2018-09-30
|\ \ | | | | | | Add tap and drag to sway-input
| * | add tap-and-drag setting to sway-inputLibravatar PP2018-09-29
| |/
* | Turn funcs() into funcs(void)Libravatar Arkadiusz Hiler2018-09-30
| | | | | | | | If they really do not take undefined number of arguments.
* | Merge pull request #2698 from ianyfan/hide-cursorLibravatar emersion2018-09-29
|\ \ | |/ |/| Only show cursor if pointer configured
| * cursor: allow cursor_set_image to accept a NULL image to hide cursorLibravatar Ian Fan2018-09-24
| |
| * seat: only show cursor if pointer configuredLibravatar Ian Fan2018-09-24
| |