aboutsummaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)AuthorLines
2019-06-27introduce wlr_drm_lease_v1Furkan Sahin-0/+4
This prevents sway from extending the desktop to i.e. VR headsets, and makes them available for DRM leasing. Non-desktop wlr_outputs will be offered through the wlr_drm_lease_v1_manager interface for client to lease.
2021-09-07view: fix child position calcFurkan Sahin-1/+1
Previously, the position was calculated incorrectly for nested subsurfaces.
2021-08-24seatop_down: End if surface is destroyed or other seatop startsFurkan Sahin-1/+1
If the surface the pointer started to interact with is destroyed we also want the seatop_down to end. In case a drag is initiated we receive a call to handle_end.
2021-08-02input: Use seatop_down on layer surface clickFurkan Sahin-0/+3
This solves an issue where layer-shell items would not receive a button release event when the pointer left them while being pressed. The default seatop changes focus immediately while seatop_down defers any focus changes until the pointer is released or seatop_down is destroyed.
2021-07-18Add `output modeline` commandFurkan Sahin-0/+3
Only works with DRM backend.
2021-08-18Use fixed titlebar heightsFurkan Sahin-14/+7
Use fixed titlebar heights. The default height is calculated based on font metrics for the configured font and current locale. Some testing with titles with emoji and CJK characters (which are substantially higher in my setup) shows that the titlebars retain their initial value, text does shift up or down, and all titlebars always remain aligned. Also drop some also now-unecessary title_height calculations. Makes also needed to be updated, since they should be positioned with the same rules.
2021-08-11layer_shell: damage previous area when a surface shrinksFurkan Sahin-0/+1
When a layer surface shrinks we need to damage the area it previously occupied, but we don't know the location of all its subsurfaces in the previous state, so instead damage a rectangle that encloses the entire previous extent.
2021-08-12Document view_mapFurkan Sahin-0/+9
2021-08-05seatop_down: Change type of sx, sy to double in begin_seatop_downFurkan Sahin-1/+1
Losing the precision resulted in wlr_cursor and wlr_seat::pointer_state getting out of sync during pointer motion in seatop_down. Since the difference was always under 1 px, it was practically impossible to notice in normal use. But because of being out of sync, cursor_rebase would always end up incorrectly calling wlr_seat_pointer_notify_motion from seatop_default_begin (on releasing mouse button) which broke cursor locking. See #5405 Closes #4632
2021-07-27view: remove reference to wlr_wl_shell_surfaceFurkan Sahin-1/+0
2021-07-10Fix wl_pointer.frame not sent on touch emulationFurkan Sahin-0/+1
When emulating touch, the simulating_pointer_from_touch field is set to true. It's switched back to false when a touch_up event is received. However we need to ensure we always send a wl_pointer.frame event following a group of other wl_pointer events. Since a touch_frame event is always guaranteed to come after a group of touch events, unset simulating_pointer_from_touch in the touch_frame handler instead of the touch_up handler. Add a new field to know whether the touch_frame handler should stop emulation.
2021-06-30Add support for touch frame eventsFurkan Sahin-0/+1
Update for the breaking change in [1]. [1]: https://github.com/swaywm/wlroots/pull/3001
2021-07-07Update wlr_box includesFurkan Sahin-4/+1
Update for the breaking change in [1]. [1]: https://github.com/swaywm/wlroots/pull/3011
2021-06-20input: Move get_current_time_msec in from utilFurkan Sahin-6/+0
get_current_time_msec is only used in cursor.c, so we can move it in and make it static. This is primarily intended to avoid a symbol collision with wlroots, which we unfortunately do not have a good solution for yet.
2021-06-18Revert "Add workspace {prev,next}_on_output --create"Furkan Sahin-4/+2
This reverts commit 625f360512c7c3c9d941ad5825d5bb70f8b0d867. The --create flag is undocumented, not in i3, and at least partially broken (#5913), so this removes the feature.
2021-06-18Move auto_back_and_forth logic out of workspace_switchFurkan Sahin-2/+4
This extracts the code to a separate workspace_auto_back_and_forth function. It also removes the bool argument by adding an extra if statement at the call site, and repurposes the no_auto_back_and_forth variable to auto_back_and_forth for simpler understanding.
2021-03-17swaynag: adds option to set wayland shell layerFurkan Sahin-0/+1
Uses --layer/-y set to overlay|top|bottom|background
2021-03-19config: Fix swaybar pango_markup inconsistencyFurkan Sahin-1/+7
Until now, swaybar did not have pango markup enabled by default, even if the sway config had it on. This patch aims to mimic the i3 behavior, but maintaining the functionality of the "pango_markup" sway config command.
2021-03-23Implement xdg-activation-v1Furkan Sahin-0/+5
See https://github.com/swaywm/wlroots/pull/2718.
2021-05-07cairo: Replace <cairo/cairo.h> by <cairo.h>Furkan Sahin-6/+6
For full context, read https://gitlab.freedesktop.org/cairo/cairo/-/issues/479 TL;DR, cairo’s pc file adds `/cairo` to CFLAGS. So namespace cairo shouldn’t be used.
2021-04-26Remove support for arbitrary rotationsFurkan Sahin-2/+2
There was some unused code-paths for rendering surfaces with an arbitrary rotation applied. This was imported from rootston. Since we don't have plans to make use of this, remove it.
2021-03-20idle_inhibit: Store wlr inhibitor instead of viewFurkan Sahin-0/+1
When an application inhibited idle, a view pointer was stored and a destroy listener was registered to the wlr inhibitor. As the wlr inhibitor lives longer than the view, this lead to a dangling view pointer between view unmap and inhibitor destroy. Store a pointer to the wlr inhibitor instead of to the view, and look up the view when needed, which may at any point be NULL. This also allows for an inhibitor to remain functional if a surface is re-mapped.
2021-03-12Implement input method keyboard grabFurkan Sahin-0/+3
2020-12-12Fix for_window criteria and mouse button bindingsFurkan Sahin-1/+1
Previously, the special case handling of scratchpad and unmark commands was (probably accidentally) limited to criteria directly handled in the execute_command function. This would exclude: 1. for_window criteria, as these are handled externally for views and 2. and mouse bindings which select target the node currently under the mouse cursor. As a concrete example `for_window [app_id="foobar"] move scratchpad, scratchpad show` would show (or hide due to the toggling functionality) another window from the scratchpad, instead of showing the window with app_id "foobar". This commit replaces the "using_criteria" flag with "node_overridden" with the more general notion of signifying that the node (and container/workspace) in the current command handler context of the sway config is not defined by the currently focused node, but instead overridden by other means, i.e., criteria or mouse position.
2021-01-20focus: beyond fullscreen when focused explicitlyFurkan Sahin-0/+5
When issuing a focus command on a specific container, users expect to proceed it even if is hidden by a fullscreen window. This matches the behavior of i3.
2021-02-08Automatically map built-in touchscreens/tablets to built-in panelsFurkan Sahin-0/+2
Detect whether an output is built-in via its type. Detect whether a touchscreen or tablet tool is built-in via its ID_PATH property.
2021-02-24render: handle containers without output when rendering titlesFurkan Sahin-0/+1
In 43977eb92c4c5f1db0c4d9abe418535053cf039a, it was believed that if the container is being rendered, it must have an output. This turned out not to be the case. When rendering a container, all its children are rendered, even if the children is positioned off screen and thus not having any output. This is the cause of the crash in #6061. This commit introduces a null-check, which fixes #6061.
2021-02-08transaction: Remove unused ready_immediatelyFurkan Sahin-6/+0
2021-02-21transaction: Note if instructions are server requestsFurkan Sahin-0/+6
On server request, we need to send configure events to inform the client of the new intended size. If the client changes size itself, sending a configure event will only cause problems. Use transaction_commit_dirty_client to distinguish between the two transaction causes.
2021-02-22container: Add container_is_current_floatingFurkan Sahin-0/+7
Needed to check if containers are currently floating from render code, as container_is_floating checks pending state.
2021-02-12container: Move pending state to state structFurkan Sahin-30/+9
Pending state is currently inlined directly in the container struct, while the current state is in a state struct. A side-effect of this is that it is not immediately obvious that pending double-buffered state is accessed, nor is it obvious what state is double-buffered. Instead, use the state struct for both current and pending.
2021-02-12transactions: Amend pending transactionsFurkan Sahin-1/+17
The transaction system contains a necessary optimization where a popped transaction is combined with later, similar transactions. This breaks the chronological order of states, and can lead to desynchronized geometries. To fix this, we replace the queue with only 2 transactions: current and pending. If a pending transaction exists, it is updated with new state instead of creating additional transactions. As we never have more than a single waiting transaction, we no longer need the queue optimization that is causing problems. Closes: https://github.com/swaywm/sway/issues/6012
2021-02-08view: Read geometry directly in view_update_sizeFurkan Sahin-1/+1
2021-02-08transaction: Move centering to view_center_surfaceFurkan Sahin-0/+1
This will allow us to reuse it for centering elsewhere.
2021-02-02Declare all struct cmd_handler arrays constFurkan Sahin-3/+3
And make the functions handling these arrays use const types.
2021-01-08Rename output_layer_for_each_surface_{toplevel,popup}Furkan Sahin-2/+2
Swap the "surface" part for consistency with wlroots' naming.
2021-01-08Switch to wlr_xdg_surface_for_each_popup_surfaceFurkan Sahin-4/+4
Instead of calling wlr_xdg_surface_for_each_popup and then wlr_surface_for_each_surface, use the new for_each_popup_surface helper introduced in [1] that does it in one go. [1]: https://github.com/swaywm/wlroots/pull/2609
2020-12-28input: Clean up input_method_relay in seat_destoy()Furkan Sahin-0/+2
This fixes a crash that happens when input_method_new or text_method_new events are emitted after the seat has been freed.
2020-11-01introduce workspace_squashFurkan Sahin-0/+28
workspace_squash is container_flatten in the reverse direction. Instead of eliminating redundant splits that are parents of the target container, it eliminates pairs of redundant H/V splits that are children of the workspace. Splits are redundant if a con and its grandchild have the same layout, and the immediate child has the opposite split. For example, layouts are transformed like: H[V[H[app1 app2]] app3] -> H[app1 app2 app3] i3 uses this operation to simplify the tree after moving heavily nested containers to a higher level in the tree via an orthogonal move.
2020-10-25Change workspace_layout to match i3 behaviorFurkan Sahin-2/+2
In i3, the workspace_layout command does not affect the workspace layout. Instead, new workspace level containers are wrapped in the desired layout and the workspace layout always defaults to the output orientation.
2020-12-16Fix swaybar tray for non-systemdFurkan Sahin-1/+1
Meson's generated config.h header defines false macros as 0, not undefined. This means that the header line, which was checking for the definition existing, not a non-zero value, was incorrect. Now the swaybar tray can be used with systemd, elogind, or basu.
2020-12-02build: add basu as sd-bus providerFurkan Sahin-0/+2
2020-12-02build: introduce sd-bus-provider optionFurkan Sahin-2/+2
This allows to select a specific provider for the sd-bus library.
2020-12-05Add layer shell subsurfacesFurkan Sahin-0/+11
Damage subsurfaces created by layer surfaces on map, unmap and commit. This fixes the flicker of Gtk Popovers. Fixes #5617
2020-12-05input/cursor: unhide cursor on synthetic inputFurkan Sahin-1/+3
Fixes #5847.
2020-12-03common: make 'lenient_strcmp' arguments constFurkan Sahin-1/+1
Prevents build failures when calling the function with 'const char *' arguments. This is also more accurate since the function is not expected to modify the args.
2020-11-03tree/container: introduce `container_is_sticky[_or_child]` functionsFurkan Sahin-0/+7
To query whether a container is sticky, checking `con->is_sticky` is insufficient. `container_is_floating_or_child` must also return true; this led to a lot of repetition. This commit introduces `container_is_sticky[_or_child]` functions, and switches all stickiness checks to use them. (Including ones where the container is already known to be floating, for consistency.)
2020-10-31commands/focus: force container warp when fulfilling `focus mode_toggle`Furkan Sahin-1/+1
This commit switches focusing behavior to force a warp when executing `focus mode_toggle`. Fixes #5772.
2020-10-31input: remove motion deltas from seatop callbacksFurkan Sahin-9/+4
Straightforward cleanup, they haven't been used for a while.
2020-09-07hide_cursor: Add an option to hide when typingFurkan Sahin-0/+13
Add an option for the `hide_cursor` command to hide the cursor when typing, i.e. whenever a key is pressed.