Commit Graph

5473 Commits

Author SHA1 Message Date
Drew DeVault
9b5ac08682
Merge pull request #3415 from RedSoxFan/swaybar-output-improved
swaybar: allow identifiers for output and tray
2019-01-13 20:33:44 -05:00
Brian Ashworth
50d36ef238 swaybar: allow identifiers for output and tray
This allows `bar output` and `bar tray_output` to specify an output
identifier. Output names should still work as well.

This parses the output identifier from the xdg_output description,
which wlroots currently sets to `make model serial (name)`. Since this
could change in the future, all identifier comparisons are guarded by
NULL-checks in case the description cannot be parsed to an identifier.
2019-01-13 12:06:35 -05:00
Ian Fan
a43863aa60
Merge pull request #3412 from RedSoxFan/fix-cont-line-num
config: fix line number with continued lines
2019-01-12 22:05:18 +00:00
Drew DeVault
bc808680b1 Split swayidle from sway 2019-01-12 11:24:06 -05:00
Brian Ashworth
b43345a1a3 config: fix line number with continued lines
When the config has continued lines, `get_line_with_cont` may read more
than one line of the actual file. When displaying line numbers for error
messages, they should be the line number in the file to make it easy to
find and fix the issue.
2019-01-11 20:41:38 -05:00
Ian Fan
d256182f49
Merge pull request #3411 from RedSoxFan/fix-brace-detect-seeking
config: do not reset pos when braces found
2019-01-12 01:25:44 +00:00
Brian Ashworth
39975ccfb5 config: do not reset pos when braces found
When a brace is found, the config file should not seek back to before
the brace, otherwise the brace will be read multiple times.
2019-01-11 20:02:20 -05:00
Robinhuett
33d9de88ef swaylock: Add caps lock state to indicator
Implements customization for the indicator as proposed in #2788 with comments from #3367 in mind.
The default behaviour does not change exept for the caps lock text color.
2019-01-10 16:14:18 -05:00
emersion
212baf2f75
Merge pull request #3400 from ianyfan/config-brace
config.c: fix brace detection at end of file
2019-01-10 13:29:21 +01:00
Ian Fan
00f8d0209f config.c: fix brace detection at end of file 2019-01-10 10:59:07 +00:00
Ian Fan
15ac580b28
Merge pull request #3341 from RedSoxFan/mouse-bindings-improved
Improve mouse button parsing: helpers and bind{code/sym}
2019-01-10 10:55:22 +00:00
emersion
058428b8df
Merge pull request #3394 from RedSoxFan/bar-block-render
swaybar: fix rendering of border and background
2019-01-10 10:43:00 +01:00
emersion
9abac85888
Merge pull request #3399 from RedSoxFan/fix-output-destruction-segfaults
Fix segfaults on output destruction
2019-01-10 09:20:07 +01:00
Brian Ashworth
8fd3f32c79 Fix segfaults on output destruction
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-10 03:07:36 -05:00
Brian Ashworth
39873bc1f0 swaybar: fix rendering of border and background
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-09 20:28:30 -05:00
emersion
d0b9701820
Merge pull request #3396 from RedSoxFan/scroll-titlebar-border
cursor: allow scrolling tabs/stack on title border
2019-01-10 00:32:09 +01:00
Brian Ashworth
a8b3ae9284 cursor: allow scrolling tabs/stack on title border
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-09 18:15:15 -05:00
Brian Ashworth
eefa6b1ad3 bind{code,sym}: utilize mouse button helpers
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-09 11:29:04 -05:00
Brian Ashworth
6f6a9af60e Add helpers for improved mouse button parsing
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-09 11:29:04 -05:00
Ryan Dwyer
14cab78612 Reset container dimensions when moving into workspace from direction 2019-01-09 11:22:23 -05:00
emersion
f9cea7f09b
Merge pull request #3391 from jbeich/freebsd
Simplify FreeBSD build
2019-01-09 14:00:54 +01:00
Jan Beich
0a4c4f3e52 Simplify evdev includes on FreeBSD by relying on up-to-date package
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-09 11:02:05 +00:00
emersion
d06782c5e7
Merge pull request #3386 from RedSoxFan/seat-reload-wait
reload: apply seat cfgs after reading entire cfg
2019-01-09 10:01:17 +01:00
emersion
8daea2bfec
Merge pull request #3390 from RedSoxFan/execute-seat
cmd_bind: pass the seat to execute_command
2019-01-09 09:59:09 +01:00
emersion
cfdb614e84
Merge pull request #3372 from ianyfan/tray
swaybar: handle SNI signals better
2019-01-09 09:58:09 +01:00
emersion
51bc466e2b
Merge pull request #3389 from RedSoxFan/swap-context-seat
cmd_swap: use handler context seat
2019-01-09 09:54:16 +01:00
emersion
ff62425480
Merge pull request #3387 from RedSoxFan/keyboard-timer-before-execute
keyboard: update repeat timer before execution
2019-01-09 09:52:39 +01:00
Brian Ashworth
fdc262d402 cmd_bind: pass the seat to execute_command
`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-09 01:50:40 -05:00
Brian Ashworth
c4122e3975 cmd_swap: use handler context seat
Use the handler context seat instead of the default seat
2019-01-09 01:37:46 -05:00
Brian Ashworth
1feb2ce064 keyboard: update repeat timer before execution
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-09 01:07:29 -05:00
Brian Ashworth
f33969358c reload: apply seat cfgs after reading entire cfg
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-09 01:06:21 -05:00
Drew DeVault
da8f24de1d
Merge pull request #3385 from robertgzr/reset_output_mapping
cursor: allow mapping to all outputs
2019-01-08 20:36:56 -05:00
Robert Günzler
145ac2c571 cursor: allow mapping to all outputs
Running `input "<input>" map_to_output *` resets the mapping to all outputs
2019-01-09 02:33:30 +01:00
Ian Fan
f87628e2ab swaybar: improve tray logging 2019-01-08 16:03:16 +00:00
Ian Fan
d093c3ac55 swaybar: handle SNI signals better
This fixes a crash caused by callbacks not matching the right sender,
and frees old values later, before they are re-assigned.
2019-01-08 12:18:59 +00:00
Ian Fan
b666fc76a6 swaybar: free the right item during tray destruction
Also added a comment to make more obvious the reason for comparing
sni->status[0] == 'N'
2019-01-08 12:17:53 +00:00
emersion
140bc2dd5b
Merge pull request #3275 from ianyfan/remove-readline
Rewrite strip_whitespace and remove readline.c
2019-01-08 10:05:37 +01:00
emersion
353d9ed74f
Merge pull request #3337 from RedSoxFan/fix-seat-cmd-cursor
seat_cmd_cursor: work on seat name provided
2019-01-08 09:44:11 +01:00
emersion
327236a7ab Add data-control-v1 2019-01-07 17:01:53 -05:00
Rouven Czerwinski
cc858e605a seat: unhide the cursor if it is warped to focus
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-07 10:30:19 -05:00
Rouven Czerwinski
0b18560952 view: use seat_consider_warp_to_focus in view_unmap
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-07 10:30:19 -05:00
Rouven Czerwinski
fde900861a cursor: move unhide and timeout retrieval into separate functions
The unhide and timeout retrieval functions are needed in a later commit. No
functional changes.
2019-01-07 10:30:19 -05:00
emersion
bd59602711
Merge pull request #3381 from oscarwcl/swayidle-inhibit-sleep
swayidle: Fix sleep inhibitor not being acquired
2019-01-07 13:34:04 +01:00
Oscar Cowdery Lack
5a24ed2bf2 swayidle: Fix sleep inhibitor not being acquired
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-07 22:55:42 +11:00
emersion
688f4137a5
Merge pull request #3378 from jbeich/master
Unbreak build on 32bit platforms
2019-01-06 13:59:39 +01:00
Jan Beich
4a11d0e470 Use %z for printing size_t
../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-06 12:20:59 +00:00
Drew DeVault
728e5700dd
Merge pull request #3367 from oscarwcl/swaylock-fix-capslock
swaylock: Fix caps lock not updating immediately
2019-01-05 23:45:38 -05:00
Ryan Dwyer
0cc56ebe94 Fix urgency documentation 2019-01-05 23:34:04 -05:00
Drew DeVault
bb5b168b6f Update README.md 2019-01-05 15:21:11 -05:00
PlusMinus0
d87cded568 Fixed formulations. 2019-01-04 12:44:03 +01:00