Commit Graph

6578 Commits

Author SHA1 Message Date
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
Mark Stosberg 45aa5c104c swaymsg.1: correct typo 2020-08-05 20:41:07 -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
Hubert Hirtz c5c632aaae Document required '\n' in swaybar-protocol
The following statusbar output is not considered by sway to be following
the swaybar-protocol:

    {"version":1}[[{"full_text":"2.89","urgent":false}],

However this one is:

    {"version":1}\n[[{"full_text":"2.89","urgent":false}],

Both outputs contain a header with the required values and an unfinished
array of objects with the required values, but the first one is showed
verbatim.
2020-08-04 10:39:29 +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 5c67d99794 common/loop: check return of realloc 2020-07-30 22:02:42 -04: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
Charmander 66b7ac6a82 swaybar: allow status line cleanup to proceed when hidden
`determine_bar_visibility` stops and starts the status command process according to the bar’s visibility. If the bar was hidden during teardown, teardown would stall while waiting for the stopped status command process to exit.

This resumes a stopped status command during teardown and allows, for example, sway to reload or quit without leaving a swaybar instance behind each time.

Fixes #5536.

CONT before TERM as requested in review.
2020-07-22 09:40:37 +02: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
Michael Weiss 380f6c9b46 contrib/_incr_version: Disallow the "v"-prefixed version format
The check is a bit strange but should be POSIX compliant.
2020-07-17 05:44:24 -06:00
Michael Weiss 6deb4ff40b meson.build: Fix the version format
The current version is prefixed by a "v" and therefore breaks the output
of "swaymsg -rt get_version" which is implemented trough
"sscanf(SWAY_VERSION, "%u.%u.%u", &major, &minor, &patch)".

The prefixed "v" was added in 8b2ff2f1, probably by accident.
2020-07-17 05:44:24 -06:00
Simon Ser e215557ba0
Bump version to 1.5 2020-07-16 00:59:41 +02:00
Simon Ser 9f944ff05d
Bump wlroots dependency to 0.11.0 2020-07-16 00:59:25 +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
Michaël Defferrard 2f3afef95c readme: link to the development doc
The subproject compilation is the best way to test sway and wlroots but it's hidden. I only found it from comments in issues.
2020-07-15 19:13:41 +02:00
Vinko Kašljević c65cd1cffa Add check for empty GEOM variable
In case when slurp is used to select part of screen or a window, if user aborts
the selection, grimshot will capture the whole screen instead of exiting. This
is fixed with check for empty variable.
2020-07-15 18:49:32 +02:00
Campbell Vertesi acbe902815 Add note on quoting to swaymsg manpage 2020-07-15 16:17:11 +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
Jonas Große Sundrup 10ec97c073 rephrase swayidle-timout example to improve readability 2020-07-12 14:29:49 +02:00
Wai Hon Law 585236f168 Make the default workspace commands compatible with i3
**Problem**

When I rename the workspace to something like "1:web",
`$mod+1` does not move to the "1:web" with the default config. This breaks
the expectation of i3 users.

**Cause**

The default Sway binding for `$mod+1` does not have the number
keyword:

```
bindsym $mod+1 workspace 1
```

Instead, the default Sway binding for `$mod+1` is

```
bindsym Mod1+1 workspace number $ws1
```

e6662df114
is the corresponding commit from i3.
2020-07-11 20:18:11 -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
Geoffrey Casper ea3ba203cc Reload command now matches i3's implementation 2020-07-07 17:15:57 -04:00
Nick Diego Yamane e5954f321f seat/dnd: support null drag icon surfaces
As per the Wayland spec [1]:

> The icon surface is an optional (can be NULL) surface that provides an
> icon to be moved around with the cursor.

However, as of now Sway "start_drag" signal handler does not starts the
DND session unless a non-NULL drag icons is provided. This patch fixes
it by skipping handling of the drag icon if it is null.

Fixes #5509

[1] https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_data_device

Signed-off-by: Nick Diego Yamane <nickdiego@igalia.com>
2020-07-07 00:05:35 +02:00
Brian Ashworth bac9559665 ISSUE_TEMPLATE: Use the newer issue templates
This utilizes the newer Github issue templates. They allow for the user
to specify what type of issue they are submitting to allow for a more
specific issue template to be shown.

In addition to a hopefully easier to read/parse/follow bug report
template, this also include templates for enhancements and i3
compatibility. This also includes a link to the IRC under the section
title Questions.

For the three templates, the labels bug, enhancement, and i3-compat will
be automatically applied for the appropriate report to assist in
triaging.

Hopefully, this will result in less questions and issues for new window
management functionality on Github and allow for better quality issues
being submitted. At the very least, it allows us to outline our
stances for bugs, enhancements, and i3-compatibility in an easier to
read format.
2020-07-06 23:30:14 +02:00
Jan Beich 1d149230ea protocols: sync wlr-layer-shell-unstable-v1 with wlroots 2020-07-05 09:58:39 +02:00
Tudor Brindus b4a75a1ab2 commands/move: maintain workspace_layout when moving
Fixes #5157.
2020-07-03 18:40:59 -04:00
wb9688 17ff13fc84 Replace unprintable characters in input device id 2020-07-03 14:59:20 +02:00
Simon Ser b5a35c484f tree/view: fix segfault in view_update_title
xdg-shell doesn't allow clients to set the title to NULL, so we
shouldn't need to call wlr_foreign_toplevel_handle_v1_set_title with an
empty string to reset the old one.

Closes: https://github.com/swaywm/sway/issues/5488
2020-07-03 09:23:35 +02:00
Simon Ser eb4fa18308 Unset DISPLAY when wlr_xwayland fails
Avoids having applications connect to a leftover DISPLAY when Xwayland
fails to initialize.
2020-07-02 23:55:56 -04:00
Simon Ser dfccd2a4c4 Don't set xwayland cursor when wlr_xwayland failed
This causes a NULL pointer dereference.
2020-07-02 23:55:56 -04:00