Commit graph

551 commits

Author SHA1 Message Date
Alyssa Ross
40eb78debf
wayland: map windows with correct geometry
Consider a simple client that doesn't use set_window_geometry,
committing after attaching a buffer to a window surface.

Window::geometry falls back to Window::bbox, but when
Shell::map_window called Window::geometry, Window::bbox hadn't been
set yet, because that only happened later in
<State as CompositorHandler>::commit, so the window would be mapped
with a size of (0, 0).

This resulted in server-side decorations not being drawn for such
clients until they were re-focused or resized.

The fix is to add an extra call to Window::on_commit() before mapping
it, so that its bbox is set correctly when Shell::map_window asks for
its geometry.
2023-09-21 14:39:45 +00:00
Victoria Brekenfeld
5cebc7b97d tiling: Fix rendering single-stack window on empty workspace 2023-09-14 19:41:36 +02:00
Victoria Brekenfeld
2a79221ff4 tiling: Fix moving single stack surfaces 2023-09-14 19:41:36 +02:00
Victoria Brekenfeld
973b360514 tiling: Fix stack indicator rendering 2023-09-14 19:41:36 +02:00
Victoria Brekenfeld
19d5ed92f4 shell: Don't remove workspaces during animations 2023-09-14 19:41:36 +02:00
Victoria Brekenfeld
abd27e6aab shell: Fix group backdrop on swap 2023-09-14 19:41:36 +02:00
Victoria Brekenfeld
abf430f956 shell: Rework fullscreen/maximize 2023-09-14 19:41:36 +02:00
Victoria Brekenfeld
003263b94e
render: Don't treat dnd surface as egliable for scanout on cursor plane 2023-09-14 14:44:54 +02:00
Ian Douglas Scott
e1fc182c3e Update Smithay 2023-09-13 20:24:11 -07:00
Ian Douglas Scott
5df26c2317 Fix TilingLayout::element_under position with global workspaces
I didn't see any issue with how mouse events were handled, but a bisect
showed b818a68a91 caused the issue.
Reverting the definition of `element_under` to the version before that
change fixed the behavior.

Comparing what both versions return, the right element is returned, but
the location returned is wrong. This makes the return value match the
position that was returned by the previous implementation. It seems to
be working correctly now.

Fixes https://github.com/pop-os/cosmic-comp/issues/161.
2023-09-13 14:26:52 -07:00
Victoria Brekenfeld
82c7d65049 tiling: Only render swap-preview on active output 2023-09-13 12:51:41 +02:00
Victoria Brekenfeld
a5b10f5d4a tiling: Fix swap-focus always selecting whole stacks 2023-09-12 20:53:35 +02:00
Victoria Brekenfeld
9ad69fe119 tiling: Add logic to move on swap with empty workspace 2023-09-12 20:53:35 +02:00
Victoria Brekenfeld
2588b8920d tiling: Fix wrong focus swapping across workspaces 2023-09-12 20:53:35 +02:00
Victoria Brekenfeld
dbb5338322 tiling: Fix toplevel-info on swap 2023-09-12 20:53:35 +02:00
Victoria Brekenfeld
7ba52d7162 shell: Refresh focus-stacks after swap 2023-09-12 20:53:35 +02:00
Victoria Brekenfeld
6b4eb83af5 stack: Fix missing re-enter on add 2023-09-12 20:53:35 +02:00
Victoria Brekenfeld
e2ac5c0a23 tiling: Fix swap preview on different workspaces/outputs 2023-09-12 20:53:35 +02:00
Victoria Brekenfeld
e992a4b442 tiling: Fix swap mode with single window stacks 2023-09-12 20:53:35 +02:00
Victoria Brekenfeld
1251b7e9f7 shell/tiling: Implement window swap mode 2023-09-12 20:53:35 +02:00
Victoria Brekenfeld
ac4bf01315 iced: actual just delay updates 2023-09-12 20:44:23 +02:00
Victoria Brekenfeld
91a82c02b3 stack: Let iced figure out the size 2023-09-12 20:16:14 +02:00
Victoria Brekenfeld
9de5104cbc iced: Throttle resize updates 2023-09-12 20:16:07 +02:00
Victoria Brekenfeld
8038034a62 shell: Fix closed x11 windows closing stacks 2023-09-12 13:22:49 +02:00
Ian Douglas Scott
6247918cad Send relative_pointer in frame with pointer; update Smithay
The protocol doesn't specify this, but XWayland does assume relative
pointer events are part of a frame.

This works for now, though a better solution will be needed in Smithay
to also handle pointer constraints where a relative motion may occur
alone, etc.

This seems to fix https://github.com/pop-os/cosmic-comp/issues/159.
2023-09-08 11:10:53 -07:00
Ian Douglas Scott
8dce518ba6 Add security context protocol
Currently, excludes some protocols if they have any security context
associated.
2023-09-05 13:47:23 -07:00
Ian Douglas Scott
c68625ff78 Add pointer gestures support 2023-09-05 13:47:07 -07:00
Ian Douglas Scott
e7e9b768c8 Update Smithay, adjusting for API changes
The main changes are those related to pointer gestures. Which are a bit
verbose but not too difficult.
2023-09-05 13:46:48 -07:00
Ian Douglas Scott
20159a6c8c input: Add a scroll_factor config option
This is not a setting handled by libinput; we have to scale the
scrolling ourselves.

This should match the behavior of the `scroll_factor` defined in
sway-input(5).
2023-09-01 12:36:12 -07:00
Ian Douglas Scott
1ea0ffdb91 config: Fix default workspace right bindings 2023-08-31 16:56:01 -07:00
Ian Douglas Scott
34eba9e75b config: Ignore DeviceConfigError::Unsupported for defaults
Also reduces duplication.
2023-08-31 16:56:01 -07:00
Ian Douglas Scott
56467755a8 cosmic-comp-config crate, and default input config
This adds a `input-default` setting, which is used for input settings if a
device isn't set in `input-devices`. More awkwardly, it also adds an
`input-touchpad` setting, which is used instead of `input-default` for
touchpad devices, so we can separate mouse and touchpad settings even
though they use the same capability and settings.

This no longer sets the input config, and only reads it. If we add a UI
for per-device config, we'll need some IPC mechanism to list connected
devices. (Assuming cosmic-settings can't use libinput directly for that.)

This moves `InputConfig` and `XkbConfig` to a new `cosmic-comp-config`
crate, so they can be used in `cosmic-settings`.
2023-08-31 13:59:49 -07:00
Ian Douglas Scott
0f5d654535 Use cosmic-config for input configuration; allow dynamic changes 2023-08-31 13:59:49 -07:00
Ian Douglas Scott
75912df270 config: Move input config handling into seperate file 2023-08-31 13:59:49 -07:00
Ian Douglas Scott
a5e7fc4a1a config: Move key binding code to a seperate file 2023-08-31 13:59:49 -07:00
Victoria Brekenfeld
74706b440e tiling: More precise group outline 2023-08-31 18:29:20 +02:00
Victoria Brekenfeld
380b00e083 render: Respect scale for indicator thickness 2023-08-31 18:17:37 +02:00
Victoria Brekenfeld
d394240fe6 stack: Fix wrongly scaled stack selection 2023-08-31 18:07:45 +02:00
Victoria Brekenfeld
2bc9f94255 kms: Make sure to re-render after finished animation 2023-08-31 13:53:30 +02:00
Victoria Brekenfeld
6439b3a43c Revert "loop: Schedule rendering for running animations on idle"
This reverts commit 5125337b42.
2023-08-31 13:53:30 +02:00
Ian Douglas Scott
6b34edb077 Send SCANOUT flag in dmabuf feedback when target_node != render_node
The Intel driver (at least) pads the stride to meet the requirements for
scanout on AMD or Nvidia cards, when this flag is set.

This works around the bug I've seen in the Nvidia driver with corruption
importing an unaligned dmabuf. This presumably is an issue in the Nvidia
driver, but presumably it the fix would be for the import to fail, so
using a stride that allows it to succeed is better anyway.
2023-08-11 08:34:08 -07:00
Ian Douglas Scott
c3dddb9917 XWayland keyboard grab protocol 2023-08-09 14:21:06 -07:00
Ian Douglas Scott
9875b87e73 xwm: Don't pass reverse order to update_stacking_order_upwards
This was setting the wrong order, and thus also fighting with
`raise_window`, creating a flood of configure events. Which seemed to
break submenus in Gimp when multiple toplevels were open.

This appears to be correct.
2023-08-09 10:06:03 -07:00
Victoria Brekenfeld
8d78328b9e
Merge pull request #142 from pop-os/egui-update
Update `smithay-egui` and fix compilation of `debug`
2023-08-08 16:37:07 +02:00
Ian Douglas Scott
eb182cd170 xwm: Don't pass override-redirect surfaces to update_stacking_order*
We shouldn't be sending configures to override-redirect surfaces.

Requires https://github.com/Smithay/smithay/pull/1094 to behave
correctly.
2023-08-08 07:06:34 -07:00
Ian Douglas Scott
4a780cb343 Update smithay-egui and fix compilation of debug 2023-08-07 08:47:51 -07:00
Ian Douglas Scott
baad2c01b4 Fix output filtering of override-redirect windows
`or.geometry()` was actually calling a different method in `filter` than
in `.flat_map`. Apparently since `or` in `filter` is an `&&X11Surface`
instead of `&X11Surface`, that invoked the trait method on `SpaceElement`...

Smithay should be changed in some way so that can't happen, but this
improves some of the behavior in cosmic-comp for now, at least. There
may be other issues related to this.

The `SpaceElement::geometry` was also returning a `loc` of `(0, 0)`,
which presumably isn't correct either.
2023-08-03 16:17:03 -07:00
Victoria Brekenfeld
5125337b42 loop: Schedule rendering for running animations on idle 2023-08-01 16:50:50 +02:00
Victoria Brekenfeld
568c8032b7 state: Trigger idle-callbacks on client disconnect 2023-08-01 16:50:26 +02:00
Victoria Brekenfeld
1a9f976818 xdg_shell: Trigger blocker evaluation on toplevel destruction 2023-08-01 16:49:29 +02:00