aboutsummaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)AuthorLines
2018-11-28Implement bar gapsBrian Ashworth-0/+8
Adds the bar subcommand `gaps <amount>|<horizontal> <vertical>|<top> <right> <bottom> <left>` to set gaps for swaybar. Due to restrictions on margins for a layer_surface, only the sides that are anchored to an edge of the screen can have gaps. Since there is support for per-side outer gaps for workspaces, those should be able to be used instead for the last side.
2018-11-28Introduce a way to show config warnings in swaynagBrian Ashworth-0/+7
Adds the function `config_add_swaynag_warning(char *fmt, ...)` so that handlers can add warnings to the swaynag config log in a uniform way. The formatting is identical to errors and include the line number, line, and config path. This also alters the background file access warning to use the function and introduces a warning for duplicate bindings.
2018-11-28Fix segfault when destroying unmapped child viewemersion-0/+1
2018-11-28Merge pull request #3199 from emersion/handle-subsurface-destroyRyan Dwyer-0/+6
Handle destroyed subsurfaces
2018-11-28Merge pull request #3207 from RedSoxFan/swaynag-no-term-buttonsemersion-0/+1
Implement swaynag -B/--button-no-terminal
2018-11-27Implement swaynag -B/--button-no-terminalBrian Ashworth-0/+1
In `i3 4.16`, `i3-nagbar` introduces the flags `-B/--button-no-terminal` to run the action directly instead of inside a terminal. This implements the flags for swaynag for compatibility. Since swaynag does not use an equivalent to `i3-sensible-terminal`, the flags `-b/--button` only uses a terminal when the environment variable `TERMINAL` is set, otherwise it acts the same as these new flags.
2018-11-27Change execute_command to return a list of resultsBrian Ashworth-3/+3
This matches i3's behavior of returning a list of results that contain the result of each command that was executed. Additionally, the `parse_error` attribute has been added to the IPC JSON reply.
2018-11-27Handle destroyed subsurfacesemersion-0/+6
Damage subsurfaces when they are destroyed. Since subsurfaces don't have an unmap event we need to do that on destroy. We also don't want to keep a sway_view_child when the wlr_subsurface has been destroyed. Fixes https://github.com/swaywm/sway/issues/3197
2018-11-25Implement title alignmentBrian Ashworth-0/+8
This adds support for `i3 4.16`'s ability to set the title alignment. The command is `title_align left|center|right`. When the title is on the right, marks are moved to the left. Otherwise, they are on the right.
2018-11-22Adding commands for configuring titlebar borders and paddingFlorent de Lamotte-6/+5
2018-11-19Merge pull request #3083 from c-edw/feature/StripWorkspaceNameemersion-0/+4
Implement strip_workspace_name.
2018-11-18Add scroll factor config option.Spencer Michaels-0/+8
2018-11-18Use #if instead of #ifdefemersion-16/+20
2018-11-17Implement strip_workspace_name.Connor E-0/+4
2018-11-17Move view {x,y,width,height} into container structRyan Dwyer-10/+8
This renames/moves the following properties: * sway_view.{x,y,width,height} -> sway_container.content_{x,y,width,height} * This is required to support placeholder containers as they don't have a view. * sway_container_state.view_{x,y,width,height} -> sway_container_state.content_{x,y,width,height} * To remain consistent with the above. * sway_container_state.con_{x,y,width,height} -> sway_container_state.{x,y,width,height} * The con prefix was there to give it contrast from the view properties, and is no longer useful. The function container_set_geometry_from_floating_view has also been renamed to container_set_geometry_from_content.
2018-11-12Use #if instead of #ifdef for WLR_HAS_*emersion-6/+1
2018-11-11Allow multiple outputs for workspace outputBrian Ashworth-1/+1
`i3 4.16` allows users to list multiple outputs for a workspace and the first available will be used. The syntax is as follows: `workspace <workspace> output <outputs...>` Additionally when the workspace is created, the outputs get added to the output priority list in the order specified. This ensures that if a higher output gets connected, the workspace will move to the higher output. This works the same way as if the user had a workspace on an output, disconnected the output, and then later reconnected the output.
2018-11-08Merge pull request #3087 from RedSoxFan/side-gapsRyan Dwyer-4/+14
Implement per side and per direction outer gaps
2018-11-07Implement per side and per direction outer gapsBrian Ashworth-4/+14
This introduces the following command extensions from `i3-gaps`: * `gaps horizontal|vertical|top|right|bottom|left <amount>` * `gaps horizontal|vertical|top|right|bottom|left all|current set|plus|minus <amount>` * `workspace <ws> gaps horizontal|vertical|top|right|bottom|left <amount>` `inner` and `outer` are also still available as options for all three of the above commands. `outer` now acts as a shorthand to set/alter all sides. Additionally, this fixes two bugs with the prevention of invalid gap configurations for workspace configs: 1. If outer gaps were not set and inner gaps were, the outer gaps would be snapped to the negation of the inner gaps due to `INT_MIN` being less than the negation. This took precedence over the default outer gaps. 2. Similarly, if inner gaps were not set and outer gaps were, inner gaps would be set to zero, which would take precedence over the default inner gaps. Fixing both of the above items also requires checking the gaps again when creating a workspace since the default outer gaps can be smaller than the negation of the workspace specific inner gaps.
2018-11-07gaps: remove duplicate inner gapsBrian Ashworth-1/+6
2018-11-06Add focus_follows_mouse always. (#3081)Connor E-1/+7
* Add focus_follows_mouse_mode. * Fail if focus_follows_mouse is invalid. * Fix indentation.
2018-11-03Merge pull request #3021 from Snaipe/singlekey-binding-triggerDrew DeVault-0/+1
binding: match single-key bindings if no multi-key binding matched
2018-11-01Move view marks properties to container structRyan Dwyer-28/+28
Like border properties, this will be needed to implement layout saving and restoring.
2018-11-01Merge pull request #3040 from RyanDwyer/border-props-to-containerDrew DeVault-20/+16
Move view border properties to container struct
2018-11-01Wrap to fartherest output when running focus outputRyan Dwyer-0/+2
Also moves the `opposite_direction` function into `util.c` as it's used in two places now.
2018-10-31Move view border properties to container structRyan Dwyer-20/+16
This will be needed to implement layout saving and restoring, as we need to be able to configure borders on a placeholder container which has no view.
2018-10-31Revert "Add resolve_path() to utils"madblobfish-9/+0
This reverts commit c9694ee63d451da62dc50b234b3080a35a40e844.
2018-10-30Remove enum movement_directionRyan Dwyer-15/+1
There's no point having both movement_direction and wlr_direction. This replaces the former with the latter. As movement_direction also contained MOVE_PARENT and MOVE_CHILD items, these are now checked specifically in the focus command and handled in separate functions, just like the other focus variants.
2018-10-29binding: match single-key bindings if no multi-key binding matchedFranklin "Snaipe" Mathieu-0/+1
This makes bindings more snappy when the user is typing faster than his keycaps are releasing. Signed-off-by: Franklin "Snaipe" Mathieu <me@snai.pe>
2018-10-27Use output identifier for workspace configRobinhuett-0/+2
2018-10-25Rebase the cursor after applying transactionsRyan Dwyer-7/+0
This approaches cursor rebasing from a different angle. Rather than littering the codebase with cursor_rebase calls and using transaction callbacks, this just runs cursor_rebase after applying every transaction - but only if there's outputs connected, because otherwise it causes a crash during shutdown. There is one known case where we still need to call cursor_rebase directly, and that's when running `seat seat0 cursor move ...`. This command doesn't set anything as dirty so no transaction occurs.
2018-10-25Merge pull request #2950 from emersion/presentation-timeDrew DeVault-2/+5
Implement the presentation-time protocol
2018-10-24Merge pull request #2957 from RyanDwyer/rebase-cursor-after-mapDrew DeVault-0/+7
Rebase the cursor after mapping a view
2018-10-24Add multiseat support to swaylockRyan Dwyer-2/+6
2018-10-24Rebase the cursor after mapping a viewRyan Dwyer-0/+7
I originally put the rebase at the end of view_map, but at this point the view is still at its native size and will ignore the motion event if it falls outside of its native size. The only way to do this properly is to rebase the cursor later - either after sending the configure, after the view commits with the new size, or after applying the transaction. I chose to do it after applying the transaction for simplicity. I then attempted to just call cursor_rebase after applying every transaction, but this causes crashes when exiting sway (and possibly other places) because cursor_rebase assumes the tree is in a valid state. So my chosen solution introduces transaction_commit_dirty_with_callback which allows handle_map to register a callback which will run when the transaction is applied.
2018-10-24Merge pull request #2933 from Snaipe/xwayland-window-propertiesDrew DeVault-0/+3
xwayland: populate window_properties in json for views
2018-10-23Implement the presentation-time protocolemersion-2/+5
2018-10-23xwayland: populate window_properties in json for viewsFranklin "Snaipe" Mathieu-0/+3
window_properties is documented to contain a subset of the X11 properties of a window (its title, class, instance, role, and transient ID). This commit adds the missing json object from the get_tree output for xwayland windows only. This is a follow-up of #2911. Signed-off-by: Franklin "Snaipe" Mathieu <me@snai.pe>
2018-10-23commands: replace EXPECTED_LESS_THAN with EXPECTED_AT_MOSTIan Fan-1/+1
This makes it a bit more obvious what the expected number of arguments is.
2018-10-23commands: remove EXPECTED_MORE_THANIan Fan-1/+0
Its uses have been replaced with EXPECTED_AT_LEAST.
2018-10-22Fix crash when quitting a QT app on the wayland backend using menuRyan Dwyer-1/+0
QT unmaps the view before destroying the popup. We destroyed the popup in response to the view unmapping, but then we'd attempt to destroy it a second time which caused a crash. The patch removes the listener. I tested it with GTK as well, and can confirm the popup is still being destroyed.
2018-10-21Parse missing i3 window typesChristian-0/+5
fixes the parsing part of #2906
2018-10-21Make workspace back_and_forth seat-specificRyan Dwyer-2/+1
* When using multiple seats, each seat has its own prev_workspace_name for the purpose of workspace back_and_forth. * Removes prev_workspace_name global variable. * Removes unused next_name_map function in tree/workspace.c. * Fixes memory leak in seat_destroy (seat was not freed).
2018-10-20Remove raise_floating directiveRyan Dwyer-2/+0
The directive controlled whether floating views should raise to the top when the cursor is moved over it while using focus_follows_mouse. The default was enabled, which is undesirable. For example, if you have two floating views where one completely covers the other, the smaller one would be inaccessible because moving the mouse over the bigger one would raise it above the smaller one. There is no known use case for having raise_floating enabled, so this patch removes the directive and implements the raise_floating disabled behaviour instead.
2018-10-20Minor refactor of input managerRyan Dwyer-24/+9
The input manager is a singleton object. Passing the sway_input_manager argument to each of its functions is unnecessary, while removing the argument makes it obvious to the caller that it's a singleton. This patch removes the argument and makes the input manager use server.input instead. On a similar note: * sway_input_manager.server is removed in favour of using the server global. * seat.input is removed because it can get it from server.input. Due to a circular dependency, creating seat0 is now done directly in server_init rather than in input_manager_create. This is because creating seats must be done after server.input is set. Lastly, it now stores the default seat name using a constant and removes a second reference to seat0 (in input_manager_get_default_seat).
2018-10-19Introduce cursor_rebaseRyan Dwyer-2/+14
This function "rebases" the cursor on top of whatever is underneath it, without triggering any focus changes.
2018-10-19Fix logic used for mouse_warping outputRyan Dwyer-1/+0
Turns out we don't need to store the previous focus, and it should be based on which output the cursor was in.
2018-10-19Merge pull request #2875 from RedSoxFan/input-device-bindingsDrew DeVault-2/+5
cmd_bind{sym,code}: Implement per-device bindings
2018-10-19Consider cursor warp when switching workspacesRyan Dwyer-0/+2
Fixes a regression introduced in 24a90e5d86441fc345356eb3767e5a6880dcedbd. consider_warp_to_focus has been renamed to seat_consider_warp_to_focus, moved to seat.c and made public. It is now called when switching workspaces via `workspace <ws>`.
2018-10-18cmd_bind{sym,code}: Implement per-device bindingsBrian Ashworth-2/+5
bindsym --input-device=<identifier> ... bindcode --input-device=<identifier> ...