aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop
AgeCommit message (Collapse)Author
2019-01-06Use %z for printing size_tJan Beich
../sway/desktop/transaction.c:367:17: error: format specifies type 'long' but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat] transaction, transaction->num_waiting); ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/local/include/wlr/util/log.h:56:72: note: expanded from macro 'wlr_log' _wlr_log(verb, "[%s:%d] " fmt, _wlr_strip_path(__FILE__), __LINE__, ##__VA_ARGS__) ^~~~~~~~~~~ ../sway/desktop/transaction.c:477:5: error: format specifies type 'long' but the argument has type 'unsigned int' [-Werror,-Wformat] transaction->num_configures - transaction->num_waiting + 1, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/local/include/wlr/util/log.h:56:72: note: expanded from macro 'wlr_log' _wlr_log(verb, "[%s:%d] " fmt, _wlr_strip_path(__FILE__), __LINE__, ##__VA_ARGS__) ^~~~~~~~~~~ ../sway/desktop/transaction.c:478:5: error: format specifies type 'long' but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat] transaction->num_configures, ms, ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/local/include/wlr/util/log.h:56:72: note: expanded from macro 'wlr_log' _wlr_log(verb, "[%s:%d] " fmt, _wlr_strip_path(__FILE__), __LINE__, ##__VA_ARGS__) ^~~~~~~~~~~
2019-01-01Fix fullscreen view rendering crashMack Straight
See issue #3359 for reproduction details. When a fullscreen view is unmapped and there's a preceding transaction waiting, there may be neither a saved buffer or a surface to render. This change matches the equivalent code in render_view.
2018-12-22Fix wlr_box_intersection args for wlroots 1441Brian Ashworth
The fix pushed to master missed wlr_box_intersection. This just fixes those lines so sway renders properly again
2018-12-22Fixes per wlroots#1441Drew DeVault
2018-12-20Combine output_by_name and output_by_identifierBrian Ashworth
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.
2018-12-10Call wlr_output_enable for disabled new outputsBrian Ashworth
When a new output is detected and it is disabled by the output config, call `wlr_output_enable(output->wlr_output, false)` to DPMS off the output.
2018-12-01Update for swaywm/wlroots#1403emersion
2018-11-28Fix titlebar when no title or marksBrian Ashworth
This fixes the rendering of the titlebar when there is no title or marks.
2018-11-25Implement title alignmentBrian Ashworth
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
2018-11-18Use #if instead of #ifdefemersion
2018-11-17Move view {x,y,width,height} into container structRyan Dwyer
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-13Merge pull request #3102 from emersion/render-software-cursorsDrew DeVault
Render software cursors with wlr_output_render_software_cursors
2018-11-12Use #if instead of #ifdef for WLR_HAS_*emersion
2018-11-10Render software cursors with wlr_output_render_software_cursorsemersion
2018-11-04Use wlr_surface_get_effective_damageemersion
2018-11-01Move view marks properties to container structRyan Dwyer
Like border properties, this will be needed to implement layout saving and restoring.
2018-10-31Move view border properties to container structRyan Dwyer
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-30Revert "Respect border settings when rendering lone tabbed/stacked child"Rostislav Pehlivanov
This reverts commit 65328ef60c9468ae44b4b1d6316d604c47293ec3.
2018-10-27Use output identifier for workspace configRobinhuett
2018-10-27Don't reset cursor during mouse operationsRyan Dwyer
2018-10-27Respect border settings when rendering lone tabbed/stacked childRyan Dwyer
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.
2018-10-25Rebase the cursor after applying transactionsRyan Dwyer
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
Implement the presentation-time protocol
2018-10-24Rebase the cursor after mapping a viewRyan Dwyer
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
xwayland: populate window_properties in json for views
2018-10-23Implement the presentation-time protocolemersion
2018-10-23xwayland: populate window_properties in json for viewsFranklin "Snaipe" Mathieu
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-22Fix xwayland wants_floating logicRyan Dwyer
2018-10-21Parse missing i3 window typesChristian
fixes the parsing part of #2906
2018-10-20Fix popup damage issues when toplevel and/or popup uses geometryRyan Dwyer
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).
2018-10-20Minor refactor of input managerRyan Dwyer
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-17Merge pull request #2820 from Emantor/fix-mouse-warping-containerDrew DeVault
Fix mouse warping container
2018-10-16view: move arrange_workspace into view_mapRouven Czerwinski
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
2018-10-12Fix pixel leaks when using fractional scalingRyan Dwyer
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.
2018-10-09Merge pull request #2772 from RyanDwyer/improve-popup-damageDrew DeVault
Only damage popups when popups have damage
2018-10-08Remove duplicate codeRyan Dwyer
2018-10-08Look for any ancestor when checking for fullscreen exitRyan Dwyer
2018-10-08Use current state when rendering transient containersRyan Dwyer
2018-10-08Introduce container_is_transient_forRyan Dwyer
2018-10-08Implement popup_during_fullscreenRyan Dwyer
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.
2018-10-07Use wlr_xdg_popup_get_toplevel_coordsRyan Dwyer
2018-10-07Only damage popups when popups have damageRyan Dwyer
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.
2018-10-04Give focus to another swaylock surface when output is disconnectedRyan Dwyer
* 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.
2018-10-03Merge pull request #2703 from RyanDwyer/csd-borderDrew DeVault
Add CSD to border modes
2018-09-28transaction: do not use pointers for stateIan Fan
2018-09-27Remove server-decoration assumption if view supports xdg-decorationRyan Dwyer
2018-09-27Rename view_set_csd_from_client to view_update_csd_from_clientRyan Dwyer
2018-09-27Add CSD to border modesRyan Dwyer
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.
2018-09-23Allow running commands on containers without focusing themRyan Dwyer
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.