Commit graph

6276 commits

Author SHA1 Message Date
lbonn 3ee3a9ef60 focus: support focus_wrapping workspace
Following i3 support: https://github.com/i3/i3/pull/3407
2019-10-17 13:48:52 +03:00
A. M. Joseph 74c0e7921a xwayland.c handle_map(): NULL out xsurface->data() to prevent crashing.
When changing a surface from managed to unmanaged in handle_map(), the
call to handle_destroy(.., view) causes the sway_xwayland_view pointed
to by the untyped wlr_xwayland_surface.data field to become invalid
garbage, yet the untyped wlr_xwayland_surface.data continues to point
at it.  In particular: view_get_*(view_from_wlr_surface(..)), even
with appropriate NULL checking, will crash sway when this codepath is
exercised (reliable test case: drop-down menus in Google Earth).
2019-10-17 11:40:16 +03:00
Drew DeVault d19f4f7bf8 Updates per wlroots layer shell changes 2019-10-16 10:24:15 -04:00
Lauri 992726a823 Grimshot: a helper for screenshots within sway
Usage:
   grimshot copy|save win|screen|area [FILE]
Troubleshoot:
   grimshot check

Requirements:
  - `grim`: screenshot utility for wayland
  - `slurp`: to select an area
  - `swaymsg`: to read properties of current window
  - `wl-copy`: clipboard utility
  - `jq`: json uliity to parse swaymsg output
  - `notify-send`: to show notifications
  Those are needed to be installed, if unsure, run `grimshot check`

Examples:

 `grimshot copy win` - to copy current window
 `grimshot save area` - to select area and save it to default file (Pictures/Grimshot-$datetime.png)
`grimshot save screen ~/screenshot.png` - to save screenshot under ~/screenshot.png
`grimshot` - usage
`grimshot check` - verify if tools are installed
2019-10-16 10:08:08 -04:00
Simon Ser 72ba9bef4b build: always use the project version
Don't use the latest tag, always use the project version for the version
string. Because of version branches, getting the version from Git can be
unreliable.

Closes: https://github.com/swaywm/sway/issues/4631
2019-10-16 09:42:28 -04:00
Rouven Czerwinski 344c259ec0 sway(5): move workspace_layout to config only
According to the source files, workspace_layout is a configuration only
command, move it to the correct section within the man page.
2019-10-16 14:21:45 +03:00
Drew DeVault 533acbe679
Update version to 1.2 2019-10-12 22:58:05 +03:00
Drew DeVault 12505e4c27 Update .github/FUNDING.yml 2019-10-11 19:36:58 -04:00
Wieland Hoffmann f79f00dbfb sway(5): Highlight valid values in the description of tiling_drag 2019-10-09 23:32:08 +03:00
Wieland Hoffmann 42db4468a0 sway(5): Add a missing verb 2019-10-09 23:32:08 +03:00
Simon Ser b4d785cf39 build: bump wlroots version to 0.8.1 2019-10-08 12:42:40 -04:00
Tadeo Kondrak 352a3e1f79 build: remove rootston from wlroots subproject
Fixes an invalid option warning from Meson.
2019-10-02 20:40:03 -04:00
Arkadiusz Hiler cf18bd8879 Fix syntax in examples in sway-output(5)
Some examples use comma to separate x and y for setting the output
position which is wrong.

Let's change it to spaces, as correctly demonstrated in the
`output <name> position|pos <X> <Y>` section.
2019-10-02 17:37:54 -04:00
Sebastian Krzyszkowiak edcd353a00 layer-shell: Fix damage tracking of nested popups
Popups are positioned relative to local surface coordinates of the
parent surface. There's no need to consider values set with
xdg_surface.set_window_geometry for parent surfaces.
2019-09-29 19:50:58 +03:00
Simon Ser 00c4c7e8cc Fix direct scan-out flickering
Sometimes when using direct scan-out, some flickering between the
fullscreen app and the regular desktop could be seen.

This happened because we called wlr_output_attach_render and then
wlr_output_attach_buffer for direct scan-out. wlr_output_attach_render
makes the OpenGL context current but also attaches the OpenGL buffer to
the primary plane apparently (all of this happens inside
eglMakeCurrent).

This patch moves the scan-out logic outside of output_render, before
wlr_output_attach_render. This lines it up with rootston's
implementation. This also makes more sense since no rendering is
involved when using direct scan-out.

Sorry about that, I should've tested this with more clients. The new
code has been tested with mpv and a GLFW demo.
2019-09-26 10:36:18 -04:00
John Chadwick 7e420cb6e4 input: Add support for tablet protocol.
Sway has basic support for drawing tablets, but does not expose
properties such as pressure sensitivity. This implements the wlr tablet
v2 protocol, providing tablet events to Wayland clients.
2019-09-25 23:10:33 -04:00
Simon Ser 875edc9c2f Add support for fullscreen view direct scan-out 2019-09-25 23:00:08 -04:00
Drew DeVault 8053aed9df config.in: set default term to alacritty 2019-09-25 22:40:04 -04:00
Simon Ser 08b3eaf930 build: update wlroots version, be more strict
wlroots versions are incompatible with each other. Often our users struggle
with figuring out that their wlroots version is too old after a new release.
Use a more strict version check to prevent building sway with incompatible
wlroots versions.
2019-09-23 11:27:11 -04:00
Ronan Pigott ec66bb987a view: create container before selecting workspace 2019-09-22 15:18:51 -04:00
Simon Ser c41c24d684 Error out on unknown debug flag
Otehrwise it's pretty easy to misremember a flag and think damage=rerender is
enabled when it's not.
2019-09-22 15:17:59 -04:00
Brian Ashworth da0ad4c39e view: always populate pid
If the view was mapped as fullscreen or the view was assigned either a
workspace or output, the pid was not being populated since it was
occurring as part of the pid mapping check in select_workspace. This
extracts the pid population and makes it so it is always executed
2019-09-20 20:47:59 +03:00
xdavidwu 3a2e860848 swaybar: make status block text render in the same way as others
Other components like workspace button, status line (error or plain
text) already render text at integer coords. This make status block
also render text at integer coords.
2019-09-20 11:31:50 -04:00
Ivan Molodetskikh fba248ed5e render: set surface as sampled for presentation 2019-09-19 19:47:24 +03:00
Martin Michlmayr a085e6495c swaymsg.1: fix typos 2019-09-12 14:56:36 +03:00
Martin Michlmayr c11c8a583f sway-output.5: fix variable name
__foo__ is verbatim in scdoc, but we want the variable foo in italic,
i.e. _foo_.
2019-09-11 15:34:11 +03:00
Martin Michlmayr 8724900e38 swaymsg.1: fix description of --pretty 2019-09-10 00:14:59 +03:00
Ivan Molodetskikh db6a9d08f9 Add Russian translation of the README 2019-09-09 19:09:57 +03:00
Aleksis 982e01f46c remove unused layer shell surface variable 2019-09-07 20:22:54 +03:00
Brian Ashworth aa8ea2fa82 sway.5: clarify that a marks are unqiue
This just clarifies that a mark can only be set for a single window
since they are used as unique identifiers
2019-09-05 22:04:02 +03:00
Nils ANDRÉ-CHANG 21717d2ed2 Fix type (an -> and) 2019-09-05 22:02:33 +03:00
Versus Void 2c1a11016c Do not search for edges on subsurfaces, fix #4381
Subsurfaces (in most cases popups) aren't decorated by sway
and will never have any borders, but may be drawn beyond container
boundaries producing false positive when searching for edge.
So we want to skip edge search when handling mouse event on subsurface.
2019-09-05 17:41:23 +03:00
Brian Ashworth 1fd2c6ba49 swaybar: complete barconfig_update event handling
This adds complete support for the barconfig_update ipc event. This also
changes the bar command and subcommand handlers to correctly emit the
event. This makes it so all bar subcommands other than id and
swaybar_command are dynamically changeable at runtime. sway-bar.5 has
been updated accordingly
2019-09-04 16:48:50 -10:00
Brian Ashworth 187306640b seatop_default: only focus container on press
This matches i3's behavior of only focusing a container when pressed.
This allows for `bindsym button1 nop`, `bindsym BTN_LEFT nop`, or
`bindcode 272 nop` to be used to disable focusing when clicking on the
title (or with additional flags to bind{code,sym} other portions of
the container).

Without this additional condition, the user would need both
`bindsym button1 nop` and `bindsym --release button1 nop` to override
both the pressed and released behavior.
2019-09-04 16:48:34 -10:00
Ben Brown 0ad5e355bd Add icon_theme_path to find_icon() search if set
find_icon() will search in theme appropriate subdirs.
2019-09-04 03:32:45 -04:00
xPMo 42a7860dcf Fix bar_state_update docs 2019-09-03 22:22:25 -04:00
Ben Brown b46c53957f Fix typo for the force/immediate option in xwayland_mode enum 2019-09-02 17:06:38 +03:00
Simon Ser 1b396273bb man: document how to specify multiple xkb layouts and options
This isn't described in xkeyboard-config(7).
2019-09-02 08:39:25 +09:00
Simon Ser 53e01bf5c7 layer-shell: don't give focus to unmapped layer surfaces
Focused layers are not cleared when destroyed, they are cleared on unmap.
Giving focus to an unmapped layer surface is (1) incorrect and (2) triggers a
use-after-free.

Closes: https://github.com/swaywm/sway/issues/4517
2019-09-01 09:58:03 +09:00
Kenny Levinsen b2ee5bc05d Ensure that seat->focused_layer is cleared on unmap
The current seat may have changed between the last focus change and
this unmap, so we need to scan through all seats to find our layer.
2019-09-01 00:03:18 +03:00
xdavidwu 07d7af593d seat: set cursor image only if no pointer cap previously
This make seat_update_capabilities set cursor image only if
there was no pointer cap before update. This avoid resetting
cursor to left_ptr if an input device is removed.
2019-08-31 23:13:12 +09:00
xdavidwu afde6369b8 seat: avoid unneeded reloading xcursor theme
Load xcursor theme on configuring pointer or tablet tool only if
there was no pointer cap before.
2019-08-31 23:12:33 +09:00
Martin Michlmayr 3dcfa2ee90 Fix markup syntax in man pages 2019-08-31 22:50:39 +09:00
Brian Ashworth 1a8b9fda8a cmd_mode: don't reset to default after subcommand
In cmd_mode, the mode is currently being reset to the default mode after
a mode subcommand handler is executed. This stores and restores the mode
instead
2019-08-27 13:45:04 +09:00
Drew DeVault c55bc40cc1 chmod +x contrib/_incr_version 2019-08-27 12:30:48 +09:00
Drew DeVault c2030b9abd Add _incr_version to contrib/ 2019-08-27 12:29:42 +09:00
asdfjkluiop f07b9afee5 A layer-shell will only be focused if it is non-null 2019-08-27 10:09:41 +09:00
Michael Aquilina a298cad05c Fix formatting for title_format in man 5 sway
Use explicit linebreaks to make scdoc use a separate line for each entry
listed
2019-08-25 09:19:05 +09:00
Dark c3fbb01e07 Update titlebar borders to match i3's current behavior. 2019-08-24 00:41:19 -04:00
Brian Ashworth 90bef0364b cmd_move: fix move to scratchpad hidden container
When moving to a scratchpad hidden container (using `move
[window|container] [to] mark <mark>`), this moves the container to the
scratchpad (equivalent to `move [window|container] [to] scratchpad`).

Previously, this would crash since the destination did not have a
workspace.
2019-08-23 09:12:06 +09:00