aboutsummaryrefslogtreecommitdiff
path: root/sway/input
AgeCommit message (Collapse)Author
2018-08-01ipc: add window::focus eventIan Fan
2018-08-01XCursor is not configured if no pointer device is availablechr0me
2018-07-29Bindings use advised keyboard repeat parametersfrsfnrrg
Now 'repeat_delay' and 'repeat_rate' control the initial delay and rate (per second) of repeated binding invocations. If the repeat delay is zero, binding repetition is disabled. When the repeat rate is zero, the binding is repeated exactly once, assuming no other key events intervene.
2018-07-29Implement key repeat for pressed key bindingsfrsfnrrg
Each sway_keyboard is provided with a wayland timer event source. When a valid keypress binding has been found, a callback to handle_keyboard_repeat is set. Any key event will either clear the callback or (if the new key event is a valid keypress binding) delay the callback again.
2018-07-29Merge pull request #2376 from swaywm/virtual-keyboardemersion
Add virtual keyboard protocol
2018-07-28Add virtual keyboard protocolDrew DeVault
Ref #2373
2018-07-28Don't enable numlock by default. This fixes an annoying issue where laptop ↵Geoff Greer
keyboards would have 'numlock mode' enabled, remapping parts of the alphabet to numbers.
2018-07-28Merge pull request #2360 from RyanDwyer/floating-containersDrew DeVault
Allow containers to float
2018-07-28When unfloating, return container to previously focused tiled containerRyan Dwyer
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.
2018-07-28Fix clicking a floating split containerRyan Dwyer
It would focus the split container rather than the child. This commit makes it track the child and the split container separately and send the surface click to the child.
2018-07-28Allow containers to floatRyan Dwyer
Things worth noting: * When a fullscreen view unmaps, the check to unset fullscreen on the workspace has been moved out of view_unmap and into container_destroy, because containers can be fullscreen too * The calls to `container_reap_empty_recursive(workspace)` have been removed from `container_set_floating`. That function reaps upwards so it wouldn't do anything. I'm probably the one who originally added it... * My fix (b14bd1b0b1536039e4f46fe94515c7c44e7afc61) for the tabbed child crash has a side effect where when you close a floating container, focus is not given to the tiled container again. I've removed my fix and removed the call to `send_cursor_motion` from `seat_set_focus_warp`. We should consider calling it from somewhere earlier in the call stack.
2018-07-28Include errno.hRyan Dwyer
2018-07-28Show errno description in logRyan Dwyer
2018-07-28Handle out-of-fd situations gracefully for transaction and urgent timersRyan Dwyer
2018-07-26Allow containers to be fullscreenRyan Dwyer
2018-07-25Fix LEDs for configured modifier statesProgAndy
2018-07-25Implement setting NumLock and CapsLock statusProgAndy
After setting the keymap, try to enable NumLock and disable CapsLock. This only works if sway has the xkb master state and controls the keyboard. Prepare configuration settings for later use as well.
2018-07-25Merge pull request #2350 from ppascher/xwayland-optionalDrew DeVault
Added meson option to allow building sway without xwayland support
2018-07-25reverted includes of "sway/config.h" and replaced with "config.h" from meson ↵Pascal Pascher
build
2018-07-25more style fixes, included "sway/config.h" where neededPascal Pascher
2018-07-25Fix crash when closing last child of a tabbed containerRyan Dwyer
The crash only occurs if the mouse cursor is above the tabbed container when the last child is closed. Introduced in 03d49490ccff3c5c81bea73622c8616fa61eb3dd, over a week ago and unnoticed until now :O The above commit changes the behaviour of a focus change. When you change focus, it sends pointer motion which makes the client set a new cursor image. We already had this behaviour for workspace switching, but this commit adds it for view switching too, such as in a tabbed container or when closing a view. The sequence of events that leads to the crash is: * The last child of a tabbed container unmaps, which triggers a `destroy` event before we've cleaned up the child or reaped the tabbed container. * The seat code listens to the `destroy` event and removes the seat container from the focus stack. As part of this, it decides to set focus to the parent (my fix alters this decision). * When setting focus to the new parent, the container motion is sent as per the previously mentioned commit. * The motion code uses `container_at`, which encounters the tabbed container and its child in a half destroyed state, and everything blows up from there. `con->parent` is needed because scratchpad containers don't have parents if they're hidden, so this probably fixes a crash when a hidden scratchpad container closes too. The `con->parent->children->length > 1` check should catch any cases where the parent is about to be reaped.
2018-07-24Change button var passed to seat_begin_moveBrian Ashworth
2018-07-24Implement floating_modifier <mod> [inverse|normal]Brian Ashworth
2018-07-24style fixes, exclude sway/desctop/xwayland.c when enable_xwayland: falsePascal Pascher
2018-07-24Added meson option "enable_xwayland" (default: true) to enable/disable ↵Pascal Pascher
xwayland support
2018-07-24Fix crash when clicking certain surfacesRyan Dwyer
cont was NULL.
2018-07-24Make mod+resize work in any directionRyan Dwyer
This makes it so if you hold mod and right click on a surface to resize it, the resize direction is chosen based on which quarter of the surface you've clicked. The previous implementation only resized towards the bottom right.
2018-07-23Invoke mouse bindingsfrsfnrrg
The mouse binding logic is inspired/copied from the keyboard binding logic; we store a sorted list of the currently pressed buttons, and trigger a binding when the currently pressed (or just recently pressed, in the case of a release binding) buttons, as well as modifiers/container region, match those of a given binding. As the code to execute a binding is not very keyboard specific, keyboard_execute_command is renamed to seat_execute_command and moved to where the other binding handling functions are. The call to transaction_commit_dirty has been lifted out.
2018-07-23Parse mouse binding optionsfrsfnrrg
First, the existing sway_binding structure is given an enumerated type code. As all flags to bindsym/bindcode are boolean, a single uint32 is used to hold all flags. The _BORDER, _CONTENTS, _TITLEBAR flags, when active, indicate in which part of a container the binding can trigger; to localize complexity, they do not overlap with the command line arguments, which center around _TITLEBAR being set by default. The keyboard handling code is adjusted for this change, as is binding_key_compare; note that BINDING_LOCKED is *not* part of the key portion of the binding. Next, list of mouse bindings is introduced and cleaned up. Finally, the binding command parsing code is extended to handle the case where bindsym is used to describe a mouse binding rather than a keysym binding; the difference between the two may be detected as late as when the first key/button is parsed, or as early as the first flag. As bindings can have multiple keycodes/keysyms/buttons, mixed keysym/button sequences are prohibited.
2018-07-24Fix some cases where the cursor doesn't updateRyan Dwyer
cursor_set_image only uploads the named image if it doesn't match the previous named image. This means when setting the cursor image to a surface as given by a client, we have to clear the currently stored image.
2018-07-23Add missing checks to fix 2339Brian Ashworth
2018-07-22Set cursor when beginning resize and move operationsRyan Dwyer
2018-07-22Fix damage when shrinking a floating view using cursorRyan Dwyer
2018-07-22Implement request_move and request_resize for xwayland viewsRyan Dwyer
I discovered we have to send a click event when ending the move or resize operation to make xwayland's requests work correctly.
2018-07-22Fix focus bug with floating containersRyan Dwyer
2018-07-22Consider view's min/max sizes when resizingRyan Dwyer
2018-07-22Store last button and use it when views request to move or resizeRyan Dwyer
2018-07-22Prevent re-uploading the same cursor image multiple timesRyan Dwyer
2018-07-22Replace static handle_end_operation with seat_end_mouse_operationRyan Dwyer
2018-07-22Implement xdg shell request_move and request_resize eventsRyan Dwyer
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
2018-07-22Use wlr_keyboard_get_modifiersRyan Dwyer
2018-07-22Use separate function for choosing edge cursorRyan Dwyer
2018-07-22Fix clicking xwayland menusRyan Dwyer
2018-07-22Use max multiplier when resizing while preserving ratioRyan Dwyer
2018-07-22Make mod + resize do it from the top left cornerRyan Dwyer
2018-07-22Use WLR_MODIFIER_SHIFTRyan Dwyer
2018-07-22Implement floating_modifier and mouse operations for floating viewsRyan Dwyer
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
2018-07-21Fix urgent timer logic and remove unnecessary header includesRyan Dwyer
2018-07-21Implement force_display_urgency_hintRyan Dwyer
The directive sets the timeout before an urgent view becomes normal again after switching to it from another workspace. Also: * When an xwayland surface removes the urgent hint while the timer is active, we now ignore the request. This happens as soon as the view receives focus, so it was effectively making the timer pointless. * The timeout is now only applied when switching to it from another workspace.
2018-07-19Fix crash and render issues involving cursor_send_pointer_motionRyan Dwyer
Fixes #2303, as well as a crash. To replicate the crash: * Have multiple outputs * In config: for_window [<criteria>] workspace foo * Also in config: workspace foo output <left-output-name> * Focus the right output, and ensure workspace foo doesn't exist * Launch the app that triggers the criteria When the view maps, it calls workspace_switch which calls send_set_focus which calls cursor_send_pointer_motion which calls transaction_commit_dirty. This call to transaction_commit_dirty is not meant to happen at this time because the tree isn't guaranteed to be in a consistent state, but I'm not sure how exactly this leads to the crash or render issues. In this case the transaction is already committed by the view implementation's handle_map function. So the solution is to remove it from cursor_send_pointer_motion and add it to the other functions in cursor.c which call cursor_send_pointer_motion.