aboutsummaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAge
* Implement DRM leasing for non-desktop outputsdrm-leaseLibravatar Drew DeVault2020-05-12
| | | | | This prevents sway from extending the desktop to i.e. VR headsets, and makes them available for DRM leasing.
* input/tablet: simplify parameter plumbing for tablet referencesLibravatar Tudor Brindus2020-05-10
| | | | | | This is a small cleanup commit for removing `sway_tablet` parameters from functions that already accept `sway_tablet_tool`, since the tablet reference can be accessed through `tool->tablet`.
* input: rename pointer handlers to be unambiguousLibravatar Tudor Brindus2020-05-02
| | | | | | | This commit renames `motion` and `axis` handlers to `pointer_motion` and `pointer_axis`, respectively, to disambiguate them from their tablet (and future touch) handlers. `button` is left as-is, as it is generic across input devices.
* input: refactor tablet motion into seatop handlerLibravatar Tudor Brindus2020-05-02
| | | | | | | This commit moves tablet motion logic into a seatop handler. As a side-effect of seatop implementations being able to receive tablet motion events, fixes #5232.
* input/cursor: make cursor rebasing cursor type-agnosticLibravatar Tudor Brindus2020-05-02
| | | | | | | | This commit refactors `cursor_rebase` into `cursor_update_image`, and moves sending pointer events to the two existing call sites. This will enable this code to be reused for tablets. Refs #5232
* Add a secondary headless backendLibravatar Simon Ser2020-05-01
| | | | This allows the create_output command to work on DRM too.
* input/cursor: release simulated tool tip button when over v2 surfaceLibravatar Tudor Brindus2020-05-01
| | | | | | | d88460f addressed sending v2 tool tip up when over a non-v2 surface. This commit addresses the other direction. Fixes #5230.
* swaybar: Fix scrolling with precise trackpadsLibravatar Martin Dørum2020-04-28
|
* input/cursor: fix hide cursor timeouts on tablets and touchscreensLibravatar Tudor Brindus2020-04-22
| | | | | | | | | This commit refactors `cursor_handle_activity` to also take the idle source, so that it can be reused for tablet and touch activity. Previously, the timeouts would be tracked, but the cursor would never be un-hidden for anything but pointers. Fixes #5169.
* input: Mark virtual devices as suchLibravatar Andri Yngvason2020-04-14
| | | | This is for internal configuration purposes
* Use bitshifts for bitfieldsLibravatar Simon Ser2020-04-10
| | | | | | | | Instead of hardcoded power of 2 values, use bitshifts. This makes the enums more readable, avoids mistakes, and makes it clear how much of the int32_t bit space we have left. While at it, fix other minor style issues.
* Render layer shell popups over the top layerLibravatar David962020-04-10
|
* Introduce test_output_configLibravatar Simon Ser2020-04-08
| | | | | This function checks whether the backend would accept an output configuration, without applying the changes.
* im: make text-input listeners per text-inputLibravatar xdavidwu2020-04-04
|
* Port input method and text input from rootstonLibravatar xdavidwu2020-04-04
| | | | | | | This ports swaywm/wlroots#1203, swaywm/wlroots#1303, swaywm/wlroots#1308, swaywm/wlroots#1759 rootston part to sway. Co-Authored-By: Leo Chen <leo881003@gmail.com>
* tray: track SNI callbacksLibravatar Ian Fan2020-03-30
| | | | | | This removes any pending messages once the item is destroyed. Furthermore, this installs SNI event calbacks asynchronously in order to prevent sd-bus from bypassing pending messages.
* tray: tidy codeLibravatar Ian Fan2020-03-30
| | | | This includes some refactoring and fixing a small memory leak.
* tray: allow themes to inherit from multiple themesLibravatar Ian Fan2020-03-30
|
* add --no-repeat option for bindingsLibravatar Linus Heckemann2020-03-30
| | | | | | | | | This allows e.g. triggering one command while a key is held, then triggering another to undo the change performed by it afterwards. One use case for this is triggering push-to-talk functionality for VoIP tools without granting them full access to all input events. Fixes #3151
* commands: Add shortcuts_inhibitor commandLibravatar Michael Weiser2020-03-11
| | | | | | | | | | | | | | | | | | | Add a command to influence keyboard shortcuts inhibitors. In its current form it can be used to activate, deactivate or toggle an existing inhibitor on the surface currently receiving input. This can be used to define an escape shortcut such as: bindsym --inhibited $mod+Escape seat - shortcuts_inhibitor deactivate It also allows the user to configure a per-seat default of whether keyboard inhibitors are honoured by default (the default) or not. Using the activate/toggle command they can then enable the lingering inhibitor at a later time of their choosing. As a side effect this allows to specifically address a named seat for actions as well, whatever use-case that might serve. Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
* input: Add support for keyboard shortcuts inhibitLibravatar Michael Weiser2020-03-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Adding support for the keyboard shortcuts inhibit protocol allows remote desktop and virtualisation software to receive all keyboard input in order to pass it through to their clients so users can fully interact the their remote/virtual session. The software usually provides its own key combination to release its "grab" to all keyboard input. The inhibitor can be deactivated by the user by removing focus from the surface using another input device such as the pointer. Use support for the procotol in wlroots to add support to sway. Extend the input manager with handlers for inhibitor creation and destruction and appropriate bookkeeping. Attach the inhibitors to the seats they apply to to avoid having to search the list of all currently existing inhibitors on every keystroke and passing the inhibitor manager around. Add a helper function to retrieve the inhibitor applying to the currently focused surface of a seat, if one exists. Extend bindsym with a flag for bindings that should be processed even if an inhibitor is active. Conversely this disables all normal shortcuts if an inhibitor is found for the currently focused surface in keyboard::handle_key_event() since they don't have that flag set. Use above helper function to determine if an inhibitor exists for the surface that would eventually receive input. Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
* config: Fix typo in reload bindsym flag bitmaskLibravatar Michael Weiser2020-03-11
| | | | | | | Fix a typo in the bit mask value of the BINDING_RELOAD flag introduced in commit 152e30c37 so it can work as intended. Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
* Add an adaptive_sync output commandLibravatar Simon Ser2020-03-07
| | | | | | | | | This enables/disables adaptive synchronization on the output. For now, the default is disabled because it might cause flickering on some hardware if clients don't submit frames at regular enough intervals. In the future an "auto" option will only enable adaptive sync if a fullscreen client opts-in via a Wayland protocol.
* Use wlr_client_bufferLibravatar Simon Ser2020-03-06
| | | | | | Update for breaking changes in [1]. [1]: https://github.com/swaywm/wlroots/pull/2043
* Drop sway_output.surface_needs_frameLibravatar Simon Ser2020-03-06
| | | | | | | wlr_output_schedule_frame now sets output->needs_frame [1], so this isn't needed anymore. [1]: https://github.com/swaywm/wlroots/pull/2053
* Make handle_destroy and output_repaint_timer_handler staticLibravatar Simon Ser2020-03-04
|
* Introduce pid criteria tokenLibravatar Ryan Dwyer2020-02-27
| | | | | | | | | | This can be used as a workaround to flag terminal windows as urgent when commands are completed, until urgency is introduced in the Wayland protocol. Configure your shell to run `swaymsg "[pid=$PPID] urgent enable"` when commands are completed, and use a terminal which uses one process per window.
* Add support for wlr-output-power-management-unstable-v1Libravatar Simon Ser2020-02-26
|
* treewide: fix typosLibravatar Torstein Husebø2020-02-18
|
* output: fix updating output manager configLibravatar Brian Ashworth2020-02-16
| | | | | | | | | | | | | | | | | | The output manager config is created when the output is created. It is updated when the mode, transform, scale, or layout for the output changes, as well as, when the output is destroyed. Since the output->enabled property was not being set before calling apply_output_config, the output event handlers were early returning and never updating the output manager config when the output state was committed. This fixes the issue by setting output->enabled in apply_output_config below the output disabling section. There are also a few other minor changes that are required to function. Additionally, this renames output_enable to output_configure to better describe the recent changes.
* Stop calling apply_output_config from output_enableLibravatar Simon Ser2020-02-11
| | | | | | | | | | | | | | | | The only output_enable caller is now apply_output_config. Stop calling apply_output_config from output_enable to simplify the code and avoid the back-and-forth between these two functions. output_enable is now the symmetric of output_disable: it just marks the output as enabled and performs bookkeeping (e.g. creating teh default workspace). It is called from apply_output_config after the output commit, so that it can read the current output state and act accordingly. This change also allows us to avoid an extraneous wlr_output_commit. References: https://github.com/swaywm/sway/issues/4921
* swaybar: fix i3bar relative coordinates when scaling is usedLibravatar Hristo Venev2020-02-10
| | | | | | | | | | | | 24e8ba048aef4751c6fa1d5982ee634f921e6cf6 did not take scaling into account. The hotspot size used pixel coordinates, the absolute coordinates were logical, and the relative coordinates were completely wrong. This commit makes all coordinates use logical values. If `"float_event_coords":true` is sent in the handshake message, coordinates are sent as floating-point values. The "scale" field is an integer containing the scale value.
* Do not truncate pointer coordinates to int.Libravatar Hristo Venev2020-02-10
| | | | This increases the precision of the clicks when using i3bar.
* criteria: match containers without viewLibravatar Anders2020-02-04
| | | | | | | | Closes #4929 Replaces criteria_get_views with criteria_get_containers which can return containers without views when the criteria only contains container properties.
* Fix compiling with -fno-commonLibravatar thermitegod2020-01-24
|
* Fix crash when showing scratchpad hidden split containersLibravatar Ronan Pigott2020-01-16
|
* Revert "Make all the container dimensions integers"Libravatar Simon Ser2020-01-15
| | | | | | This reverts commit 79c5f5ba1245a8c3d575770419a6501447e78919. Fixes: https://github.com/swaywm/sway/issues/4908
* view: remove workspace pid mapping for assignsLibravatar Brian Ashworth2020-01-09
| | | | | | If a view is mapped to a workspace using an assign, the pid should still be removed from the pid mapping list. This prevents child processes from matching against it and mapping a view to a likely undesired workspace.
* input/cursor: handle image surface destroyLibravatar Brian Ashworth2020-01-05
| | | | | | This adds a listener for the destroy event of the cursor image surface. This prevents a use-after-free when the last visible image surface is freed, there has not been a new cursor set, and the cursor is reshown.
* swaynag: Add multi-seat supportLibravatar Andri Yngvason2020-01-05
| | | | This also adds cleanup for all seat resources
* Make all the container dimensions integersLibravatar Pedro Côrte-Real2020-01-01
| | | | | | | | | | | | | Containers are always fixed to the pixel grid so position and size them with integers instead of doubles. Functionally this should be no different since rounding down is already being done on things like layout. But it makes it clear what the intention is and avoids bugs where fractional pixels are used. The translating and moving code is still using doubles because the cursors can have fractional pixels and thus the code is plumbed that way. But that could also probably be changed easily by doing the integer conversions earlier and plumbing with int.
* Avoid numerical instability in resizeLibravatar Pedro Côrte-Real2020-01-01
| | | | | | | | | | | | | | | | | | | Because the layout code rounds down the dimensions of the windows resizing would often be off by one pixel. The width/height fraction would not exactly reflect the final computed width and so the resize code would end up calculating things wrong. To fix this first snap the container size fractions to the pixel grid and only then do the resize. Also use round() instead of floor() during layout to avoid a slightly too small width. This applies in two cases: 1. For the container we are actually resizing using floor() might result in being 1px too small. 2. For the other containers it might result in resizing them down by 1px and then if the container being resized is the last all those extra pixels would make the resize too large. Fixes #4391
* Add virtual pointer protocolLibravatar Josef Gajdusek2019-12-31
|
* bar_cmd_colors: remove add_colorLibravatar Brian Ashworth2019-12-28
| | | | | | | | | | | | This is the third commit in a series of commits to refactor color handling in sway. This removes add_color from commands.c. It was only being used by bar_cmd_colors. This also changes the functions to use parse_color which is used to validate rgb(a) colors throughout the code base and is also what i3bar is using to parse the colors after they are passed over ipc. After parsing the color and ensuring it is valid, the rgba hex string is then generated using snprintf. This refactor also ensures that all the colors for the command are valid before applying any of them.
* cmd_client_*: refactor duplicated codeLibravatar Brian Ashworth2019-12-28
| | | | | | | | | | | | | This is the second in a series of commits to refactor the color handling in sway. This removes the duplicated color parsing code in sway/commands/client.c. Additionally, this combines the parsing of colors to float arrays with that in sway/config.c and introduces a color_to_rgba function in commom/util.c. As an added bonus, this also makes it so non of the colors in a border color class will be changed unless all of the colors specified are valid. This ensures that an invalid command does not get partially applied.
* parse_color: return success + drop fallback colorLibravatar Brian Ashworth2019-12-28
| | | | | | | | | | | | This is the first in a series of commits to refactor the color handling in sway. This changes parse_color to return whether it was success and no longer uses 0xFFFFFFFF as the fallback color. This also verifies that the string actually contains a valid hexadecimal number along with the length checks. In the process of altering the calls to parse_color, I also took the opportunity to heavily refactor swaybar's ipc_parse_colors function. This allowed for several lines of duplicated code to be removed.
* seat_cmd_keyboard_grouping: change keymap to smartLibravatar Brian Ashworth2019-12-16
| | | | | | | | | | This removes `seat <seat> keyboard_grouping keymap` and replaces it with `seat <seat> keyboard_grouping smart`. The smart keyboard grouping will group based on both the keymap and repeat info. The reasoning for this is that deciding what the repeat info should be for a group is either arbitrary or non-deterministic when multiple keyboards in the group have repeat info configured (unless somehow exposed to the user in a reproducible uniquely identifiable fashion).
* Add seat <seat> idle_{inhibit,wake} <sources...>Libravatar Drew DeVault2019-12-12
| | | | | | | | | | This adds seat configuration options which can be used to configure what events affect the idle behavior of sway. An example use-case is mobile devices: you would remove touch from the list of idle_wake events. This allows the phone to stay on while you're actively using it, but doesn't wake from idle on touch events while it's sleeping in your pocket.
* input/cursor: pass gesture events to clientsLibravatar Benjamin Cheng2019-12-07
| | | | | | | | | Some wayland clients (mostly GTK3 apps) like eog or evince support gestures like pinch-to-zoom. These gestures are given to clients via the pointer_gestures_v1 protocol. This is already supported in wlroots, so we just need to hook up the events here in sway. Fixes #4724
* output: Schedule idle frames if we do not renderLibravatar Kenny Levinsen2019-12-01
| | | | | | | | | | | | | | | | | | | | Repaint scheduling delays output render and frame done events from output frame events, and block idle frame events from being scheduled in between output frame done and output render in this period of time. If a surface is committed after its frame done event, but before output render, idle frame requests will be blocked, and the surface relies on the upcoming render to schedule a frame. If when the repaint timer expires, output render is deemed unnecessary, no frame will be scheduled. This can lead to surfaces never having their frame callbacks fire. To fix this, we store that a surface has requested a frame in surface_needs_frame. When the repaint expires, if no render is deemed necessary, we check this flag and schedule an idle frame. Fixes #4768