Commit graph

847 commits

Author SHA1 Message Date
Victoria Brekenfeld
1f8915f802 layout/tiling: Don't unmap before moving children 2024-08-08 21:26:30 +02:00
Ian Douglas Scott
4748916ff9 Make RenderElement implementations generic to reduce duplication
It would make sense to have a bound like
`for<'frame> R::Frame<'frame>: AsGlowFrame<'frame>`. But that appears to
not behave properly due to current limitations of the borrow checker:
https://blog.rust-lang.org/2022/10/28/gats-stabilization.html#implied-static-requirement-from-higher-ranked-trait-bounds

Instead, this makes `glow_frame` and `glow_frame_mut` associated
functions of the `AsGlowRenderer` trait. Then it is pretty
straightforward to make the `RenderElement` implementations generic
using that and `FromGlesError`.

It would make sense to make `Self::Error: FromGlessError` a requirement
of the `AsGlowRenderer` trait, but due to the lack of implied bounds
support, that produces a bunch of errors about missing bounds. If Rustc
improves that eventually, some bounds could be cleaned up a bit:
https://github.com/rust-lang/rust/issues/44491
2024-08-05 12:58:52 +02:00
Victoria Brekenfeld
dc3dbfdba0 chore: Remove unused method 2024-08-02 20:54:15 +02:00
Victoria Brekenfeld
c3524d3546 stack: Fix round corners on maximize 2024-08-02 20:54:15 +02:00
Victoria Brekenfeld
5aaac707f8 window: Fix round corners on maximize 2024-08-02 20:54:15 +02:00
Victoria Brekenfeld
c299748997 config: Load toolkit config on start 2024-08-02 20:54:15 +02:00
Ashley Wulber
b8eaf5dcb4 chore: update smithay 2024-08-02 15:54:05 +02:00
Ian Douglas Scott
de264e250f Fix build with debug feature 2024-07-29 14:49:44 +02:00
Victoria Brekenfeld
61f11d1363 element/stack: Style fixes 2024-07-26 14:59:11 +02:00
Dominic Gerhauser
3214ef0250 element/window: Add maximize on header double-click 2024-07-26 13:22:56 +02:00
Victoria Brekenfeld
9239584435 chore: libcosmic update 2024-07-26 13:22:56 +02:00
Dominic Gerhauser
27f048b998 respect cosmic-tk setting for minimize and maximize 2024-07-22 19:08:19 +02:00
Victoria Brekenfeld
d4926c3a9e shell: Allow dragged windows to be focused 2024-07-17 18:57:21 +02:00
Ian Douglas Scott
0636bcdef3 Add workspace_overview_is_open function; put in a utils::quirks mod
This is increasingly not just related to screencopy, so it's weird to
add there. I don't see any other module that fits, so add one called
"quirks" (like the Linux kernel uses for device-specific handling in
generic drives).
2024-07-15 17:12:05 +02:00
Ian Douglas Scott
31358d1993 Inhibit workspace animations when workspaces view is open
Fixes https://github.com/pop-os/cosmic-workspaces-epoch/issues/27.

We want this to apply to changes to workspace either through keybindings
or the cosmic-workspaces UI, so it adding a check here seems reasonable.
In principle it could be good to have some kind of privileged protocol
for setting things like this.

We may also want a configuration option to disable animations at some
point.
2024-07-15 17:12:05 +02:00
Ian Douglas Scott
94fecec9cb Add a SplitRenderElements type, with useful methods
`(w_elements, p_elements)` tuples are used in a bunch of places. A
struct with named fields is generally an improvement just due to the
fact the order is non-obvious.

But we can also add methods. In particular,
`extend_from_workspace_elements` abstracts out some of the more
redundant code in `workspace_elements`.

It would be nice to avoid allocation everywhere, but iterators would
complicate lifetimes, run into issues with needing multiple mutable
borrows to things like the `Renderer`, and be awkward in certain
functions without generator syntax. In any case, cosmic-comp already
relies on allocating vectors here.

If this abstraction is commonly useful in compositors, perhaps it could
be moved to Smithay.
2024-07-15 17:12:05 +02:00
Victoria Brekenfeld
c506d94ac8 shell: Don't consider active overviews animations 2024-07-15 16:31:24 +02:00
Victoria Brekenfeld
b1778dabb3 shell: Don't crash on zero outputs for global-mode 2024-07-12 19:29:47 +02:00
Victoria Brekenfeld
3b9d0ce3d7 HACK: Remap minimized X11 windows on restore 2024-07-10 22:36:40 +02:00
Victoria Brekenfeld
3485d82788 shell: Don't allow maximizing fullscreen windows 2024-07-10 22:36:40 +02:00
Victoria Brekenfeld
bf6ea3414b x11surface: Unmap on minimize 2024-07-10 22:36:40 +02:00
Victoria Brekenfeld
d85b6f0e50 focus: set minimized windows unfocused 2024-07-10 22:36:40 +02:00
Victoria Brekenfeld
3eb3e3b1c0 xwm: Fix edge-cases for fullscreening 2024-07-10 22:36:40 +02:00
Victoria Brekenfeld
c06529b548 focus: Don't send enter/leave for same surface 2024-07-10 22:36:40 +02:00
Victoria Brekenfeld
e61a76d39c chore: libcosmic update 2024-07-08 12:11:58 +02:00
Victoria Brekenfeld
f02520c194 shell: Don't check grab-conditions for SSD grabs 2024-07-03 23:40:42 +02:00
Victoria Brekenfeld
c42a2ac279 tiling: Don't crash when swapping with group 2024-07-03 21:23:22 +02:00
Victoria Brekenfeld
b9a323c9ff shell: Populate focus_stack when unstacking 2024-07-03 21:04:28 +02:00
Victoria Brekenfeld
dc882ffc36 focus: Fall back to first window, if stack is empty 2024-07-03 21:03:58 +02:00
Victoria Brekenfeld
c933aa1a4f shell: Don't skip over Group-targets for next_focus 2024-07-03 21:03:36 +02:00
Michael Aaron Murphy
553c49b42b feat: runtime configurable keybindings 2024-07-01 15:20:23 +02:00
Victoria Brekenfeld
5662a0f219 floating: Correctly place grabbed tiled windows 2024-06-28 12:24:09 +02:00
Victoria Brekenfeld
4652a23294 grabs: Fix ssd not updating during move grab 2024-06-28 11:25:20 +02:00
Victoria Brekenfeld
3d58ec062d ssd: Fix styling 2024-06-28 11:24:54 +02:00
Victoria Brekenfeld
da9af7ad23 floating: Add proper recalculate function
Don't just check maximized windows on every refresh, remapping them and
causing flickering, but introduce a proper recalculate method to be
called on layer-shell events / set_output event.

Also if we need to remap, remap all windows to keep stacking order.
2024-06-27 13:35:48 +02:00
Victoria Brekenfeld
953c277cb0 focus: Fix crash when no output is available 2024-06-27 12:35:01 +02:00
Victoria Brekenfeld
ddcb435632 debug: Fix running with new kms backend 2024-06-26 12:59:33 +02:00
Victoria Brekenfeld
92f3dbce01 chore: Cleanup 2024-06-26 12:59:33 +02:00
Victoria Brekenfeld
cf0b0f9d2d chore: Move some rendering-related state into the shell 2024-06-26 12:59:33 +02:00
Victoria Brekenfeld
9e05a84db2 state: Split up send_frames 2024-06-26 12:59:33 +02:00
Victoria Brekenfeld
c7d50e7c5b seat: Make render-related state thread-safe 2024-06-26 12:59:33 +02:00
Victoria Brekenfeld
bd58481d19 element: Introduce CosmicMappedKey for safely hashing windows across threads 2024-06-26 12:59:33 +02:00
Victoria Brekenfeld
e78e199663 chore: Update smithay for thread-safety 2024-06-26 12:59:33 +02:00
Ian Douglas Scott
f2342f56c1 Update to latest Smithay version 2024-06-19 12:39:16 +02:00
Victoria Brekenfeld
b5dcec5215 focus: Don't stack overflow because None=None 2024-06-06 13:07:29 +02:00
Ian Douglas Scott
697ec9e1fe Use active() instead of surfaces().any in stack same_client_as
Setting the clipboard is only allowed when the keyboard focus is the
same client as the client trying to set the clipboard. We shouldn't
allow background windows in stacks to set the clipboard.

I don't know if anything else expects `same_client_as` to have this `any`
behavior.
2024-06-04 13:24:25 +02:00
Ian Douglas Scott
d9a1ec04bd Set clipboard/primary focus in refresh_focus
This should fix https://github.com/pop-os/cosmic-comp/issues/494, and
make clipboard and primary focus consistently correct.

Changing the active element of a stack needs to change the clipboard
focus, but it wasn't being changed since the `KeyboardFocusTarget` was
unchanged. The `CosmicStack` methods that change the active stack
element also have no obvious way to change the keyboard focus. So we can
set this in `refresh_focus`, which should be correct.

If the new focus `WlSurface` is `None`, this clears the focus instead of
leaving it as the previous code did. I believe that is desirable.

Requires https://github.com/Smithay/smithay/pull/1442 to avoid repeated
`offer`s, instead of only when focus changed.

(Perhaps this could better be solved by having a `WlSurface` variant of
`KeyboardFocusTarget`, like pointer focus, or some mechanism for a stack
of focus, which could help other things. But it's also unclear exactly
how that would work with the code for setting the active stack element,
among other questions.)
2024-06-04 13:24:25 +02:00
Ryan Brue
6ca1a37a53 design: Make server side decorations compact 2024-05-30 23:05:34 +02:00
Ashley Wulber
13e67f3dc2 fix: apply activated state when updating maximized layout 2024-05-30 22:25:33 +02:00
Ian Douglas Scott
0c54511477 Invert is_decorated test in min_size/max_size
It looks like these if conditions assumed `true` mean "has SSDs". But it
actually means the surface is client-side decorated.
2024-05-29 06:26:41 -06:00