Commit graph

4785 commits

Author SHA1 Message Date
Ryan Dwyer 7661c71b33 Update gaps documentation 2018-09-29 12:59:02 +10:00
Ryan Dwyer bb708d0f82 Don't allow negative gaps 2018-09-29 12:58:54 +10:00
Ryan Dwyer 415a48ac63 Make gaps implementation consistent with i3-gaps
This changes our gaps implementation to behave like i3-gaps.

Our previous implementation allowed you to set gaps on a per container
basis. This isn't supported by i3-gaps and doesn't seem to have a
practical use case. The gaps_outer and gaps_inner properties on
containers are now removed as they just read the gaps_inner from the
workspace.

`gaps inner|outer <px>` no longer changes the gaps for all workspaces.
It only sets defaults for new workspaces.

`gaps inner|outer current|workspace|all set|plus|minus <px>` is now
runtime only, and the workspace option is now removed. `current` now
sets gaps for the current workspace as opposed to the current container.

`workspace <ws> gaps inner|outer <px>` is now implemented. This sets
defaults for a workspace.

This also fixes a bug where changing the layout of a split container
from linear to tabbed would cause gaps to not be applied to it until you
switch to another workspace and back.
2018-09-29 11:08:19 +10:00
Drew DeVault dc01e884f7
Merge pull request #2724 from RedSoxFan/update-man-pages
Update man pages - dynamic vars and generic blocks
2018-09-28 22:07:27 +02:00
Brian Ashworth a9d9944e76 sway{,bar,input}.5: changes for generic blocks 2018-09-28 13:30:54 -04:00
Brian Ashworth cc6544c538 sway.5: update set command information 2018-09-28 13:30:54 -04:00
Drew DeVault ca7084cb52
Merge pull request #2723 from ianyfan/swaybar
swaybar: small fixes and clean-ups
2018-09-28 16:44:35 +02:00
Ian Fan 25e1f32738 swaybar: trim function prototypes 2018-09-28 14:09:33 +01:00
Ian Fan 751bb4a376 swaybar: move i3bar definitions into separate file 2018-09-28 13:54:58 +01:00
Ian Fan bcd2a8fe12 swaybar: remove unused focused_output property 2018-09-28 13:54:58 +01:00
Ian Fan 98576b9dda swaybar: fix setting binding mode indicator 2018-09-28 13:48:59 +01:00
Ian Fan 312d009f65 swaybar: fail if bar id is invalid 2018-09-28 13:48:59 +01:00
emersion 02df1e2b1b
Merge pull request #2722 from RyanDwyer/workspace-configs
Rename workspace_outputs to workspace_configs and fix memory leak
2018-09-28 14:45:08 +02:00
Ryan Dwyer 56e9f31b2f Check for NULL output in workspace_valid_on_output 2018-09-28 22:35:38 +10:00
Ryan Dwyer 138d10d5d6 Rename workspace_outputs to workspace_configs and fix memory leak
When we eventually implement `workspace <ws> gaps inner|outer <px>`,
we'll need to store the gaps settings for workspaces before they're
created. Rather than create a workspace_gaps struct, the approach I'm
taking is to rename workspace_outputs to workspace_configs and then add
gaps settings to that.

I've added a lookup function workspace_find_config. Note that we have a
similar thing for outputs (output_config struct and output_find_config).

Lastly, when freeing config it would create a memory leak by freeing the
list items but not the workspace or output names inside them. This has
been rectified using a free_workspace_config function.
2018-09-28 22:35:38 +10:00
emersion 1698260533
Merge pull request #2720 from swaywm/swaylock-shadow
Add support for building swaylock without PAM
2018-09-28 14:17:37 +02:00
Drew DeVault c977349120 Add support for building swaylock without PAM
This involves setuid'ing swaylock, which then forks and drops perms on
the parent process. The child process remains root and listens on a pipe
for requests to validate passwords against /etc/shadow.
2018-09-28 13:53:01 +02:00
Drew DeVault 813de9f7ac
Merge pull request #2716 from sghctoma/fix-swaybar-freebsd
Replace getdelim to make swaybar work on FreeBSD
2018-09-28 04:22:18 -05:00
Ryan Dwyer 5104bd2c59
Merge pull request #2663 from ianyfan/fix-txn-state-leaks
Free transaction state upon destruction by removing pointer indirection
2018-09-28 18:27:01 +10:00
Ian Fan 0dfcadc1cf transaction: do not use pointers for state 2018-09-28 09:18:24 +01:00
Drew DeVault 0b2afee711
Merge pull request #2719 from RyanDwyer/fix-view-is-visible
Fix floating views in tabbed/stacked workspaces not getting frame events
2018-09-28 02:12:18 -05:00
Ryan Dwyer 22412f57b0 Fix floating views in tabbed/stacked workspaces not getting frame events
view_is_visible would return false, which meant the view wouldn't
receive a frame done event. view_is_visible needs to make an exception
for floating containers.

This also moves the workspace_is_visible check to an earlier location
for performance reasons.
2018-09-28 17:02:35 +10:00
Drew DeVault 58af001517
Merge pull request #2717 from ianyfan/tablet-config
input config: merge left_handed option
2018-09-27 04:17:53 -05:00
Ian Fan a6c5628fa7 input config: merge left_handed option 2018-09-27 09:25:43 +01:00
Drew DeVault 5912be46c3
Merge pull request #2704 from ianyfan/tablet-config
input: enable configuring tablets with libinput
2018-09-27 02:07:15 -05:00
Drew DeVault d00a581ae0
Merge pull request #2715 from sghctoma/add-c11_source
Use _C11_SOURCE feature test macro on FreeBSD (fixes #2616)
2018-09-26 16:37:23 -05:00
sghctoma 315b2bf100 Replace getdelim to make swaybar work on FreeBSD
This commit fixes a segfault in swaybar on FreeBSD that was caused by
using getdelim with EOF as delimiter on an infinite stream. The FreeBSD
implementation handles the "no more data, delimiter not found, and EOF
not reached" scenario as an error, so it can't be used to read the
output of status command. This commit replaces the getline/getdelim
calls with reading all available data from the stream in one go.
2018-09-26 20:38:16 +02:00
sghctoma 2f258eff6f Make sway/ipc-server.c POSIX 2001 compliant
This commit replaces the non-standard SOCK_NONBLOCK and SOCK_CLOEXEC
flags with two fcntl calls. This makes the file POSIX 2001 compliant,
thus it is no longer necessary to conditionally define, or use internal
(__BSD_VISIBLE) feature test macros.
2018-09-26 20:10:53 +02:00
sghctoma 3e924f2345 Add _C11_SOURCE feature test macro on FreeBSD
This will restrict the default namespace set on FreeBSD to the C11
standard (everything is visible by default), which will prevent possible
conflicts with symbols hidden behing __BSD_VISIBLE.
2018-09-26 20:05:45 +02:00
Drew DeVault a8a0014e0f Make libpam optional 2018-09-26 17:32:15 +02:00
Drew DeVault 1ef96f7fb7
Merge pull request #2713 from RyanDwyer/fix-remap-race
Fix race condition crash when view unmaps + maps quickly
2018-09-26 07:39:13 -05:00
Ryan Dwyer 4e4898e90f Fix race condition crash when view unmaps + maps quickly
When a view unmaps, we start a transaction to destroy the container,
then when the transaction completes we destroy the container and unset
the view's container pointer. But if the view has remapped in the
meantime, the view's container pointer will be pointing to a different
container which should not be cleared.

This adds a check to make sure the view is still pointing to the
container being destroyed before clearing the pointer. The freeing of
the title format is also removed as it is already freed when the view
destroys in view_destroy.
2018-09-26 21:33:54 +10:00
Brian Ashworth c43374cdf0
Merge pull request #2712 from alexbakker/fix-crash
Add a missing null check for moving tiling containers
2018-09-25 16:46:38 -04:00
Alexander Bakker d129108cdd Add a missing null check for moving tiling containers 2018-09-25 22:19:46 +02:00
emersion 08815f9cfb
Merge pull request #2708 from RyanDwyer/fix-output-disconnect-crash
Fix crash when disconnecting output
2018-09-25 09:36:25 +02:00
Ryan Dwyer b1a0e95e8e Fix crash when disconnecting output
If the output being disconnected contains views, and the views are being
relocated to another output of a different size, a transaction must
occur to reconfigure them. This means by the time
container_discover_outputs is called, the output is already disabled and
wlr_output is NULL.

I considered making it check output->wlr_output, but output->enabled
should work just as well and is more descriptive.
2018-09-25 08:21:22 +10:00
Ian Fan 6194a445d3 input: enable configuring tablets with libinput 2018-09-24 12:49:20 +01:00
emersion a032925ae7
Merge pull request #2701 from RedSoxFan/input-wildcard
Implement support for input wildcard
2018-09-24 10:43:18 +02:00
Brian Ashworth baeb28ea62 Implement support for input wildcard 2018-09-23 19:56:52 -04:00
emersion 4a4f07ac25
Merge pull request #2699 from RedSoxFan/fix-2667
swaybg: fix increasingly smaller bg on hotplug
2018-09-23 21:44:57 +02:00
Brian Ashworth 9ea99a5d36 swaybg: fix increasingly smaller bg on hotplug
render_background_image alters the scale that cairo uses. Depending on
the image mode, resolution, and image size, this may cause the surface
to be rendered increasingly smaller. By calling cairo_save and
cairo_restore, any changes to the cairo settings by the function are
not kept as a side effect.

The surface that swaybg uses is also now cleared before rendering a frame.
This is needed to avoid artifacts on resolution or scale changes with
certain combinations of image modes, resolutions, and image sizes. This
was also part of the increasingly smaller background visual since it
made it so it was not obvious the region being rendered to was smaller
and caused an increasing number of smaller images to be appear for each
hotplug.
2018-09-23 15:17:36 -04:00
Drew DeVault 0bc9dc192f
Merge pull request #2696 from RyanDwyer/fix-gtkmenubar
Fix GtkMenuBar always opening first item
2018-09-23 07:18:09 -05:00
Ryan Dwyer 271b24ddfb Fix GtkMenuBar always opening first item
It seems like advertising that we support touch when we don't, while
using SSD, makes GtkMenuBar misbehave. Please don't ask me why...
2018-09-23 22:00:18 +10:00
Drew DeVault c2c257b884
Merge pull request #2695 from RyanDwyer/remove-moveoutoftabsstacks
Remove move_out_of_tabs_stacks
2018-09-23 06:19:12 -05:00
emersion 4bc327a021
Merge pull request #2694 from RyanDwyer/fix-sticky-jumping-on-switch
Prevent sticky containers from jumping on workspace switch
2018-09-23 09:42:07 +02:00
emersion 1af4d314d1
Merge pull request #2686 from RyanDwyer/tab-scrolling
Implement tab cycling using mouse wheel
2018-09-23 09:39:53 +02:00
Ryan Dwyer 9753e52d6b Flatten container in workspace_rejigger 2018-09-23 14:32:26 +10:00
Ryan Dwyer 0b7fb6943e Fix some bugs as a result of removing move_out_of_tabs_stacks 2018-09-23 13:55:06 +10:00
Ryan Dwyer 93624599b3 Remove move_out_of_tabs_stacks
This fixes the following. Create these layouts and run move right:

(Initial layout -> expected result -> actual result)

* `H[S[unfocused focused] unfocused]` ->
`H[S[unfocused] focused unfocused]` ->
`H[H[S[unfocused] focused] unfocused]`
* `H[S[unfocused focused] V[unfocused]]` ->
`H[S[unfocused] V[unfocused focused]]` ->
`H[H[S[unfocused] focused] V[unfocused]]`

move_out_of_tabs_stacks was originally made to allow views to move out
of the tabbed/stacked container in the parallel direction, but at some
point this has started working using the regular logic.
2018-09-23 13:10:36 +10:00
Ryan Dwyer 64445f4214 Prevent sticky containers from jumping on workspace switch
If you have swaybar docked to the top, and you create a floating sticky
container and switch workspaces on the same output, the sticky container
would move down by the height of swaybar on each switch.

This happens because when creating the workspace we set the dimensions
to the same as the output, then the subsequent arrange corrects it.
During this arrange, floating containers are translated so they stay
relative to the workspace. This translation needs to not occur for the
initial arrange.

This patch makes workspaces have a zero width and height when first
created, so we can detect whether this is the initial arrange and avoid
translating the floating containers if so.
2018-09-23 11:36:16 +10:00