aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/view.c
Commit message (Collapse)AuthorAge
...
* Merge pull request #3199 from emersion/handle-subsurface-destroyLibravatar Ryan Dwyer2018-11-28
|\ | | | | Handle destroyed subsurfaces
| * Damage view child when destroyedLibravatar emersion2018-11-27
| |
| * 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.
* Fix pango title escapingLibravatar emersion2018-11-25
| | | | | | | | | | | | | | This commit fixes two bugs. First, commit [1] has inverted the condition when we escape pango markup. We need to escape client-provided strings when markup is enabled. Second, parse_title_format has a shortcut when title_format is set to `%title`, and escape_pango_markup wasn't used anymore there. Fixes https://github.com/swaywm/sway/issues/3181 [1]: https://github.com/swaywm/sway/pull/3179/commits/caee2dff03fc007dc46cf121e013f5347ac46ba9
* fixes pango_markup support with title_formatLibravatar Arthur Gautier2018-11-24
| | | | | | | The support for pango_markup was broken in title_format because the formated title was escaped. I think only the payload should be escaped. This commit fixes 789a877b379cd35c350610be62b971ae00feb542
* 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.
* 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
|/
* 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.
* Revert "Respect border settings when rendering lone tabbed/stacked child"Libravatar Rostislav Pehlivanov2018-10-30
| | | | This reverts commit 65328ef60c9468ae44b4b1d6316d604c47293ec3.
* Revert "tree/view.c: fix uninitialized variables warning"Libravatar Rostislav Pehlivanov2018-10-30
| | | | This reverts commit 6414b5d288b89c9f3ecde0757f16184071b6036f.
* tree/view.c: fix uninitialized variables warningLibravatar Cole Mickens2018-10-26
|
* Respect border settings when rendering lone tabbed/stacked childLibravatar Ryan Dwyer2018-10-27
| | | | | | | | | | | | In i3, when a child of a tabbed or stacked container has no siblings, its border settings are respected. This patch achieves the same effect by rendering a lone tabbed/stacked child as if it's a linear container. This makes the border settings be respected. Over in view_autoconfigure, we compensate for this by only adjusting `y_offset` if there's multiple children.
* 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 #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>
* | 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.
* 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).
* 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.
* Merge pull request #2820 from Emantor/fix-mouse-warping-containerLibravatar Drew DeVault2018-10-17
|\ | | | | Fix mouse warping container
| * view: rewarp cursor during view_unmapLibravatar Rouven Czerwinski2018-10-16
| | | | | | | | | | | | If the cursor is warped during the destruction of the workspace, we end up in the wrong position. Warp the cursor after arrange_workspace() so we end up in the correct position.
| * 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
* | Fix crash when view maps while lockedLibravatar Ryan Dwyer2018-10-13
|/ | | | | | | | When locked, there is no active workspace so it must find the focus_inactive workspace instead. Additionally, this adds a check for if a view maps while there are no outputs connected and handles it gracefully.
* Fix undesirable height change of floating viewsLibravatar mwenzkowski2018-10-09
| | | | | | | In view_autoconfigure the height of the view is adjusted if the parent container has a tabbed/stacked layout. Previously this height change would also be applied to floating views, although it is not needed for them.
* Merge pull request #2772 from RyanDwyer/improve-popup-damageLibravatar Drew DeVault2018-10-09
|\ | | | | Only damage popups when popups have damage
| * Handle subsurfaces in view_child_damageLibravatar Ryan Dwyer2018-10-07
| |
| * Only damage popups when popups have damageLibravatar Ryan Dwyer2018-10-07
| | | | | | | | | | | | | | | | | | | | | | The previous behaviour was to damage the entire view, which would recurse into each popup. This patch makes it damage only the popup's surface, and respect the surface damage given by the client. This adds listeners to the popup's map and unmap events rather than doing the damage in the create and destroy functions. To get the popup's position relative to the view, a new child_impl function get_root_coords has been introduced, which traverses up the parents.
* | Remove duplicate codeLibravatar Ryan Dwyer2018-10-08
| |
* | Introduce container_is_transient_forLibravatar Ryan Dwyer2018-10-08
| |
* | Implement popup_during_fullscreenLibravatar Ryan Dwyer2018-10-08
|/ | | | | | | | | | This introduces a new view_impl function: is_transient_for. Similar to container_has_ancestor but works using the surface parents rather than the tree. This patch modifies view_is_visible, container_at and so on to allow transient views to function normally when they're in front of a fullscreen view.
* Fix crash if view has no containerLibravatar minus2018-10-03
|
* Merge pull request #2703 from RyanDwyer/csd-borderLibravatar Drew DeVault2018-10-03
|\ | | | | Add CSD to border modes
| * Improve CSD logicLibravatar Ryan Dwyer2018-09-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This does the following: * Removes the xdg-decoration surface_commit listener. I was under the impression the client could ignore the server's preference and set whatever decoration they like using this protocol, but I don't think that's right. * Adds a listener for the xdg-decoration request_mode signal. The protocol states that the server should respond to this with its preference. We'll always respond with SSD here. * Makes it so tiled views which use CSD will still have sway decorations rendered. To do this, using_csd had to be added back to the view struct, and the border is changed when floating or unfloating a view.
| * Rename view_set_csd_from_client to view_update_csd_from_clientLibravatar Ryan Dwyer2018-09-27
| |
| * Add CSD to border modesLibravatar Ryan Dwyer2018-09-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces view.using_csd with a new border mode: B_CSD. This also removes sway_xdg_shell{_v6}_view.deco_mode and view->has_client_side_decorations as we can now get these from the border. You can use `border toggle` to cycle through the modes including CSD, or use `border csd` to set it directly. The client must support the xdg-decoration protocol, and the only client I know of that does is the example in wlroots. If the client switches from SSD to CSD without us expecting it (via the server-decoration protocol), we stash the previous border type into view.saved_border so we can restore it if the client returns to SSD. I haven't found a way to test this though.
* | Handle border options for gapsLibravatar Brian Ashworth2018-10-01
| | | | | | | | | | | | | | | | | | | | | | | | Fixes `hide_edge_borders smart` when gaps are in use. Implements `hide_edge_borders smart_no_gaps` and `smart_borders on|no_gaps|off`. Since `smart_borders on` is equivalent to `hide_edge_borders smart` and `smart_borders no_gaps` is equivalent to `hide_edge_borders smart_no_gaps`, I opted to just save the last value set for `hide_edge_borders` and restore that on `smart_borders off`. This simplifies the conditions for setting the border.
* | Fix smart gapsLibravatar Brian Ashworth2018-10-01
| |
* | Fix floating views in tabbed/stacked workspaces not getting frame eventsLibravatar Ryan Dwyer2018-09-28
|/ | | | | | | | | 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.
* Allow running commands on containers without focusing themLibravatar Ryan Dwyer2018-09-23
| | | | | | | | | | | | | | This adds a `con` argument to `execute_command` which allows you to specify the container to execute the command on. In most cases it leaves it as `NULL` which makes it use the focused node. We only set it when executing `for_window` criteria such as when a view maps. This means we don't send unnecessary IPC focus events, and fixes a crash when the criteria command is `move scratchpad` (because we can't give focus to a hidden scratchpad container). Each of the shell map handlers now check to see if the view has a workspace. It won't have a workspace if criteria has moved it to the scratchpad.
* Fix pango escaping and refactor escape_markup_textLibravatar Ryan Dwyer2018-09-22
| | | | | | | | | | | | | | Fixes #2674. The cause of the issue was in get_pango_layout. When we call pango_parse_markup, `text` is the escaped string, and the unescaped string is then computed and written to `buf`. We were then passing the unescaped string to pango_layout_set_markup, but this function needs the escaped string. `buf` is not needed and has been removed. The other part of this PR refactors escape_markup_text to remove the dest_length argument and removes the -1 return value on error. It now assumes that you've allocated dest to the correct length.
* ipc: add pid information for views in layout treeLibravatar Ian Fan2018-09-19
|
* Rename seat_get_active_child to seat_get_active_tiling_childLibravatar Ryan Dwyer2018-09-16
| | | | | Also renames container to con in one function to prevent ugly line wrapping.
* Remove redundant container creation in view initializationLibravatar Ian Fan2018-09-15
|
* Merge pull request #2621 from emersion/fix-unmap-segfaultLibravatar Drew DeVault2018-09-11
|\ | | | | Don't use handler_context in view_unmap
| * Don't use handler_context in view_unmapLibravatar emersion2018-09-11
| |