Commit Graph

4615 Commits

Author SHA1 Message Date
Simon Ser 541e6e260c Drop unnecessary includes from sway/server.h 2024-02-15 15:56:36 +01:00
Kirill Primak 7a2ff7ba81 view: drop ext_foreign_destroy
It's not used and causes a crash when a view is destroyed.
2024-02-12 19:05:13 +01:00
Alexander Orzechowski 09c360d503 layer_shell: Handle popups through popup descriptor
We tried to synchronize layer shell popups with the parent layer shell
on commits, but this is subtly wrong because we would only update
the position for one layer shell that was committed, but not any other
layer that might be affected. By moving handling to the scene descriptor
we can iterate all popups and ensure they are synchronized.
2024-02-12 19:19:22 +03:00
Alexander Orzechowski 1846944f04 xdg_shell: Extract struct for popup descriptor 2024-02-12 19:19:22 +03:00
Alexander Orzechowski 1dc661af17 layer_shell: Arrange popups even if exclusive zone doesn't change 2024-02-12 19:19:22 +03:00
Merlin Lex 1b5515400d ext-foreign-toplevel-list: Implement protocol
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4543
2024-02-12 15:36:44 +01:00
Simon Ser 88b2abf5f2 config: use format_str() instead of hand-rolled snprintf() 2024-02-08 16:11:24 -05:00
Simon Ser 93d391651c commands: make primary_selection a config-only command
It's not possible to switch this at runtime.
2024-02-05 20:54:48 +01:00
Simon Ser f7a0f06dff commands: note how xwayland/primary_selection are reset on reload 2024-02-05 11:07:33 +01:00
Simon Ser ecfef1348a commands/primary_selection: drop duplicate bool parsing 2024-02-05 11:06:24 +01:00
Violet Purcell 6b2aa83246 sway/config.c: only reset primary_selection at launch
Otherwise, an error will be shown whenever reloading due to the value of
primary_selection being reset to true.
2024-02-05 11:04:36 +01:00
Simon Ser 88e99fa84f Drop old security config remnants 2024-02-03 23:00:52 +01:00
Alexander Orzechowski ba427a469a Ensure get_text_width() returns a positive value
Closes: https://github.com/swaywm/sway/issues/7940
2024-02-02 00:54:26 +01:00
Tamino Bauknecht c8676fad54 sway/output: Improve logging of swaybg execvp failure and more checks
This doesn't catch the error if a background changing command is
executed via swaymsg, but improves logging.
The additional checks at least propagate if e.g. forking failed.
2024-01-29 14:12:39 +01:00
Kirill Primak f202bc84d2 Chase wlroots!4443 2024-01-25 16:13:33 +01:00
Kirill Primak a4e85332a1 Chase wlroots!4003 2024-01-23 10:45:58 +01:00
Alexander Orzechowski e8c421e917 layer_shell: Fix typo of return instead of continue
Otherwise we would skip arranging the rest of the surfaces if one of them
isn't initialized.
2024-01-21 22:01:35 +01:00
Daniel De Graaf 2c2625acd3 Fix SIGSEGV on output destroy
```
Program terminated with signal SIGSEGV, Segmentation fault.
144                             struct wlr_layer_surface_v1 *layer_surface = surface->layer_surface;
[Current thread is 1 (Thread 0x7f1f7c5b3ac0 (LWP 2473))]
(gdb) bt
```

Add a NULL check in `find_mapped_layer_by_client` like the one in `arrange_surface`.
2024-01-21 17:32:00 +03:00
Simon Ser 08a06a7b6b Add debug flag to re-enable wl_drm
7e69a7076f ("Drop wl_drm") has dropped wl_drm, however a lot of
software wasn't quite ready for this (Xwayland, libva, amdvlk).
Keep wl_drm disabled by default to pressure the wl_drm phase-out,
but add a -Dlegacy-wl-drm flag for users to restore the previous
behavior in the meantime.

References: https://github.com/swaywm/sway/issues/7897
2024-01-20 14:42:58 -05:00
Alexander Orzechowski 5fc85c5066 scene_graph: port wlr_forgein_toplevel_management output enter/leave events 2024-01-18 18:36:54 +03:00
Alexander Orzechowski 7c635b61fe remove damage debug options
Now that we use wlr_scene, wlroots handles these. If available use
the wlroots debug options instead.
2024-01-18 18:36:54 +03:00
Alexander Orzechowski bab6b79af2 Fix SIGSEGV on surface destroy
```
Program terminated with signal SIGSEGV, Segmentation fault.

warning: Section `.reg-xstate/3960717' in core file too small.
0  container_get_siblings (container=0x55bcde4797f0) at ../sway/tree/container.c:1228
1228		if (list_find(container->pending.workspace->tiling, container) != -1) {
[Current thread is 1 (Thread 0x7fa23b4a2940 (LWP 3960717))]
(gdb) bt full=
No symbol "full" in current context.
(gdb) bt full
0  container_get_siblings (container=0x55bcde4797f0) at ../sway/tree/container.c:1228
1  0x000055bcdb62c704 in edge_is_external (cont=0x55bcde4797f0, edge=(WLR_EDGE_TOP | WLR_EDGE_LEFT))
    at ../sway/input/seatop_default.c:54
        siblings = 0x55bcde4797f0
        index = 32766
        layout = L_NONE
        __PRETTY_FUNCTION__ = "edge_is_external"
2  0x000055bcdb62c96f in find_resize_edge (cont=0x55bcde4797f0, surface=0x0, cursor=0x55bcddd5c2e0)
    at ../sway/input/seatop_default.c:106
        edge = (WLR_EDGE_TOP | WLR_EDGE_LEFT)
3  0x000055bcdb620b3c in cursor_update_image (cursor=0x55bcddd5c2e0, node=0x55bcde4797f0) at ../sway/input/cursor.c:144
        edge = WLR_EDGE_NONE
4  0x000055bcdb62eb8f in handle_rebase (seat=0x55bcddd5a740, time_msec=488992944) at ../sway/input/seatop_default.c:773
        e = 0x55bcddd5c8e0
        cursor = 0x55bcddd5c2e0
        surface = 0x0
        sx = 0
        sy = 0
5  0x000055bcdb62c531 in seatop_rebase (seat=0x55bcddd5a740, time_msec=488992944) at ../sway/input/seat.c:1585
6  0x000055bcdb620a7d in cursor_rebase (cursor=0x55bcddd5c2e0) at ../sway/input/cursor.c:126
        time_msec = 488992944
7  0x000055bcdb620ac4 in cursor_rebase_all () at ../sway/input/cursor.c:136
        seat = 0x55bcddd5a740
8  0x000055bcdb61cc95 in transaction_apply (transaction=0x55bcde5b28c0) at ../sway/desktop/transaction.c:704
9  0x000055bcdb61ccdb in transaction_progress () at ../sway/desktop/transaction.c:716
10 0x000055bcdb61d1f9 in transaction_commit_pending () at ../sway/desktop/transaction.c:836
        transaction = 0x55bcde5b28c0
11 0x000055bcdb61d596 in _transaction_commit_dirty (server_request=true) at ../sway/desktop/transaction.c:912
12 0x000055bcdb61d5ac in transaction_commit_dirty () at ../sway/desktop/transaction.c:916
13 0x000055bcdb65f579 in view_unmap (view=0x55bcde2ff180) at ../sway/tree/view.c:847
        parent = 0x55bcde489010
        ws = 0x55bcdde19080
        seat = 0x55bcddd5a198
14 0x000055bcdb61e461 in handle_unmap (listener=0x55bcde2ff368, data=0x0) at ../sway/desktop/xdg_shell.c:394
        xdg_shell_view = 0x55bcde2ff180
        view = 0x55bcde2ff180
        __PRETTY_FUNCTION__ = "handle_unmap"
15 0x00007fa23c4ae87f in wlr_signal_emit_safe (signal=0x55bcde46cf38, data=0x0) at ../util/signal.c:29
        pos = 0x55bcde2ff368
        l = 0x55bcde2ff368
        cursor = {link = {prev = 0x55bcde2ff368, next = 0x7ffe240702a0}, notify = 0x7fa23c4ae7c9 <handle_noop>}
        end = {link = {prev = 0x7ffe24070280, next = 0x55bcde46cf38}, notify = 0x7fa23c4ae7c9 <handle_noop>}
16 0x00007fa23c47c3c7 in unmap_xdg_surface (surface=0x55bcde46ce30) at ../types/xdg_shell/wlr_xdg_surface.c:40
        __PRETTY_FUNCTION__ = "unmap_xdg_surface"
        popup = 0x55bcde46ce60
        popup_tmp = 0x55bcde46ce60
        configure = 0x7ffe24070360
        tmp = 0x55bcde488020
17 0x00007fa23c47cd47 in xdg_surface_role_precommit (wlr_surface=0x55bcde488020, state=0x55bcde4881a8)
    at ../types/xdg_shell/wlr_xdg_surface.c:330
        surface = 0x55bcde46ce30
18 0x00007fa23c4813b2 in surface_commit_state (surface=0x55bcde488020, next=0x55bcde4881a8) at ../types/wlr_compositor.c:407
        __PRETTY_FUNCTION__ = "surface_commit_state"
        invalid_buffer = false
        subsurface = 0xbd8e9aecae023300
--Type <RET> for more, q to quit, c to continue without paging--
19 0x00007fa23c48192a in surface_handle_commit (client=0x55bcde488850, resource=0x55bcde2fdb80) at ../types/wlr_compositor.c:523
        surface = 0x55bcde488020
20 0x00007fa23bb5ed4a in  () at /usr/lib/libffi.so.8
21 0x00007fa23bb5e267 in  () at /usr/lib/libffi.so.8
22 0x00007fa23c517323 in  () at /usr/lib/libwayland-server.so.0
23 0x00007fa23c5125cc in  () at /usr/lib/libwayland-server.so.0
24 0x00007fa23c5151ca in wl_event_loop_dispatch () at /usr/lib/libwayland-server.so.0
25 0x00007fa23c512d37 in wl_display_run () at /usr/lib/libwayland-server.so.0
26 0x000055bcdb616885 in server_run (server=0x55bcdb68c5c0 <server>) at ../sway/server.c:307
27 0x000055bcdb61594e in main (argc=3, argv=0x7ffe24070af8) at ../sway/main.c:433
```

It seems to be happening because of this set of events all happening
in the span of a single transaction:
1. You kill a tiled window that is the only window in a workplace.
2. Sway will destroy the workspace but not yet the container - this
   makes `con->pending.workspace` NULL.
3. Cursor glyphs get recomputed causing sway to recompute if the cursor
   is on a container edge. 
4. That computation causes an access to the NULL workspace. Crash.
2024-01-18 18:36:54 +03:00
Alexander Orzechowski 9da295c11f scene_graph: Implement toplevel clipping 2024-01-18 18:36:54 +03:00
Alexander Orzechowski 09e11dabb2 scene_graph: Port opacity and filter modes 2024-01-18 18:36:54 +03:00
Alexander Orzechowski 2e53de80bb scene_graph: Arrange scene graph on transaction apply 2024-01-18 18:36:54 +03:00
Alexander Orzechowski 5f0801b6f2 container: Don't track outputs
The scene graph abstraction does this for us
2024-01-18 18:36:54 +03:00
Alexander Orzechowski 1e018e72b4 Delete old damage tracking code
The new scene graph abstraction handles this for us.
2024-01-18 18:36:54 +03:00
Alexander Orzechowski 06ad734e70 scene_graph: Port view saved buffers 2024-01-18 18:36:54 +03:00
Alexander Orzechowski ed2724bd6c xwayland: Cleanup geometry handling on commit
Instead of doing this roundabout thing where we get the surface from the
view, let's instead get it from the `wlr_surface_state` that we already
track in `handle_commit`. This makes the NULL state impossible which is
what the old `get_geometry` is checking for and generally cleans
things up a little bit.

Also don't check if the geometry x/y changed, those will always
be 0 for xwayland.
2024-01-18 18:36:54 +03:00
Alexander Orzechowski 6e5fc4c2aa scene_graph: Port xwayland 2024-01-18 18:36:54 +03:00
Alexander Orzechowski b38ed8b479 scene_graph: Port xdg_shell 2024-01-18 18:36:54 +03:00
Alexander Orzechowski 08c484f46f transaction: ready signals will return success bools 2024-01-18 18:36:54 +03:00
Alexander Orzechowski 6d7b1321db scene_graph: Port container server side decorations 2024-01-18 18:36:54 +03:00
Alexander Orzechowski 188811f808 scene_graph: Port layer_shell 2024-01-18 18:36:54 +03:00
Alexander Orzechowski 5b8b505af5 input: Query scene graph for relevant surface/node intersections 2024-01-18 18:36:54 +03:00
Alexander Orzechowski 946fc80945 Introduce sway_text_node
This is a helper on top of a wlr_scene_buffer that will handle text
rendering for us.
2024-01-18 18:36:54 +03:00
Alexander Orzechowski 869baff252 renderer: Remove in favor of scene_graph 2024-01-18 18:36:54 +03:00
Alexander Orzechowski bac3ab5526 seat: Remove dead seatop_render function 2024-01-18 18:36:54 +03:00
Alexander Orzechowski 9a57966606 scene_graph: Port ext_session_v1 2024-01-18 18:36:54 +03:00
Alexander Orzechowski 0639bde9fb scene_graph: Port seatop_move_tiling indicators 2024-01-18 18:36:54 +03:00
Alexander Orzechowski c640c3015f scene_graph: Port seat drag icons 2024-01-18 18:36:54 +03:00
Alexander Orzechowski 9c17cba0b2 renderer: Render scene_graph 2024-01-18 18:36:54 +03:00
Alexander Orzechowski 0e1a02bf0a scene_graph: Introduce sway_scene_descriptor
Across a wayland compositor, there are multiple shells: It can be
a toplevel, or a layer_shell, or even something more meta like a drag
icon or highlight indicators when dragging windows around.

This object lets us store values that represent these modes of operation
and keep track of what object is being represented.
2024-01-18 18:36:54 +03:00
Alexander Orzechowski 1b09238645 scene_graph: Use built-in linux dmabuf feedback handling 2024-01-18 18:36:54 +03:00
Alexander Orzechowski 1eb16d1367 scene_graph: Maintain `wlr_scene_node`s for the sway tree. 2024-01-18 18:36:54 +03:00
Alexander Orzechowski dbd2fbf430 view: init function should return a success bool 2024-01-18 18:36:54 +03:00
Alexander Orzechowski b4d7e84d38 desktop: Rename layers to shell_layers
This code will be deleted later, but for the time being rename
it so it doesn't conflict with future properties.
2024-01-18 18:36:54 +03:00
Kirill Primak 2c69e19fd3 layer-shell: don't configure uninitialized surfaces 2024-01-17 16:54:37 +01:00
Kirill Primak 8d1b0cecd9 layer-shell: wait for an initial commit before configuring 2024-01-17 16:54:37 +01:00
Kirill Primak 904d256581 layer-shell: don't try to unmap on destroy
A surface is guaranteed to be unmapped on destruction.
2024-01-17 16:54:37 +01:00
Simon Ser c5fd8c050f Mark DRM lease protocol privileged
Allowing sandboxed clients to request DRM leases has security
implications.
2024-01-08 11:17:26 -05:00
Simon Ser 7e69a7076f Drop wl_drm
See https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4397
2024-01-04 08:21:33 +01:00
Simon Ser 95265fba59 input: reconfigure send_events on output hotplug
Closes: https://github.com/swaywm/sway/issues/7890
2024-01-02 14:07:35 +01:00
Billli11 0aceff7469
Remove wlr_presentation in sway_server struct
It is no longer in use.
2023-12-28 11:28:28 +01:00
Bill Li 64d644f0da Chase wlroots!4482 2023-12-27 20:57:35 +01:00
Simon Ser 22d0dd8bde Check wlr_pointer_constraint_v1_state.cursor_hint.enabled
Update for a wlroots breaking change which resets the committed
mask.

References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4478
2023-12-25 11:57:30 +01:00
Alexander Orzechowski bbabb9aae8 output: Destroy when output layout is destroyed
Since output layout is destroyed when the wayland display is destroyed
we run into a destroy listener order problem: Either the display starts
destroying the outputs first, in which case we're good: The existing
handling will clean up. However, things go wrong if the display decides
to destroy the output layout first. In this case, sway will hold
invalid references to the output layout as part of each output so that
when it finally goes to destroy them, sway will dereference destroyed
output layout bits.

Ref: https://github.com/swaywm/sway/pull/6844#issuecomment-1843599513
2023-12-13 18:10:03 +01:00
Simon Ser c6edbb7e5a input/seat: simplify seat_is_input_allowed()
Use an early return to make the code more readable.
2023-12-13 10:11:35 +01:00
Simon Ser e8a0205607 input/seat: rename seat_set_exclusive_client() 2023-12-13 10:11:35 +01:00
Simon Ser 607b8aed0c input/seat: inline seat_set_exclusive_client() with NULL client 2023-12-13 10:11:35 +01:00
Simon Ser 7ad8c80bfe input/{keyboard,switch}: rename input_inhibited variable to locked
This is more descriptive now.
2023-12-13 10:11:35 +01:00
Simon Ser dbd70faf2e input/seat: drop exclusive_client
This was a input-inhibit concept.
2023-12-13 10:11:35 +01:00
Simon Ser a6ef12d968 Detect proprietary DisplayLink drivers
evdi is open-source, but is just some condom for their proprietary
user-space driver.
2023-12-12 10:04:14 -05:00
Simon Ser ff07eab85b Detect Nvidia proprietary driver via drmGetVersion()
This is less punishing for users with the Nvidia driver loaded but
not used by Sway (e.g. for CUDA).
2023-12-12 10:04:14 -05:00
Simon Ser b81c4da494 Drop fglrx detection
This ancient driver doesn't do KMS. So we were never able to run
with it anyways.
2023-12-12 10:04:14 -05:00
Tamino Bauknecht 255ff665c5 sway: raise error on non-accessible background file 2023-12-12 09:39:46 -05:00
Simon Ser bf2b79b284 desktop/xwayland: correctly handle association on o-r change
When override-redirect changes, we need to setup/teardown listeners,
just like we do for map.

References: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3773
2023-12-06 23:24:44 +03:00
mrusme ae3acf26f8 Update sway.5.scd
Make it extra extra extra clear, because I had to stumbled upon https://github.com/swaywm/sway/issues/3292 to understand this.
2023-12-04 16:30:20 +01:00
Alexander Orzechowski f12023b1a2 Don't destroy output layout on exit
wlroots will destroy this object itself.
2023-12-01 09:11:20 +01:00
Sergei Trofimovich 2cd73a33c2 sway/config.c: use `memcpy()` for known buffer size
`gcc-14` added a new warning around dangerous use of `strncpy()` withi
known overflow:

    ../sway/config.c: In function 'do_var_replacement':
    ../sway/config.c:983:33: error: '__builtin___strncpy_chk' specified bound depends on the length of the source argument [-Werror=stringop-truncation]
      983 |                                 strncpy(newptr, var->value, vvlen);
          |                                 ^
    ../sway/config.c:971:45: note: length computed here
      971 |                                 int vvlen = strlen(var->value);
          |                                             ^~~~~~~~~~~~~~~~~~

It's a bit fishy to rely on truncating behaviour of `strncpy()`. The
change uses `memcpy()` as more explicit way to express copy of `vvlen`
bytes.
2023-11-29 10:30:17 +01:00
Kirill Primak 47e6a1164c xdg-shell: chase events update 2023-11-23 19:41:57 +01:00
Simon Ser 128b6253a9 Pass wl_display to wlr_output_layout
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4310
2023-11-23 16:13:19 +03:00
Simon Ser fd6d6f1d97 Add wlr/util/transform.h includes
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4097
Closes: https://github.com/swaywm/sway/issues/7830
2023-11-23 16:13:19 +03:00
llyyr a946b1aecf Chase wlroots!4440
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4440
2023-11-22 00:42:55 +03:00
Simon Ser 9d666a08e1 Fix reference to wlr_output_event_commit.committed
This has been dropped from wlroots. Previous commit missed that.
2023-11-21 16:52:19 +01:00
Simon Ser 072fa60cb4 Add support for security-context-v1
As a first step, deny access to privileged protocols to sandboxed
apps.

References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3589
2023-11-21 15:12:42 +01:00
Simon Ser 5bdd608514 Apply gamma LUT when an output re-enabled
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3679
2023-11-21 15:05:58 +01:00
EBADBEEF 86f96a786b view: re-apply criteria when window gets unmapped
Remove any existing executed criteria items at unmap time. If a window
gets unmapped but not destroyed, we want to reapply 'for_window'
criteria. Fixes #6905.
2023-11-21 14:57:58 +01:00
NemuiBanila c3ec141b34 seat: Fix cursor theme reload for tablet tool 2023-11-21 11:35:49 +01:00
Lina Banik f7a40cfa2f seat: Fix reloading cursor theme after change
This reverts commit afde6369
"seat: avoid unneeded reloading xcursor theme".
Always avoiding to reload the xcursor theme prevents reloading the
cursor even when this is desired. Instead seat_configure_xcursor
can determine whether a full reload is necessary.

To stay with the spirit of the reverted change, cursors are only fully
reloaded, if the theme has changed.

Fixes #6931
2023-11-21 11:35:49 +01:00
Simon Ser 5c99b98805 input/input-manager: drop input_manager_configure_all_inputs
This is now unused.
2023-11-16 16:29:07 +01:00
Simon Ser 7036769bea Only reconfigure input mappings on output change
Fully reconfiguring all input devices on output change takes a
loooong time. Let's just reconfigure what we need: only mappings
depend on outputs.
2023-11-16 16:29:07 +01:00
Simon Ser caa92ddee8 input/seat: rename seat_apply_input_config
seat_apply_input_mapping is a lot more descriptive.
2023-11-16 16:29:07 +01:00
Simon Ser 01dcad80e1 input/seat: don't configure mappings for switches
Switch devices cannot be mapped to an output/region, stop trying
to do so.
2023-11-16 16:29:07 +01:00
Bill Li 6f6b82793d chase wlroots!4411
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4411
    fix #7802
2023-10-31 09:51:19 +01:00
Kirill Primak f2425b4fd6 xdg-shell: send maximized if tiled isn't supported
wlroots doesn't do it automatically anymore.
2023-10-29 17:21:18 +01:00
Dudemanguy 647521244a xdg_shell: don't update wlr_toplevel if the container has no size yet
3d5ae9813d added logic to change the
underlying wlr_toplevel size for floating containers, but it does it
even if the container has no actual coordinates yet. This doesn't really
make sense to update the toplevel size in this case since there's many
things that could affect the initial coordinates (sway commands,
fullscreen state, etc.). Skip this by doing a crude check to see if the
current container state has any width.
2023-10-27 17:36:32 -07:00
Kirill Primak 47263aca28 view: check if the buffer was uploaded on save
wlr_surface_has_buffer() is insufficient; if a client has committed a
buffer but it couldn't be applied, NULL deref happens in the next line.
2023-10-24 14:35:57 +02:00
Tamino Bauknecht 0dfaf7ea63 config/output: Allow approximation of output refresh rate
Previous behavior was that only if resolution and refresh rate match
exactly, the mode was accepted. As fallback, the mode with the highest
refresh rate and the same resolution was chosen.

New behavior is that the mode with the closest match for the refresh
rate is used with a limit of up to 1Hz. The fallback behavior stays the same.

Additionally, the logging was made more verbose.
2023-10-23 11:05:08 +02:00
Alexander Orzechowski 4326a26ad6 Chase wlroots!4331 2023-10-06 14:39:12 +03:00
iff 8a8fb76ec1 Update sway-input.5.scd 2023-10-05 10:04:32 +02:00
Simon Ser 7cf4e1d5c6 Drop support for KDE's idle protocol
We support the standard idle-notify protocol since Sway 1.8.
2023-10-05 00:01:54 +02:00
Manuel Stoeckl 8edc48f6dd sway/server: Fix null pointer crash when Xwayland disabled 2023-09-10 08:33:10 +09:00
Johan Sköld d952ce403e i3 compat: Adding support for the `all` criteria
Matches all views. i3 PR: https://github.com/i3/i3/pull/4460

Fixes #7110
2023-09-07 10:42:54 +09:00
iff 3dd2f4a67f
commands/input/map_from_region: don't treat 0x prefix as hex identifier
When using the `map_from_region` for pen tables, we will usually make
the available area as big as possible while maintaining the proportions
with the screen.

As most of the tablets uses a 16:10 ratios while the most popular screen
ratios is still 16:9, the argument for most people should be `0x0 1x0.9`
to have the maximum effective area.

However, the argument above won't work because the current code will
treat `0x...` as a hexadecimal number, instead of setting both `x` and
`y` to `0`.

This fix allows the use of the following syntax:

```
input type:tablet_tool {
	map_from_region 0x0 1x0.9
}
```
2023-09-07 01:31:35 +00:00
Dudemanguy 3d5ae9813d xdg_shell: update wlr_toplevel size on client resizes
If a floating client resizes itself, sway updates several of its
internal dimensions to match but not wlr_toplevel. This means that the
next time wlroots sends a toplevel configure event, it can have wrong
coordinates that resize the client back to its old size. To fix this,
let's just use wlr_xdg_toplevel_set_size so the wlr_toplevel has the
same dimensions as sway.

Exactly the same as 0183b9d35d but the
logic is onlly applied to xdg_shell and not xwayland.
2023-08-28 17:04:53 -07:00
Dudemanguy 60a94b4916 Revert "view: update wlr_toplevel size on client resizes"
This isn't the right fix for this issue because the xwayland code also
uses this function and updating the wlr_toplevel there doesn't make
sense and also causes problems. Fixes #7722.

This reverts commit bf44690ee8.
2023-08-28 17:04:53 -07:00
Dudemanguy bf44690ee8 view: update wlr_toplevel size on client resizes
If a floating client resizes itself, sway updates several of its
internal dimensions to match but not wlr_toplevel. This means that the
next time wlroots sends a toplevel configure event, it can have wrong
coordinates that resize the client back to its old size. To fix this,
let's just use wlr_xdg_toplevel_set_size so the wlr_toplevel has the
same dimensions as sway. Fixes #5266.
2023-08-26 13:44:37 -07:00
Simon Ser 4a2210577c Hide xwayland_shell_v1 from regular clients
Regular clients are not allowed to use this interface. wlroots
already sends a protocol error if a non-Xwayland client tries to
use this interface, but let's remove all temptation by hiding it
completely.
2023-08-24 18:27:22 +02:00
Kirill Primak a908651821 chore: chase wlroots xdg-surface role rework 2023-08-21 18:41:32 +02:00