aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop
Commit message (Collapse)AuthorAge
...
| * 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 xwayland wants_floating logicLibravatar Ryan Dwyer2018-10-22
|/
* Parse missing i3 window typesLibravatar Christian2018-10-21
| | | | fixes the parsing part of #2906
* Fix popup damage issues when toplevel and/or popup uses geometryLibravatar Ryan Dwyer2018-10-20
| | | | | | | | | | | | | | | The wlr_xdg_popup_get_toplevel_coords function has the following quirks: * It does not do anything with the coordinates of the passed popup. Instead, we are required to add them ourselves, which we do by passing them to the function as the surface local values. * It adds the geometry (shadows etc) of the toplevel itself, so the coordinates are surface local rather than content local. For this reason, we have to negate the toplevel's geometry (child->view->geometry). * I may be wrong, but the popup positions appear to be stored in surface local coordinates rather than content local coordinates. The geometry (shadows etc) of the popup itself must be negated (surface->geometry).
* 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).
* Merge pull request #2820 from Emantor/fix-mouse-warping-containerLibravatar Drew DeVault2018-10-17
|\ | | | | Fix mouse warping container
| * 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 pixel leaks when using fractional scalingLibravatar Ryan Dwyer2018-10-12
|/ | | | | | | | | | | | | The basic idea here is to apply rounding after scaling. It's not as simple as this, though, and I've detailed it in the comments for a function. In order to fix some pixel leaks in the title bar, I found it easier to change how we place rectangles to fill the area. Instead of placing two rectangles across the full width above and below the title and having shorter rectangles in the inner area, it's now pieced together in vertical chunks. This method involves drawing two less rectangles per container.
* Merge pull request #2772 from RyanDwyer/improve-popup-damageLibravatar Drew DeVault2018-10-09
|\ | | | | Only damage popups when popups have damage
| * Use wlr_xdg_popup_get_toplevel_coordsLibravatar 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
| |
* | Look for any ancestor when checking for fullscreen exitLibravatar Ryan Dwyer2018-10-08
| |
* | Use current state when rendering transient containersLibravatar 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.
* Give focus to another swaylock surface when output is disconnectedLibravatar Ryan Dwyer2018-10-04
| | | | | | | | | | | | | | | | | | | | | * Have multiple outputs * Launch swaylock * Unplug an output (possibly has to be the last "connected" one) * The swaylock surface on the remaining output would not respond to key events This was happening because when the output destroys, focus was not given to the other swaylock surface. This patch makes focus be transferred to another surface owned by the same Wayland client, but only if input was inhibited by the surface being destroyed, and only if it's in the overlay layer. I figure it's best to be overly specific and relax the requirements later if needed. This patch removes a check in seat_set_focus_surface which was preventing focus from being passed from a layer surface to any other surface. I don't know of a use case for this check, but it's possible that this change could produce issues.
* Merge pull request #2703 from RyanDwyer/csd-borderLibravatar Drew DeVault2018-10-03
|\ | | | | Add CSD to border modes
| * Remove server-decoration assumption if view supports xdg-decorationLibravatar Ryan Dwyer2018-09-27
| |
| * 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.
* | transaction: do not use pointers for stateLibravatar Ian Fan2018-09-28
|/
* 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.
* Reconfigure xwayland views when repositionedLibravatar Ryan Dwyer2018-09-21
| | | | Fixes #2673.
* Fix segfault in output_renderLibravatar emersion2018-09-19
|
* Merge pull request #2637 from RyanDwyer/fix-tabbed-workspace-shenanigansLibravatar Drew DeVault2018-09-16
|\ | | | | Make seat_get_active_child ignore floating children
| * 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.
* | Fix crash when destroying an idle-inhibiting clientLibravatar Marien Zwart2018-09-16
|/ | | | | | When destroying an idle-inhibiting client, idle_inhibit_v1_check_active can get called from transaction_progress_queue on a view with a null container. view_is_visible does not handle a view in this state.
* Update for swaywm/wlroots#1243Libravatar emersion2018-09-14
|
* Fix dropzone box on scaled outputsLibravatar Ryan Dwyer2018-09-11
|
* Implement tiling dragLibravatar Ryan Dwyer2018-09-11
| | | | Hold floating_modifier and drag a tiling view to a new location.
* Rename OP_MOVE to OP_MOVE_FLOATINGLibravatar Ryan Dwyer2018-09-11
| | | | In preparation for introducing OP_MOVE_TILING.
* handle_layer_shell_surface: Do not crash if seat doesn't have focusLibravatar Armin Preiml2018-09-10
|
* Align titles to baselineLibravatar Ryan Dwyer2018-09-08
| | | | | | | | | | | | | This does the following: * Adds a baseline argument to get_text_size (the baseline is the distance from the top of the texture to the baseline). * Stores the baseline in the container when calculating the title height. * Takes the baseline into account when calculating the config's max font height. * When rendering, pads the textures according to the baseline so they line up.
* Fix gaps in title textures and vertically center themLibravatar Ryan Dwyer2018-09-08
| | | | | | | | | | | | | | | | | | | There was code that attempted to fill in the gap below the title texture when the texture isn't tall enough, but this only worked when the output was positioned at 0,0. The reason is that render_rect expects a box passed in a hybrid layout-local/output-buffer-local system, and we were passing purely output-buffer-local. I've added a comment documenting this. By the way, we can't use layout-local coordinates for the rectangle box because in some cases we set the box based on a texture size. Texture sizes are buffer-local, and we'd have to divide them to bring it back to layout-local which means losing precision. We could use output-buffer-local coordinates for the box, but this would require translating the coordinates from layout-local to output-buffer-local in many places during rendering. This patch also vertically centers the text inside the title bar.
* Merge pull request #2603 from emersion/fix-dndLibravatar Drew DeVault2018-09-07
|\ | | | | Fix drag-and-drop
| * Fix drag-and-dropLibravatar emersion2018-09-07
| |
* | Float views when min == max on either dimensionLibravatar Ryan Dwyer2018-09-06
| | | | | | | | | | | | This fixes pinentry-gtk-2, but might make other views floating which would otherwise be tiled. This patch is more of a trial which could end up becoming a permanent fix.
* | Fix crash when switching to new workspace during transactionLibravatar Ryan Dwyer2018-09-06
| | | | | | | | | | | | | | When rendering, the workspace for the output needs to be retrieved from the output's `current` state. output_get_active_workspace returns the pending workspace, which crashes if the pending workspace is new and hasn't completed a transaction yet.
* | Fix crash when views rapidly map and unmapLibravatar Ryan Dwyer2018-09-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Suppose the following: * Transactions are already in progress - say transaction A. * View A maps, which creates transaction B and appends it to the transaction queue. * View B maps, which creates transaction C and appends it to the queue. * View A unmaps, which creates transaction D and appends it to the queue. * Transaction A completes, so transaction B attempts to save View A's buffer, but this doesn't exist so it saves nothing. * Rendering code attempts to render View A, but there is no saved buffer nor live buffer that it can use. Rather than implement an elaborate solution for a rare circumstance, I've take the safe option of just not rendering anything for that view. It means that if you reproduce the scenario above, you might get the title and borders rendered but no surface.
* | Fix output position issueLibravatar Ryan Dwyer2018-09-05
| | | | | | | | | | | | | | Looks like the output dimensions need to be set when arranging rather than when a mode is set. Fixes an issue with position of fullscreen views.
* | Update output propertes on mode changeLibravatar Ryan Dwyer2018-09-05
| | | | | | | | | | This was previously done when arranging the output, but only needs to be done on mode change.
* | Apply default config to outputLibravatar Ryan Dwyer2018-09-05
| | | | | | | | | | When starting without any output config, the default config was not applying.
* | Don't use wlr_output propertiesLibravatar Ryan Dwyer2018-09-05
| | | | | | | | These properties are before rotation.
* | Implement type safe arguments and demote sway_containerLibravatar Ryan Dwyer2018-09-05
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit changes the meaning of sway_container so that it only refers to layout containers and view containers. Workspaces, outputs and the root are no longer known as containers. Instead, root, outputs, workspaces and containers are all a type of node, and containers come in two types: layout containers and view containers. In addition to the above, this implements type safe variables. This means we use specific types such as sway_output and sway_workspace instead of generic containers or nodes. However, it's worth noting that in a few places places (eg. seat focus and transactions) referring to them in a generic way is unavoidable which is why we still use nodes in some places. If you want a TL;DR, look at node.h, as well as the struct definitions for root, output, workspace and container. Note that sway_output now contains a workspaces list, and workspaces now contain a tiling and floating list, and containers now contain a pointer back to the workspace. There are now functions for seat_get_focused_workspace and seat_get_focused_container. The latter will return NULL if a workspace itself is focused. Most other seat functions like seat_get_focus and seat_set_focus now accept and return nodes. In the config->handler_context struct, current_container has been replaced with three pointers: node, container and workspace. node is the same as what current_container was, while workspace is the workspace that the node resides on and container is the actual container, which may be NULL if a workspace itself is focused. The global root_container variable has been replaced with one simply called root, which is a pointer to the sway_root instance. The way outputs are created, enabled, disabled and destroyed has changed. Previously we'd wrap the sway_output in a container when it is enabled, but as we don't have containers any more it needs a different approach. The output_create and output_destroy functions previously created/destroyed the container, but now they create/destroy the sway_output. There is a new function output_disable to disable an output without destroying it. Containers have a new view property. If this is populated then the container is a view container, otherwise it's a layout container. Like before, this property is immutable for the life of the container. Containers have both a `sway_container *parent` and `sway_workspace *workspace`. As we use specific types now, parent cannot point to a workspace so it'll be NULL for containers which are direct children of the workspace. The workspace property is set for all containers, except those which are hidden in the scratchpad as they have no workspace. In some cases we need to refer to workspaces in a container-like way. For example, workspaces have layout and children, but when using specific types this makes it difficult. Likewise, it's difficult for a container to get its parent's layout when the parent could be another container or a workspace. To make it easier, some helper functions have been created: container_parent_layout and container_get_siblings. container_remove_child has been renamed to container_detach and container_replace_child has been renamed to container_replace. `container_handle_fullscreen_reparent(con, old_parent)` has had the old_parent removed. We now unfullscreen the workspace when detaching the container, so this function is simplified and only needs one argument now. container_notify_subtree_changed has been renamed to container_update_representation. This is more descriptive of its purpose. I also wanted to be able to call it with whatever container was changed rather than the container's parent, which makes bubbling up to the workspace easier. There are now state structs per node thing. ie. sway_output_state, sway_workspace_state and sway_container_state. The focus, move and layout commands have been completely refactored to work with the specific types. I considered making these a separate PR, but I'd be backporting my changes only to replace them again, and it's easier just to test everything at once.
* Implement window_role criteria tokenLibravatar Ryan Dwyer2018-09-04
| | | | Depends on https://github.com/swaywm/wlroots/pull/1226
* Fix crash when a splash screen opens on an empty workspaceLibravatar Ian Fan2018-09-03
|
* Merge branch 'master' into disabled-no-modesetLibravatar Brian Ashworth2018-09-03
|\
| * Implement focus_on_window_activationLibravatar Ryan Dwyer2018-09-02
| | | | | | | | Depends on https://github.com/swaywm/wlroots/pull/1223
| * Check modal state when determining whether an xwayland view should floatLibravatar Ryan Dwyer2018-09-02
| | | | | | | | | | | | | | | | Depends on https://github.com/swaywm/wlroots/pull/1222. I don't know of a program that sets the state to modal without setting the window type, but I know the modal property works because logging the property shows it's true for the Firefox Open File dialog.