aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorLines
2019-01-10bar_cmd_bind: utilize mouse button helpersBrian Ashworth-114/+208
This modifies `bar_cmd_bindsym` to use `get_mouse_bindsym` for parsing mouse buttons. This also introduces `cmd_bar_bindcode`, which will use `get_mouse_bindcode` for parsing mouse buttons. Like sway bindings, the two commands are encapsulated in a single file with shared code. This also modifies swaybar to operate off of event codes rather than x11 button numbers, which allows for any mouse button to be used. This introduces two new IPC properties: - For `get_bar_config`, `event_code` has been added to the `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`. - Likewise for `click_events`, `event` has been added and will include the event code for the button clicked. If the event code can be mapped to a x11 button, `button` will still be the x11 button number. Otherwise, `button` will be `0`.
2019-01-10Merge pull request #3400 from ianyfan/config-braceemersion-4/+5
config.c: fix brace detection at end of file
2019-01-10config.c: fix brace detection at end of fileIan Fan-4/+5
2019-01-10Merge pull request #3341 from RedSoxFan/mouse-bindings-improvedIan Fan-55/+157
Improve mouse button parsing: helpers and bind{code/sym}
2019-01-10Merge pull request #3394 from RedSoxFan/bar-block-renderemersion-41/+45
swaybar: fix rendering of border and background
2019-01-10Merge pull request #3399 from RedSoxFan/fix-output-destruction-segfaultsemersion-1/+5
Fix segfaults on output destruction
2019-01-10Fix segfaults on output destructionBrian Ashworth-1/+5
This fixes two causes of segfaulting when an output is destroyed. The first occurred when an output was never enabled. The issue was that the destroy signal was never initialized so when it was emitted, sway segfaulted. This was fixed by moving the initialization into `output_create` since all outputs, regardless of whether they have ever been enabled, will be destroyed at some point. The second occurred when the cursor was on an output that was being destroyed. The sway output would have already been removed, but if there are other outputs, a cursor rebase would still occur. Since the wlr_output still existed and the sway output was destroyed, the cursor could be over nothing, resulting in a segfault when trying to get the sway output, which was destroyed.
2019-01-09swaybar: fix rendering of border and backgroundBrian Ashworth-41/+45
This fixes the rendering of borders and backgrounds for blocks. This also makes the following changes: * both borders and padding are scaled with the output * both lines and rectangles are rendered without an antialiasing to avoid bleeding outside the desired area
2019-01-10Merge pull request #3396 from RedSoxFan/scroll-titlebar-borderemersion-1/+3
cursor: allow scrolling tabs/stack on title border
2019-01-09cursor: allow scrolling tabs/stack on title borderBrian Ashworth-1/+3
This allows tabbed and stacked containers to be scrolled through when the cursor is over the border of the title bar. The borders around the other three edges of the contents should not be affected by this change.
2019-01-09bind{code,sym}: utilize mouse button helpersBrian Ashworth-55/+84
This modifies `bindcode` and `bindsym` to use `get_mouse_bindcode` and `get_mouse_bindsym`, respectively, to parse mouse buttons. Additionally, the `BINDING_MOUSE` type has been split into `BINDING_MOUSECODE` and `BINDING_MOUSESYM` to match keys and allow for mouse bindcodes to be used. Between the two commands, all button syms and codes should be supported, including x11 axis buttons.
2019-01-09Add helpers for improved mouse button parsingBrian Ashworth-0/+73
The following helper functions have been added to aid with parsing mouse buttons from a string: 1. `get_mouse_bindsym`: attempts to parse the string as an x11 button (button[1-9]) or as an event name (ex BTN_LEFT or BTN_SIDE) 2. `get_mouse_bindcode`: attempts to parse the string as an event code and validates that the event code is a button (starts with `BTN_`). 3. `get_mouse_button`: this is a conveniency function for callers that do not care whether a bindsym or bindcode are used and attempts to parse the string as a bindsym and then bindcode. None of these functions are used in this commit. The sole purpose of this commit is to make the larger set more granular and easier to review/manipulate. There will be a series of commits following this one that will modify any command which uses a mouse button to use these helpers.
2019-01-09Reset container dimensions when moving into workspace from directionRyan Dwyer-0/+2
2019-01-09Merge pull request #3391 from jbeich/freebsdemersion-28/+0
Simplify FreeBSD build
2019-01-09Simplify evdev includes on FreeBSD by relying on up-to-date packageJan Beich-28/+0
evdev-proto is installed by a dependency, so some files have been missed: In file included from ../sway/input/cursor.c:3: /usr/local/include/libevdev-1.0/libevdev/libevdev.h:30:10: fatal error: 'linux/input.h' file not found #include <linux/input.h> ^~~~~~~~~~~~~~~ ../swaybar/i3bar.c:3:10: fatal error: 'linux/input-event-codes.h' file not found #include <linux/input-event-codes.h> ^~~~~~~~~~~~~~~~~~~~~~~~~~~
2019-01-09Merge pull request #3386 from RedSoxFan/seat-reload-waitemersion-1/+7
reload: apply seat cfgs after reading entire cfg
2019-01-09Merge pull request #3390 from RedSoxFan/execute-seatemersion-2/+1
cmd_bind: pass the seat to execute_command
2019-01-09Merge pull request #3372 from ianyfan/trayemersion-65/+98
swaybar: handle SNI signals better
2019-01-09Merge pull request #3389 from RedSoxFan/swap-context-seatemersion-1/+1
cmd_swap: use handler context seat
2019-01-09Merge pull request #3387 from RedSoxFan/keyboard-timer-before-executeemersion-6/+7
keyboard: update repeat timer before execution
2019-01-09cmd_bind: pass the seat to execute_commandBrian Ashworth-2/+1
`seat_execute_command` was incorrectly setting `config->handler_context.seat` before calling `execute_command`. Since `execute_command` was being called with a `NULL` seat argument, `execute_command` was setting `config->handler_context.seat` to the default seat. This resulted in all bindings being executed on the default seat and causing undesired behavior for devices on other seats.
2019-01-09cmd_swap: use handler context seatBrian Ashworth-1/+1
Use the handler context seat instead of the default seat
2019-01-09keyboard: update repeat timer before executionBrian Ashworth-6/+7
Since the keyboard can be destroyed by executing a binding (reloading with a different seat attachment config), update the repeat timer before executing the binding.
2019-01-09reload: apply seat cfgs after reading entire cfgBrian Ashworth-1/+7
Wait until all seat configs have been read before applying them on reload. This prevents unnecessary attachment/detachment of input devices and therefore creation/destruction of seat devices as individual lines are read.
2019-01-08Merge pull request #3385 from robertgzr/reset_output_mappingDrew DeVault-0/+6
cursor: allow mapping to all outputs
2019-01-09cursor: allow mapping to all outputsRobert Günzler-0/+6
Running `input "<input>" map_to_output *` resets the mapping to all outputs
2019-01-08swaybar: improve tray loggingIan Fan-31/+32
2019-01-08swaybar: handle SNI signals betterIan Fan-33/+65
This fixes a crash caused by callbacks not matching the right sender, and frees old values later, before they are re-assigned.
2019-01-08swaybar: free the right item during tray destructionIan Fan-3/+3
Also added a comment to make more obvious the reason for comparing sni->status[0] == 'N'
2019-01-08Merge pull request #3275 from ianyfan/remove-readlineemersion-269/+156
Rewrite strip_whitespace and remove readline.c
2019-01-08Merge pull request #3337 from RedSoxFan/fix-seat-cmd-cursoremersion-12/+37
seat_cmd_cursor: work on seat name provided
2019-01-07Add data-control-v1emersion-0/+2
2019-01-07seat: unhide the cursor if it is warped to focusRouven Czerwinski-0/+5
Unhide the cursor if container warping is enabled. Also set the image_surface to NULL during view_unmap, otherwise the cursor will try to access the surface which is currently being unmapped.
2019-01-07view: use seat_consider_warp_to_focus in view_unmapRouven Czerwinski-8/+1
The view_unmap function contained an open coded version of seat_consider_warp_to_focus, replace it with a call to the function.
2019-01-07cursor: move unhide and timeout retrieval into separate functionsRouven Czerwinski-12/+25
The unhide and timeout retrieval functions are needed in a later commit. No functional changes.
2019-01-07Merge pull request #3381 from oscarwcl/swayidle-inhibit-sleepemersion-0/+13
swayidle: Fix sleep inhibitor not being acquired
2019-01-07swayidle: Fix sleep inhibitor not being acquiredOscar Cowdery Lack-0/+13
Fixes #3377. The sleep lock file descriptor was immediately closed after it was acquired due to the dbus message being freed. Now the fd is duplicated before the message is freed so the inhibitor stays active.
2019-01-06Merge pull request #3378 from jbeich/masteremersion-2/+2
Unbreak build on 32bit platforms
2019-01-06Use %z for printing size_tJan Beich-2/+2
../sway/desktop/transaction.c:367:17: error: format specifies type 'long' but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat] transaction, transaction->num_waiting); ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/local/include/wlr/util/log.h:56:72: note: expanded from macro 'wlr_log' _wlr_log(verb, "[%s:%d] " fmt, _wlr_strip_path(__FILE__), __LINE__, ##__VA_ARGS__) ^~~~~~~~~~~ ../sway/desktop/transaction.c:477:5: error: format specifies type 'long' but the argument has type 'unsigned int' [-Werror,-Wformat] transaction->num_configures - transaction->num_waiting + 1, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/local/include/wlr/util/log.h:56:72: note: expanded from macro 'wlr_log' _wlr_log(verb, "[%s:%d] " fmt, _wlr_strip_path(__FILE__), __LINE__, ##__VA_ARGS__) ^~~~~~~~~~~ ../sway/desktop/transaction.c:478:5: error: format specifies type 'long' but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat] transaction->num_configures, ms, ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/local/include/wlr/util/log.h:56:72: note: expanded from macro 'wlr_log' _wlr_log(verb, "[%s:%d] " fmt, _wlr_strip_path(__FILE__), __LINE__, ##__VA_ARGS__) ^~~~~~~~~~~
2019-01-05Merge pull request #3367 from oscarwcl/swaylock-fix-capslockDrew DeVault-9/+5
swaylock: Fix caps lock not updating immediately
2019-01-05Fix urgency documentationRyan Dwyer-6/+7
2019-01-05Update README.mdDrew DeVault-35/+35
2019-01-04Fixed formulations.PlusMinus0-3/+3
2019-01-04Update sway-output.5.scdPlusMinus0-4/+8
Some more clarifications because it seems scale questions are recurring.
2019-01-03Apply tiling_drag_threshold to all containersDavid96-10/+8
2019-01-02completion: use jq instead of sed for swaybar completionRéouven Assouly-2/+2
2019-01-02zsh: update completionsRéouven Assouly-14/+77
2019-01-02Implement tiling_drag_thresholdBrian Ashworth-2/+91
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`.
2019-01-03swaylock: Fix caps lock not updating immediatelyOscar Cowdery Lack-9/+5
Partially fixes #2788. This change makes it so the lock screen is redrawn whenever the caps lock modifier state changes, rather on relying on the keypress event. This didn't work because caps lock is disabled when the key is released, not pressed, so the caps lock indicator does not go away until the next keypress event.
2019-01-02fixup! stringop.c: rewrite strip_whitespaceIan Fan-4/+4