aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway
Commit message (Collapse)AuthorAge
...
* | Change mouse buttons to x11 map and libevdev namesLibravatar Brian Ashworth2018-12-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This modifies the way mouse bindings are parsed. Instead of adding to BTN_LEFT, which results in button numbers that may not be expected, buttons will be parsed in one of the following ways: 1. `button[1-9]` will now map to their x11 equivalents. This is already the case for bar bindings. This adds support for binding to axis events, which was not possible in the previous approach. 2. Anything that starts with `BTN_` will be parsed as an event code name using `libevdev_event_code_from_name`. This allows for any button to be mapped to instead of limiting usage to the ones near BTN_LEFT. This also adds a dependency on libevdev, but since libevdev is already a dependency of libinput, this should be fine. If needed, this option can have dependency guards added. Binding changes: - button1: BTN_LEFT -> BTN_LEFT - button2: BTN_RIGHT -> BTN_MIDDLE - button3: BTN_MIDDLE -> BTN_RIGHT - button4: BTN_SIDE -> SWAY_SCROLL_UP - button5: BTN_EXTRA -> SWAY_SCROLL_DOWN - button6: BTN_FORWARD -> SWAY_SCROLL_LEFT - button7: BTN_BACK -> SWAY_SCROLL_RIGHT - button8: BTN_TASK -> BTN_SIDE - button9: BTN_JOYSTICK -> BTN_EXTRA Since the axis events need to be mapped to an event code, this uses the following mappings to avoid any conflicts: - SWAY_SCROLL_UP: KEY_MAX + 1 - SWAY_SCROLL_DOWN: KEY_MAX + 2 - SWAY_SCROLL_LEFT: KEY_MAX + 3 - SWAY_SCROLL_RIGHT: KEY_MAX + 4
* | Combine output_by_name and output_by_identifierLibravatar Brian Ashworth2018-12-20
| | | | | | | | | | | | | | | | This combines `output_by_name` and `output_by_identifier` into a single function called `output_by_name_or_id`. This allows for output identifiers to be used in all commands, simplifies the logic of the callers, and is more efficient since worst case is a single pass through the output list.
* | Rework default output configsLibravatar Brian Ashworth2018-12-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Default output configs were generated on reload to reset an output to its default settings. The idea was that anything that was removed from the config or changed at runtime and not in the config should be reset on reload. Originally, they were created using the output name. Recently, they were changed to use the output identifier. It turns out that there are issues of shadowing with that solution as well. This should fix those issues. Instead of generating the default output configs on reload and storing them in the output config list to merge on top of, they are now only generated when retrieving the output config for an output during a reload. This means that the default output configs are never stored anywhere and just used as a base to merge unaltered user configs on top of during a reload. Starting with a blank output config, merges get applied in the following order: 1. Default output config (only during a reload) 2. Wildcard config (only if neither output name or output identifier exist) 3. Output name config 4. Output identifier config
* | Implement bar gapsLibravatar Brian Ashworth2018-11-28
| | | | | | | | | | | | | | | | | | 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.
* | Introduce a way to show config warnings in swaynagLibravatar Brian Ashworth2018-11-28
| | | | | | | | | | | | | | | | | | | | 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.
* | Fix segfault when destroying unmapped child viewLibravatar emersion2018-11-28
| |
* | Merge pull request #3199 from emersion/handle-subsurface-destroyLibravatar Ryan Dwyer2018-11-28
|\ \ | | | | | | Handle destroyed subsurfaces
| * | Handle destroyed subsurfacesLibravatar emersion2018-11-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Change execute_command to return a list of resultsLibravatar Brian Ashworth2018-11-27
|/ / | | | | | | | | | | 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.
* | Implement title alignmentLibravatar Brian Ashworth2018-11-25
| | | | | | | | | | | | | | | | 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.
* | Adding commands for configuring titlebar borders and paddingLibravatar Florent de Lamotte2018-11-22
| |
* | Merge pull request #3083 from c-edw/feature/StripWorkspaceNameLibravatar emersion2018-11-19
|\ \ | |/ |/| Implement strip_workspace_name.
| * Implement strip_workspace_name.Libravatar Connor E2018-11-17
| |
* | Add scroll factor config option.Libravatar Spencer Michaels2018-11-18
| |
* | Use #if instead of #ifdefLibravatar emersion2018-11-18
| |
* | Move view {x,y,width,height} into container structLibravatar Ryan Dwyer2018-11-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Allow multiple outputs for workspace outputLibravatar Brian Ashworth2018-11-11
| | | | | | | | | | | | | | | | | | | | | | | | `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.
* | Merge pull request #3087 from RedSoxFan/side-gapsLibravatar Ryan Dwyer2018-11-08
|\ \ | | | | | | Implement per side and per direction outer gaps
| * | Implement per side and per direction outer gapsLibravatar Brian Ashworth2018-11-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | gaps: remove duplicate inner gapsLibravatar Brian Ashworth2018-11-07
|/ /
* / Add focus_follows_mouse always. (#3081)Libravatar Connor E2018-11-06
|/ | | | | | | | * Add focus_follows_mouse_mode. * Fail if focus_follows_mouse is invalid. * Fix indentation.
* Merge pull request #3021 from Snaipe/singlekey-binding-triggerLibravatar Drew DeVault2018-11-03
|\ | | | | binding: match single-key bindings if no multi-key binding matched
| * binding: match single-key bindings if no multi-key binding matchedLibravatar Franklin "Snaipe" Mathieu2018-10-29
| | | | | | | | | | | | | | 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>
* | Move view marks properties to container structLibravatar Ryan Dwyer2018-11-01
| | | | | | | | | | Like border properties, this will be needed to implement layout saving and restoring.
* | Move view border properties to container structLibravatar Ryan Dwyer2018-10-31
| | | | | | | | | | | | 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.
* | Remove enum movement_directionLibravatar Ryan Dwyer2018-10-30
| | | | | | | | | | | | | | | | | | 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.
* | Use output identifier for workspace configLibravatar Robinhuett2018-10-27
|/
* Rebase the cursor after applying transactionsLibravatar Ryan Dwyer2018-10-25
| | | | | | | | | | | | 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.
* Merge pull request #2950 from emersion/presentation-timeLibravatar Drew DeVault2018-10-25
|\ | | | | Implement the presentation-time protocol
| * Implement the presentation-time protocolLibravatar emersion2018-10-23
| |
* | Rebase the cursor after mapping a viewLibravatar Ryan Dwyer2018-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #2933 from Snaipe/xwayland-window-propertiesLibravatar Drew DeVault2018-10-24
|\ \ | |/ |/| xwayland: populate window_properties in json for views
| * xwayland: populate window_properties in json for viewsLibravatar Franklin "Snaipe" Mathieu2018-10-23
| | | | | | | | | | | | | | | | | | | | | | 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>
* | commands: replace EXPECTED_LESS_THAN with EXPECTED_AT_MOSTLibravatar Ian Fan2018-10-23
| | | | | | | | This makes it a bit more obvious what the expected number of arguments is.
* | commands: remove EXPECTED_MORE_THANLibravatar Ian Fan2018-10-23
| | | | | | | | Its uses have been replaced with EXPECTED_AT_LEAST.
* | Fix crash when quitting a QT app on the wayland backend using menuLibravatar Ryan Dwyer2018-10-22
|/ | | | | | | | | | | 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.
* Parse missing i3 window typesLibravatar Christian2018-10-21
| | | | fixes the parsing part of #2906
* Make workspace back_and_forth seat-specificLibravatar Ryan Dwyer2018-10-21
| | | | | | | | * 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).
* Remove raise_floating directiveLibravatar Ryan Dwyer2018-10-20
| | | | | | | | | | | | | 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.
* Minor refactor of input managerLibravatar Ryan Dwyer2018-10-20
| | | | | | | | | | | | | | | | | | | | | 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).
* Introduce cursor_rebaseLibravatar Ryan Dwyer2018-10-19
| | | | | This function "rebases" the cursor on top of whatever is underneath it, without triggering any focus changes.
* Fix logic used for mouse_warping outputLibravatar Ryan Dwyer2018-10-19
| | | | | Turns out we don't need to store the previous focus, and it should be based on which output the cursor was in.
* Merge pull request #2875 from RedSoxFan/input-device-bindingsLibravatar Drew DeVault2018-10-19
|\ | | | | cmd_bind{sym,code}: Implement per-device bindings
| * cmd_bind{sym,code}: Implement per-device bindingsLibravatar Brian Ashworth2018-10-18
| | | | | | | | | | bindsym --input-device=<identifier> ... bindcode --input-device=<identifier> ...
* | Consider cursor warp when switching workspacesLibravatar Ryan Dwyer2018-10-19
|/ | | | | | | | | 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>`.
* Remove cursor warping from seat_set_focusLibravatar Ryan Dwyer2018-10-18
| | | | | | | | | | | | Because cursor warping was the default behaviour in seat_set_focus, there may be cases where we may have been warping the cursor unintentionally. This patch removes cursor warping from seat_set_focus and only does it in the focus command. This is managed by a static function in focus.c. To know whether to warp or not, we need to know which node had focus previously. To keep track of this easily, seat->prev_focus has been introduced and is set to the previous in seat_set_focus.
* Merge pull request #2820 from Emantor/fix-mouse-warping-containerLibravatar Drew DeVault2018-10-17
|\ | | | | Fix mouse warping container
| * cursor: functions to warp cursor to container and workspaceLibravatar Rouven Czerwinski2018-10-16
| | | | | | | | | | | | The new functions allow a cursor to be warped without changing the focus. This is a preparation commit to handle cursor warping not only in seat_set_focus_warp.
| * view: move arrange_workspace into view_mapLibravatar Rouven Czerwinski2018-10-16
| | | | | | | | | | | | | | | | | | | | For mouse_warping cursor to correctly work on newly spawned containers, the workspace needs to be arranged before the cursor is warped. The shell functions each implement their own fullscreen and arrange checks, move them into the view_map function and pass their states via boolean arguments. Fixes #2819
* | Prevent duplicate workspace::focus eventsLibravatar Ryan Dwyer2018-10-16
| | | | | | | | | | | | | | | | | | | | | | | | Previously we would compare the last focus's workspace with the new focus's workspace to determine if we need to emit an IPC workspace::focus event. This doesn't work when moving the focused container to a new workspace. This adds a workspace property to the seat which stores the last emitted workspace::focus workspace. Using this method, after moving the container, refocusing it will trigger exactly one workspace::focus event: from the old workspace to the new workspace.