aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input
Commit message (Collapse)AuthorAge
* Make raw keysyms take precedence over translatedLibravatar Ben Challenor2019-03-10
| | | | | Allows both BackSpace and Shift+BackSpace to be bound under the US keyboard layout, per #3705.
* Allow concurrent clicksLibravatar Ryan Dwyer2019-03-04
| | | | | | | | | | | | | | | | | | | | | If two cursor buttons are pressed at the same time, the client will now be notified of the second button press. The main reason for not sending the concurrent presses was due to an early return in dispatch_cursor_button if a seatop is in progress. This patch makes it call seat_pointer_notify_button prior to returning. But it also has to make sure there's not a mismatch in events such as a release without a press. Prior to this patch, the down seatop would send press and release events in its begin and finish functions. No other seatops did this. A press event would be sent prior to starting tiling drag, but never an associated release. After this patch, no seatops send their own press or release events. We send them prior to calling the seatop begin functions, then the first part of dispatch_cursor_button handles all presses during seatops and when releasing the seatop.
* floating_maximum_size: change default behaviorLibravatar Brian Ashworth2019-03-04
| | | | | | | | | | | | | This changes the way zero (which is the default) is interpreted for both the width and height of `floating_maximum_size`. It now refers to the width and height of the entire output layout, which matches i3's behavior. This also removes duplicated code to calculate the floating constraints in three files. Before this, `container_init_floating` used two-thirds of the workspace width/height as the max and the entire workspace width/height was used everywhere else. Now, all callers use a single function `floating_calculate_constraints`.
* seat: don't send button release when not pressedLibravatar emersion2019-03-04
| | | | | | | | | All seat operations except "down" eat the button pressed event and don't send it to clients. Thus, when ending such seat operations we shouldn't send the button released event. This commit moves the logic used to send pressed/released into the "down" operation.
* cursor: intitialize sx and sy to zeroLibravatar Rouven Czerwinski2019-03-04
| | | | | If node_at_coords does an early return without setting these values, they can be used uninitialized later. Initialize both to zero.
* cursor: remove unused node assignementLibravatar Rouven Czerwinski2019-03-04
| | | | | The node variable is not used before its reassigned later in the function, remove the assignement.
* Update for swaywm/wlroots#1517Libravatar emersion2019-02-25
|
* handle_seat_node_destroy: update seat->workspaceLibravatar Brian Ashworth2019-02-25
| | | | | | | If an unmanaged or layer surface is focused when an output gets disabled and an empty workspace on the output was focused by the seat, the seat needs to refocus it's focus inactive to update the value of `seat->workspace`.
* input/cursor: allow whole-window bindings on wsLibravatar Brian Ashworth2019-02-25
| | | | | To match i3's behavior, this allows mouse bindings to be triggered over a workspace when `--whole-window` is given.
* Handle NULL from output_get_active_workspaceLibravatar Brian Ashworth2019-02-25
| | | | | | | | | | 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.
* Fix drag icon map listener not removedLibravatar emersion2019-02-25
|
* Check layout before getting pointer surface coordsLibravatar Vincent Vanlaer2019-02-18
| | | | | This fixes issues of clients at the edge of the screen, like swaybar, ignoring buttons.
* seatop_move_tiling: do not move to descendantLibravatar Brian Ashworth2019-02-18
| | | | | | In seatop_move_tiling, it is possible to cause a stack overflow by dragging a container into one of its descendants. This disables the ability to move into a descendant.
* seat: allow tree focus changes while layer focusedLibravatar Brian Ashworth2019-02-18
| | | | | | This allows the focused inactive tree node and visible workspaces to be changed while a surface layer has focus. The layer temporarily loses focus, the tree focus changes, and the layer gets refocused.
* seatop_move_tiling: use tab/stack parent not selfLibravatar Brian Ashworth2019-02-18
| | | | | | | | | | | | When moving a descendant of a tabbed or stacked container, it is possible for the target node to be the node being moved. This causes a segfault in `handle_finish` since the node will be detached and then attempted to be attached to it own parent, which is NULL due to the detach. In this case, the target node should not be set to the node being moved, but the parent of the node. This also allows for a descendant of a tabbed or stacked container to be dragged out of the tabs/stacks and to be a sibling of the tabbbed/stacked container, which was not previously possible.
* cursor: relative-pointer-v1 time is usecLibravatar Brian Ashworth2019-02-18
| | | | | | In handle_cursor_motion, the timestamp passed to `wlr_relative_pointer_manager_v1_send_relative_motion` should be microseconds (not milliseconds) according to relative-pointer-v1 spec.
* Rebase cursor when a layer surface mapsLibravatar emersion2019-02-18
| | | | | | | Also removes an extraneous arrange_outputs call, it's already called if necessary in arrange_layers. Updates https://github.com/swaywm/sway/issues/3080
* input/keyboard: respect solo repeat_{rate,delay}Libravatar Brian Ashworth2019-02-11
| | | | | | If `repeat_rate` or `repeat_delay` is set without the other being set, the default was being used for both. This changes the logic to respect the value given and use the default for the other when only one is set.
* bar_cmd_modifier: add support for noneLibravatar Brian Ashworth2019-02-11
| | | | | | | | sway-bar(5) documents `modifier none`, which comes from i3. This implements the functionality for `modifier none` since it was not previously implemented. The bar modifier toggles visibility of the bar when the bar mode is set to hide. When the bar modifier is set to `none`, the ability to toggle visibility of the bar will be disabled.
* seat_configure_tablet_tool: configure xcursorLibravatar Brian Ashworth2019-02-11
| | | | | | | | | | | | | Since a tablet tool provides the WL_SEAT_CAPABILITY_POINTER capability, sway will attempt to use the xcursor manager to set a cursor image. If the tablet tool was the first (and possibly only) device to provide the capability for the seat, the xcursor manager was not being configured before attempting to set a cursor image. This was due to `seat_configure_xcursor` only being called in `seat_configure_pointer`. Since the xcursor manager was NULL in this case, it would cause a segfault when attempting to set a cursor image. This adds a call to `seat_configure_xcursor` in `seat_configure_tablet_tool` to ensure that the seat has a xcursor manager.
* 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.
* Focus ws inactive node with focus_follows_mouseLibravatar vilhalmer2019-02-11
|
* Merge pull request #3563 from ↵Libravatar Brian Ashworth2019-02-11
| | | | | vilhalmer/fix-wildcard-seat-constrain-crashes-during-reconfig Fix wildcard seat constrain crashes during reconfig
* Merge pull request #3543 from emersion/relative-pointer-usecLibravatar Drew DeVault2019-02-01
|\ | | | | relative-pointer-v1: time is in usec, not msec
| * relative-pointer-v1: time is in usec, not msecLibravatar emersion2019-01-30
| |
* | pointer_constraint: change to a seat subcommandLibravatar Brian Ashworth2019-01-31
|/ | | | | | | | | | | | This changes the `pointer_constraint` command to be a subcommand of seat to allow for per-seat settings. The current implementation that is not a seat subcommand will only operate on the current seat and will segfault in the config due to `config->handler_context.seat` only being set at runtime. This also allows for the wildcard identifier to be used to alter the pointer constraint settings on all seats and allows for the setting to be merged with the rest of the seat config.
* Send pointer frames on tool eventsLibravatar Drew DeVault2019-01-30
|
* Missed a spot in pointer constraintsLibravatar Drew DeVault2019-01-30
|
* Add pointer_constraint commandLibravatar Drew DeVault2019-01-30
|
* Add relative pointerLibravatar absrd2019-01-30
|
* Implement pointer-constraints-unstable-v1Libravatar Las2019-01-30
|
* Merge pull request #3423 from RyanDwyer/fullscreen-globalLibravatar Drew DeVault2019-01-27
|\ | | | | Implement fullscreen global
| * Implement fullscreen globalLibravatar Ryan Dwyer2019-01-25
| |
* | Update for swaywm/wlroots#1503Libravatar emersion2019-01-27
| |
* | Use sway_log_errno instead of strerrorLibravatar Ian Fan2019-01-24
|/
* Update for swaywm/wlroots#1402Libravatar emersion2019-01-24
|
* seat_create: set initial focus for added seatsLibravatar Brian Ashworth2019-01-22
| | | | | | This sets the initial focus for all seats other than the first seat, which gets it focus on launch. The ensures that all seats have something focused.
* Move sway-specific functions in common/util.c into sway/Libravatar M Stoeckl2019-01-21
| | | | | | Modifier handling functions were moved into sway/input/keyboard.c; opposite_direction for enum wlr_direction into sway/tree/output.c; and get_parent_pid into sway/tree/root.c .
* 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.
* Fix crash in cursor_rebase with multiple screensLibravatar emersion2019-01-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Designing the output configuration sequence without invalid state is tricky. We have one function, apply_output_config, that takes an output and (besides other things) performs a modeset and inserts the output in the output layout. The modeset can fail, in which case we don't want the output to be enabled. We also have an output_enable function, which calls output_apply_config and also configures the output's workspace and inserts it in the root container. Now, we have two choices. Either we configure the output before it's been inserted in the root container and then, if the modeset was successful, we insert it and create the workspace. The main issue with this approach is that configuring the output triggers a handful of signals, namely wlr_output.mode and wlr_output_layout.change. In those event handlers, we need to make sure to ignore these outputs in the process of being configured. Either we first insert the output, create the workspace and then try to configure it. It means we need to undo everything if the modeset fails. The main issue with this solution is that it enables and disables the output very quickly, creates a workspace and immediately destroys it, and maybe moves views back and forth (see output_evacuate). I've tried to make it so an output isn't enabled then immediately disabled. We already have code for ignoring outputs when the output is being destructed. Fixes https://github.com/swaywm/sway/issues/3462
* 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`.
* seatop_begin_down: raise floatingLibravatar Brian Ashworth2019-01-15
| | | | | In `seatop_begin_down`, raise the floating container. This appears to have been dropped in the transition to seatops.
* cursor: send clear_focus on hide and enter event on unhideLibravatar Rouven Czerwinski2019-01-15
| | | | | | | | | | | | Clear the focus when we hide the cursor and show it again during the unhide action. The unhide function will rebase the cursor after the unhide. Tested by looking at the WAYLAND_DEBUG=1 output of termite. Also call cursor_handle_activity before sending pointer events to send the enter events to the surface if the cursor was hidden before. Fixes #3431
* Resize only current and immediate siblings rather than all siblingsLibravatar Ryan Dwyer2019-01-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | For example, create layout V[view view view] and resize the leftmost view using mod+rightclick. Previously, the edge between view 2 and 3 would be adjusted as well. Now this edge will remain constant, which matches the behaviour of i3. To do this operation correctly, the resize tiling seatop now keeps track of two containers, as the container that resizes horizontally will be a different container to the one which resizes vertically (one will be an ancestor). The tiling resize seatop now figures out these containers during the start of the operation and keeps references to them in the event. A new function container_find_resize_parent has been introduced to do this. This function is also used by the resize command. During cursor motion, the seatop logic is similar to before, but now has to choose the correct container to resize. In resize.c, container_resize_tiled and resize_tiled have been merged into one. One of them originally did nothing except pass the values through to the other. container_resize_tiled now takes a simplified approach where it just finds the immediate siblings on either side and resizes them without worrying about the others. The parellel_coord and parallel_size functions are no longer needed and have been removed.
* Disarm key repeat on reloadLibravatar Brian Ashworth2019-01-14
| | | | | | When resetting the keyboard during reload, disarm the key repeat on all keyboards since the bindings (and possibly keyboard) will be freed before the key repeat can go off.
* Merge pull request #3343 from RedSoxFan/seat-cursor-buttons-improvedLibravatar Drew DeVault2019-01-13
|\ | | | | Improve mouse button parsing: seat cursor buttons
| * seat_cmd_cursor: utilize mouse button helpersLibravatar Brian Ashworth2019-01-10
| | | | | | | | | | | | | | | | | | | | This modifies `seat_cmd_cursor` to utilize `get_mouse_button` when parsing mouse buttons for the `press` and `release` operations. All x11 buttons, button event names, and button event codes are supported. For x11 axis buttons, `dispatch_cursor_axis` is used instead of `dispatch_cursor_button`. However the `press`/`release` state is ignored and the either axis event is processed. This also removes support for `left` and `right` in favor of `BTN_LEFT` and `BTN_RIGHT`.
* | Merge pull request #3342 from RedSoxFan/scroll-buttons-improvedLibravatar Drew DeVault2019-01-13
|\ \ | | | | | | Improve mouse button parsing: input scroll_button