Commit graph

4099 commits

Author SHA1 Message Date
Simon Ser 38571e6a0c Log when config file is not found
This happens when Sway is not installed on the system, so there's no
default config in /etc.
2021-01-17 18:07:13 +01:00
Simon Ser 43f82078cf Raise verbosity of error message in load_main_config 2021-01-17 18:07:13 +01:00
SpizzyCoder 7cf25d3b98 Changed fprintf(stdout,...) to printf(...) for more readable code 2021-01-16 20:24:41 +01:00
Ronan Pigott 915ba01ff1 config/output: correct refresh rate rounding error 2021-01-15 22:53:19 +01:00
Simon Ser 1c3cfd3bac Rename output_layer_for_each_surface_{toplevel,popup}
Swap the "surface" part for consistency with wlroots' naming.
2021-01-12 11:25:34 +01:00
Simon Ser 5438cc158a Switch to wlr_xdg_surface_for_each_popup_surface
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
2021-01-12 11:25:34 +01:00
Simon Ser 661cdac2d6
desktop/xwayland: use index constants for atom array
This ensures we don't swap two atoms by mistake.
2021-01-08 14:58:58 +01:00
Simon Ser cbd82b4117
man: update maintainer
Also remove the AUTHORS section from swaybar-protocol(7), for
consistency with the rest of the man pages.
2021-01-08 09:33:51 +01:00
Ronan Pigott d1bf3b8a86 cmd_move: update container representation in sibling swaps 2021-01-04 00:31:25 -05:00
Andri Yngvason 9ef5cc03f1 input/seat: Reset command handler context in seat_destroy()
This fixes a dangling reference which causes a use-after-free.
2021-01-01 19:02:56 +01:00
Andri Yngvason e11bc058ac input/seat: Clean up focus_stack in seat_destroy()
This fixes use-after-free when seat_destroy() has been called.
2021-01-01 19:02:56 +01:00
Andri Yngvason 98eece53ad input: Clean up input_method_relay in seat_destoy()
This fixes a crash that happens when input_method_new or text_method_new
events are emitted after the seat has been freed.
2021-01-01 19:02:56 +01:00
Simon Ser 53f5197c26 Remove create_renderer_func argument
It's removed upstream [1].

[1]: https://github.com/swaywm/wlroots/pull/2561
2020-12-30 19:36:55 +01:00
Ronan Pigott d1c4ed1867 container: set fullscreen mode before attempting focus 2020-12-24 23:34:55 +01:00
Ronan Pigott 5f1fe33d36 workspace: rework workspace prev|next like i3
Changes workspace prev|next commands to visit each numbered or named
workspace first before considering workspace from the other category
2020-12-20 00:58:42 -05:00
Ronan Pigott 89ffeaae49 commands/move: reset geometry of promoted containers 2020-12-20 00:58:42 -05:00
Ronan Pigott 432c4df6e7 commands/move: squash workspace after directional con move 2020-12-20 00:58:42 -05:00
Ronan Pigott 8eb0c54693 introduce workspace_squash
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-12-20 00:58:42 -05:00
Ronan Pigott e95c299f0a commands/move: rework container_move_in_direction
This changes the move command to better match i3
behavior after the layout changes.

workspace_rejigger handled the case where containers would
escape their workspace in an orthogonal move by changing
the layout to accomodate them, but this case is now handled
within the loop.
2020-12-20 00:58:42 -05:00
Ronan Pigott ece6a1d408 Change workspace_layout to match i3 behavior
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-20 00:58:42 -05:00
Ronan Pigott b4850876dc Revert "commands/move: maintain workspace_layout when moving"
This is in preparation for changing the workspace_layout
command to work like it does in i3.

This reverts commit b4a75a1ab2.
2020-12-20 00:58:42 -05:00
Tudor Brindus 971aa90ccc commands/move: don't flatten on move; reap empty former parent instead
Some comparisons of current Sway versus i3 behavior:

1) T[T[T[app]]] + move left
* Sway: T[app]
* i3:   T[T[app]]

2) H[V[H[V[app]]]] + move left
* Sway: H[app]
* i3:   H[V[app]]

After this commit, Sway behavior matches i3. The intermediate states
are now:

    T[T[T[app]]] -> T[T[app T[]]] -> T[T[app]]
    H[V[H[V[app]]]] -> H[V[app H[V[]]]] -> H[V[app]]
2020-12-20 00:58:42 -05:00
Ronan Pigott d54c8e885b commands/layout: don't change the layout of workspaces with children
In i3 the layout command on a workspace affects the workspace layout
only on empty workspaces. Otherwise children are placed in a new
container with the desired layout to preserve the workspace layout.
2020-12-20 00:58:42 -05:00
Ronan Pigott 2478f2f010 container: don't split single children
In i3 splits are ineffective on singleton H/V containers,
and the command is interpreted to affect the parent layout
instead.
2020-12-20 00:58:42 -05:00
Simon Ser 33b64667ae Test output before direct scan-out
This avoids some log spam.

Eventually when we wire up the atomic test commit this will take care of
the other log spam referenced below.

References: https://github.com/swaywm/sway/pull/5010
References: https://github.com/swaywm/wlroots/issues/2181
Closes: https://github.com/swaywm/wlroots/issues/2532
2020-12-20 00:51:46 -05:00
Simon Ser a68c6a00ca Route wlroots logs into Sway logging infrastructure
Instead of letting wlroots print messages to stdout, route debugging
messages into Sway's logging functions. This allows a more consistent
output (e.g. if Sway or wlroots changes its output style, they don't get
out-of-sync).

I also added a [wlr] prefix to wlroots messages, not yet sure it's a
good thing.
2020-12-09 23:57:12 -05:00
Simon Ser a1591c23d2
Handle secondary headless backend failures 2020-12-08 16:15:48 +01:00
Isaac Freund 5ad3990a6c Drop gtk-primary-selection support 2020-12-08 11:15:03 +01:00
Vlad Pănăzan 71725a8eae Add layer shell subsurfaces
Damage subsurfaces created by layer surfaces on map, unmap and
commit. This fixes the flicker of Gtk Popovers.

Fixes #5617
2020-12-07 12:30:13 +01:00
Tudor Brindus cc2c0d5966 input/cursor: unhide cursor on synthetic input
Fixes #5847.
2020-12-06 09:38:49 +01:00
Paul Riou b5cc11b226 criteria: fix crash when comparing NULL properties
For each following combinations of criteria & command below, the command would
crash sway without the fix.
It's particular about the __focused__ criteria, where the view matches part of
the criteria but not the focused app, leading to a failure when calling
`strcmp` with NULL.

"xterm" is a non-wayland app (X11) and "kitty" is. Both are terminals.

    # "class" is specific to X11
    # The view is X11 (xterm) leading to the criteria checking for the
    # focused app's class, leading to a crash
    for_window [class="__focused__"] floating enable
    exec kitty -e xterm

    # Similarly, crash as the focused app (xterm) has no app_id when the view has one
    for_window [app_id="__focused__"] floating enable
    exec xterm -e kitty

    # If the view has a title but not the focused app: NULL title will crash criteria checking
    for_window [title="__focused__"] floating enable
    exec xterm -title "" -e xterm
2020-12-04 10:49:49 +01:00
Ronan Pigott 32b93ef6ea xdg_shell: allow views to change geometry anytime
Currently, when sway sends a configure with some geometry and the
client responds with a different geometry in a commit that acks that
configure, sway ignores the new size. Sway applies the surface
geometry it had requested to the container, not what was actually
committed, in the following transaction.

This change allows any client commit to change its surface geometry,
even if it is a response to a configure event.
2020-11-24 09:47:23 +01:00
Rex Hackbro f1afef5533 document parse_error 2020-11-21 11:42:29 +01:00
Simon Ser 83389da583
Log which output is using direct scan-out 2020-11-16 13:53:49 +01:00
Brian Ashworth 9d6787d10d input/keyboard: fix Group# bindings for keyboard groups
The keyboard group's effective keyboard layout was never being changed
due to a condition that incorrectly preventing it from being performed.
The IPC event that follows the change was correctly being prevented.
2020-11-12 10:52:45 +01:00
Tudor Brindus 07042486c3 tree/container: introduce container_is_sticky[_or_child] functions
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-11-11 20:43:58 -05:00
Simon Ser a56098a24e
Add missing includes for wlr_input_device.h
References: https://github.com/swaywm/wlroots/pull/2470
2020-11-11 15:40:50 +01:00
Simon Ser bb342ac5e6
Replace wlr_key_state with wl_keyboard_key_state
References: https://github.com/swaywm/wlroots/pull/2446
2020-11-11 11:00:55 +01:00
Tudor Brindus 0df5753aed input/seatop_default: consider fullscreen views to have no edges
Previously, `find_edge` on a single fullscreen view would occasionally
return an edge rather than `WLR_EDGE_NONE`. This would trigger entry
into `seatop_resize_tiling`, which doesn't have meaning for a fullscreen
view.

The result was that the fullscreen container hitbox was considered to be
that of where it'd be if it were tiling, so most clicks would not go
through.

Fixes #5792.
2020-11-05 12:25:15 +01:00
Tudor Brindus c523aa623b input: fully change focus when scrolling tabs/stacks
When scrolling on a tabbed/stacked container, i3 focuses its
inactive-focused focused child. Sway does the same, but then resets the
focus to whatever was focused previously.

Ref e5992eed16/src/click.c (L207-L219)
2020-11-01 04:05:38 -05:00
Tudor Brindus 60d95414d4 commands/focus: force container warp when fulfilling focus mode_toggle
This commit switches focusing behavior to force a warp when executing
`focus mode_toggle`.

Fixes #5772.
2020-11-01 03:43:00 -05:00
Tudor Brindus 8c12e71a66 input: remove motion deltas from seatop callbacks
Straightforward cleanup, they haven't been used for a while.
2020-10-31 23:15:32 +01:00
Tamir Zahavi-Brunner 96578aa91e hide_cursor: Add an option to hide when typing
Add an option for the `hide_cursor` command to hide the cursor when
typing, i.e. whenever a key is pressed.
2020-10-30 09:59:54 +01:00
mwenzkowski 4799cb0960 output: Revert implementation of evacuate_sticky()
The function evacuate_sticky() was changed in commit 32788a93 to be used
by workspace_for_each_container() to make the code more readable. But I
overlooked that it is not safe to use workspace_for_each_container() to
remove container from a workspace. This commit restores the previous
implementation for evacuate_sticky().
2020-10-28 09:45:12 -04:00
Dimitris Triantafyllidis 39328ca4e4 In container_split, set a floating container's view to tiled
Currently, when a floating container with a view is split and
children are added to it, the new views are rendered as tiled,
while the first view stays in floating style.

Here this is addressed by setting the view to tiled as soon
as the container is split, by duplicating the "view part" of
the logic in container_set_floating(..., false). Since the new
container of the view is no longer considered floating, it
makes sense to set the view to tiling at this point.

The view would have to be set back to floating if it was possible
to "unsplit" the container.
2020-10-28 00:36:33 -04:00
mwenzkowski 32788a93f2 output: evacuate sticky containers only if new output has a workspace
Sticky floating containers on an otherwise empty workspace can only be
evacuated if the new output has an active workspace. The noop output may
not have one and in that case we have to move the whole workspace to the
new output.
2020-10-27 19:26:26 -04:00
Dimitris Triantafyllidis 0cb9282aee Smart borders fix: always show borders for floating containers
Currently, in view_autoconfigure, the only condition for show_border
is !view_is_only_visible. view_is_only_visible does not cross the
boundary between the workspace's tiling and floating lists and does not
differentiate between them.

The result is, that in a workspace with zero or more tiling containers
and a single floating container, the floating container will lose its
borders as soon as it is split, provided that a only one view is visible
within the floating container.

Fixed by adjusting the condition for show_borders.
2020-10-25 21:59:40 -04:00
mwenzkowski 13a67da614 container: Fix NULL pointer dereference
Reset the workspace layout to the output's default only if the workspace
is actually attached to an output.

Fixes #5762
2020-10-24 19:40:25 -04:00
Ronan Pigott d06c1ac1e9 commands/move: fix crash when moving sphsc child 2020-10-24 02:15:30 -04:00
Daniel De Graaf 1be66c98f2 commands/resize: don't consider 1px resizes to be invalid
A "resize shrink width 1px" will cause grow_x to be 0 while grow_width is -1,
incorrectly rejecting the command even though the resize is not a noop.  Fix
this by checking width/height instead of x/y.
2020-10-22 09:10:10 +02:00
Ronan Pigott 9e272a7986 tiling_resize: abandon resize if a sibling con dies 2020-10-20 20:23:50 +02:00
Tudor Brindus cc8d318aa1 transaction: make transaction collapsing smarter with > 2 views
Sway maintains a list of pending transactions, and tries to merge
consecutive transactions applying to the same views into one. Given
a pending transactions list on views {A, B, C} of:

  A -> A' -> A'' -> B -> B' -> B''

Sway will collapse the transactions into just A'' -> B''. This works
fine when doing things like resizing views by their border. However,
when interactively resizing layouts like H[V[A B] C], we end up with
pending transaction lists like:

  A -> B -> C -> A' -> B' -> C' -> A'' -> B'' -> C''

Previously, Sway would not be able to simplify this transaction list,
and execute many more transactions than would be necessary (the final
state is determined by {A'', B'', C''}).

After this commit, the transaction list gets simplified to A'' -> B'' ->
C'', resolving performance problems (that were particularly noticeable
with high-refresh-rate mice).

Fixes #5736.
2020-10-19 01:40:10 +02:00
Tudor Brindus 8355884fbd transaction: validate X transaction completions by geometry, not size
Xwayland views are aware of their coordinates, so validating transaction
completions should take into account the reported coordinates of the
view. Prior to this commit they didn't, and matching dimensions would
suffice to validate the transaction.

Also introduced `transaction_notify_view_ready_immediately` to support
the fix from d0f7e0f without jumping through hoops to figure out the
geometry of an `xdg_shell` view.
2020-10-18 22:37:42 +02:00
Tudor Brindus 5bd6a5ce3f transaction: don't reconfigure X views unless integral coords changed
Sway logical coordinates are doubles, but they get truncated to integers
when sent to Xwayland through `xcb_configure_window`. X11 apps will not
respond to duplicate configure requests (from their truncated point of
view) and cause transactions to time out.

Fixes #5035.
2020-10-18 22:12:16 +02:00
Ronan Pigott 33affb33d2 tiling_drag: emit window move ipc events 2020-10-18 21:56:35 +02:00
Tudor Brindus 181798c2fe xwayland: listen to set_geometry event
Closes #5735, refs #3007.

This makes the "Search everywhere" dialog in JetBrains IDEs movable.
2020-10-18 15:18:53 +02:00
Ronan Pigott 5bcbc0b4a9 seat: use default output mapping if there is no input config 2020-10-16 18:34:09 +02:00
Tudor Brindus ed247c031c input/tablet: add tool_mode option to set tablet tools as relative input
Closes #4139.
2020-10-12 15:01:37 +02:00
Tudor Brindus 136add4e12 input/cursor: default tablet lens tool to relative motion
It is recommended that mouse and lens cursor tool default to relative
mode and all pen-like tools to absolute mode.

Refs
https://wayland.freedesktop.org/libinput/doc/1.11.3/tablet-support.html#tablet-relative-motion.
2020-10-12 15:01:37 +02:00
Tarmack 989123a2a5 Add support for workspace_min_width bar option. 2020-10-11 19:12:42 +02:00
Tobias Langendorf 657587964e xwayland: support views that change override-redirect status 2020-10-10 09:53:41 +02:00
Tudor Brindus 392d4808c3 commands/move: fix single-split escaping on move
Prior to this commit, having a layout like T[app1 V[app2]], focusing
app2, and then doing `move left` would result in T[app2 app1]. Now, the
resulting layout is T[app1 app2], which matches i3 behavior.

`container_flatten` updates `container->parent`, meaning that the
existing check would never be true.
2020-10-04 21:02:35 -04:00
Tudor Brindus bc239b2f6b desktop/render: show indicators for top-level split
i3 shows indicators for the workspace-level pseudo-split, but Sway does
not, as of b977c02. This commit replaces the floating container check
with a call to `container_is_floating`, which has some more robust
checks in place.

Fixes #5699.
2020-10-04 20:54:58 -04:00
David96 c150177a94 Make focus_follows_mouse work when hovering a layer-shell surface on another output
Fixes #5668
2020-09-26 17:42:14 -04:00
John Mako 4537c8b3d4 check parent surface before it is destroyed 2020-09-19 21:31:31 +02:00
Rouven Czerwinski 41999d7c9f cursor: update hide timer during config apply
We can't arm the timer during cursor creation since the config may not
be ready yet. Instead arm the timer while applying the input
configuration, by this time the configuration has been parsed and we can
arm the hide timer.

Fixes #5686
2020-09-16 07:53:57 +02:00
Geoffrey Casper 65a751a21f server: Avoid using "wayland-0" as WAYLAND_DISPLAY
See https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/486
2020-09-16 00:14:20 +02:00
Rouven Czerwinski 299a159add cursor: arm cursor hide timer immediately
According to the wayland docs, wayland timers are disarmed on creation.
This leads to the cursor not being hidden if there is no activity after
creation, since the timer is armed on activity, but not at creation.
Arm the timer after creation to ensure the cursor is hidden even if
there is no cursor activity after creation.

Fixes #5684
2020-09-15 09:55:30 +02:00
Tudor Brindus 2efecc14ef input/pointer: update cursor activity after updating button counts
Otherwise, Sway will not re-hide a cursor after the last button has been
released.

Needed alongside afa890e to fix #5679.
2020-09-14 22:28:21 -04:00
Rouven Czerwinski afa890e8e9 input/cursor: reset event source after unhide
Reset the event source after unhiding the cursor, to ensure that the
timeout starts after showing the cursor. Also remove the open coded
variant in seat_consider_warp_to_focus().

Fixes #5679
2020-09-14 18:14:08 -04:00
BrassyPanache 7ca9ef12f8 Re-focus on parent surface if it is available
My primary issue was IntelliJ IDEA's code suggestion pop-up not returning focus
to the active editing window.

I have spent some time looking at the changes of @Xyene (#5398) and
@RyanDwyer (#2103). I think my proposed change maintains the status
quo for the most part whilst fixing my focus issue.

I have verified that @Xyene's fix for IntelliJ sub-menus still works.

I have done basic testing which consists of:

- Chrome
- IntelliJ IDEA 2020.2.1
- VSCode
- Alacritty

It seems to hold up. I at least didn't see any obvious errors.

Relates to #3007
2020-09-04 17:00:22 -04:00
Brian Ashworth 2ea5d2985a input/libinput: remove input type property bias
This changes it so all libinput config options are set on any device
that supports it. Previously, only a subset of libinput config options
were being considered depending on the input type. Instead of trying to
guess which properties the device may support, attempt to set any
configured property regardless of the device type. All of the functions
already have early returns in them for when the device does not actually
support the property. This brings the configuration side inline with
describe_libinput_device for the IPC side. This change was prompted
by a tablet tool showing the calibration matrix property in the IPC
message, but not being able to actually change it since that property
was only being considered for the touch input type.
2020-09-03 10:46:06 +02:00
Simon Ser 2c76923282 Use wlr_output_event_commit
Instead of listening to both transform and scale events, we can listen
to the commit event and use the new wlr_output_event_commit struct to
decide what to do.

This de-duplicates some of the work we were doing twice when an output
was re-configured.

Depends on [1].

[1]: https://github.com/swaywm/wlroots/pull/2315
2020-08-27 13:57:10 -06:00
Konstantin Pospelov fd216b3a81 exec: fix validation during config reload
Split cmd_exec_always into separate methods for general validation and
process creation. This fixes a potential call of join_args with 0 arguments.
2020-08-24 09:41:54 +02:00
Simon Ser 6991ac8c70 Handle SIGINT
Gracefully exit on SIGINT, like we do for SIGTERM.
2020-08-11 18:37:11 -04:00
Ronan Pigott b7f28cd6b7 view: remove foreign toplevel listeners on destroy 2020-08-05 11:05:49 +02:00
Ronan Pigott f478f4cc66 view: implement foreign toplevel fullscreen request 2020-08-05 11:05:49 +02:00
Ronan Pigott a01573016a view: implement foreign toplevel fullscreen indicator 2020-08-05 11:05:49 +02:00
Rex Hackbro 8fb9f3b711 document force_display_urgency_hint 2020-08-03 15:39:48 +02:00
Rex Hackbro 12a9ae013e fix force_display_urgency_hint parsing 2020-08-03 15:39:48 +02:00
Rex Hackbro d25e308f9c fix typos 2020-08-03 10:41:38 +02:00
Antonin Décimo bbf7b92fe4 Fix incorrect format specifiers 2020-07-30 22:02:42 -04:00
Antonin Décimo a1c6052383 Log empty value if envvar is not defined
If the environment variable is not defined, getenv returns NULL.
Passing a NULL pointer to the "%s" format specifier is undefined
behavior. Even if some implementations output "(null)", an empty
string is nicer.
2020-07-30 22:02:42 -04:00
Antonin Décimo 2960b2c9b6 cmd/bar/colors: fix dereference of null pointer
`!*rgba` tests if the first byte of rgba isn't `'\0'`.
`hex_to_rgba_hex` returns NULL if `parse_color` fails. There's a null
pointer dereference in that case. The intended behavior is `!rgba`.
2020-07-30 22:02:42 -04:00
Antonin Décimo 8033b575f7 ipc: fix aligment issue of data buffer
The pointer `data` is cast to a more strictly aligned pointer type. To
prevent issues, the `data32` buffer is removed and its occurrences are
replaced with an offset from the `data` buffer.
2020-07-30 22:02:42 -04:00
Thayne McCombs b20d52f71d Use wlr_output_layout_output_at to get output for move to cursor 2020-07-27 11:27:47 +02:00
Thayne McCombs cfa403fc58 Keep windows in bounds on move to position mouse
If the mouse/cursor/pointer is near the edge of an output when a "move
position to pointer" command is run, then the floating container will be
constrained to fit inside the bounds of the output as much as possible.

This behavior matches what i3 does in this scenario. I also think it is
a better user experience.

Relates to #4906

The logic for the bounds check follows the implementation in i3: 7330778223/src/floating.c (L536)
2020-07-27 11:27:47 +02:00
Ronan Pigott dae74057b3 commands: disallow runtime include 2020-07-27 10:54:04 +02:00
Ronan Pigott 3520fd2c19 view: display scratchpad hidden containers when activated by ftm 2020-07-25 11:53:01 -04:00
Tobias Langendorf 4f718e6c75 Fix X11 clients getting stuck minimized
Usually it should be enough to simply not grant a client's
minimize request, however some applications (Steam, fullscreen
games in Wine) don't wait for the compositor and minimize anyway,
getting them stuck in an unrecoverable state.
Restoring them immediately lead to heavy flickering when unfocused
on my test application (Earth Defense Force 5 via Steam), so it's
preferable to grant their request without actually minimizing and
then restoring them once they are in focus again.
2020-07-22 18:50:57 -04:00
Antonin Décimo 7c7afa3b29 Fix typos in man page. 2020-07-21 17:45:09 +02:00
Nils Schulte b513981378 added ppt unit to move position command 2020-07-21 10:07:01 +02:00
Nils Schulte 6898d1963f moved and renamed movement-unit parsing to common 2020-07-21 10:07:01 +02:00
Ronan Pigott 36c3c222d2 sway.5: add missing underscore 2020-07-19 11:03:24 -04:00
Andri Yngvason ab8ded626b desktop: output: Scale custom output refresh rate
This fixes an issue with wlr-output-management causing the frame rate to
jump to 60000 Hz when setting a custom mode.
2020-07-18 18:21:51 +02:00
Tudor Brindus 6b9a9b6246 input/cursor: don't send wl_pointer.motion event on pointer unlock warp
On warping to a cursor hint, update the pointer position we track as
well, so that on the next pointer rebase we don't send an unexpected
synthetic motion event to clients.

Fixes #5405.
2020-07-15 19:40:09 +02:00
Ronan Pigott 4dd46f06ac xdg_shell: schedule configure on maximize requests 2020-07-14 15:46:02 +02:00
Simon Ser 9bb70283e9 Assert output is found before removing from list
References: https://github.com/swaywm/sway/issues/5483
2020-07-13 17:33:54 -04:00
Ronan Pigott 39d677af15 input: implement xdg_toplevel interactive resize hints 2020-07-13 00:21:52 -04:00
Simon Ser 5432f00adf config/output: don't change output state before commit
Previously, we called output_disable prior to wlr_output_commit. This
mutates Sway's output state before the output commit actually succeeds.
This results in Sway's state getting out-of-sync with wlroots'.

An alternative fix [1] was to revert the changes made by output_disable
in case of failure. This is a little complicated. Instead, this patch
makes it so Sway's internal state is never changed before a successful
wlr_output commit.

We had two output flags: enabled and configured. However enabled was set
prior to the output becoming enabled, and was used to prevent the output
event handlers (specifically, the mode handler) from calling
apply_output_config again (infinite loop).

Rename enabled to enabling and use it exclusively for this purpose.
Rename configure to enabled, because that's what it really means.

[1]: https://github.com/swaywm/sway/pull/5521

Closes: https://github.com/swaywm/sway/issues/5483
2020-07-10 18:18:27 -04:00