Commit graph

1300 commits

Author SHA1 Message Date
Ian Douglas Scott
4db2e3ec25 Use new primary scanout output if old output is disabled
`Output` in Smithay doesn't track if the output still exists, other than
based on whether or not it has strong references. Which doesn't seem to
be working correctly.

There may be leaked strong references to `Output`s somewhere, and maybe
Smithay should track if an output is still valid, generally when it is
exposed as a Wayland global
(https://github.com/Smithay/smithay/issues/1584). But a check like this
works for now.

Addresses https://github.com/pop-os/cosmic-comp/issues/985.
2024-11-13 23:34:30 +01:00
Ian Douglas Scott
9f354ab45f output_configuration: Set enabled to false in remove_heads
`add_heads` will set it to `true` again, if used on the same `Output`.
It doesn't like like cosmic-comp's usage of this does that currently
though.
2024-11-13 23:34:30 +01:00
Ashley Wulber
8d5541b27f fix: apply transform to damage before blitting 2024-11-13 16:33:43 +01:00
Ian Douglas Scott
91bc1c00bf Recalculate tiling layout on change of display configuration
Previously, changing the resolution, scale, or orientation of a display
left tiling layouts that don't fill the screen and/or extend off of the
screen area, until an action like opening a window makes it recalculate
window positions.

Now this is done immediately when the output configuration changes.

Perhaps we should consider if we want a different animation for things
like rotating a screen, but the current behavior isn't too bad.

For floating layouts, `refresh` already remaps windows that are out of
bounds for the output, so this doesn't change that. Perhaps decreasing
the resolution (or moving to a lower resolution output) should try to
reduce the window size. But the current behavior generally seems okay.
2024-11-12 11:21:42 +01:00
Ryan Brue
641bb75eb1 design: use active_window_hint as the thickness for floating window snap outline
This commit changes the snapping indicator's thickness to match the active window hint, per design recommendation by Maria. The thickness for this outline never goes under 1, also per Maria's spec.

Signed-off-by: Ryan Brue <ryanbrue.dev@gmail.com>
2024-11-06 12:01:25 +01:00
Ian Douglas Scott
90883c6ab1 Add cosmic_atspi_v1 protocol
Used to provide a backend for `AtspiDevice` in `at-spi2-core`, so Orca
keybindings can work.
2024-10-31 18:49:56 +01:00
Victoria Brekenfeld
eb64fdaf8f element/window: Input offset fixes 2024-10-25 11:27:55 +02:00
Victoria Brekenfeld
743e5d4360 toplevel_info: Fix racy data creation 2024-10-25 11:05:41 +02:00
Victoria Brekenfeld
5207453157 kms: Don't substract for mirrored outputs 2024-10-25 10:42:38 +02:00
Ian Douglas Scott
ea27ec5e28 DPMS with wlr-output-power-management-unstable-v1 protocol 2024-10-25 10:31:24 +02:00
may
65a54706f5 set cursor shape for resize grabs 2024-10-24 18:22:25 +02:00
Victoria Brekenfeld
9a9eddb132 focus: Fix layer-popup locations 2024-10-23 17:35:06 +02:00
Victoria Brekenfeld
0092dac08c input: Use render_input_order 2024-10-22 19:43:47 +02:00
Victoria Brekenfeld
51c8588f89 render: Use render_input_order 2024-10-22 19:43:47 +02:00
Victoria Brekenfeld
140d870e7b focus: Introduce render_input_order 2024-10-22 19:43:47 +02:00
Ian Douglas Scott
2497992d31 Don't create initial empty workspace when there are other workspaces
`WorkspaceSet::new()` now creates a set with no workspaces, instead of
one with a single workspace.
2024-10-21 18:10:53 +02:00
Ian Douglas Scott
229c794aad On adding output add set after processing other sets
Maybe there's some reason for this, but I don't think the first loop
needs to handle the new set.

I do not expect this to change behavior.
2024-10-21 18:10:53 +02:00
Ian Douglas Scott
fb2631adce Fix workspace indices when workspace is moved to another output
Previously, workspace numbering could end up with numbers skipped,
because an intermediate workspace was moved.
2024-10-21 18:10:53 +02:00
Ian Douglas Scott
c8ebac354c Preserve active workspace when workspaces are moved back to another output
Instead of preserving the active workspace index, which may not match if
a workspace before it has been moved back to another output.
2024-10-21 18:10:53 +02:00
Ian Douglas Scott
400a7752fd When moving workspaces on output remove, don't movve empty workspace
This resulted in a somewhat weird effect, where the empty workspace at
the end on the monitor has an `output_stack` with the other output, so
a window created there is moved back to to second output when it is
re-connected. This seems unexpected.
2024-10-21 18:10:53 +02:00
Ian Douglas Scott
6fc36cb00e Fix spelling of prefers 2024-10-21 18:10:53 +02:00
Ian Douglas Scott
540ed3d170 Use to_ne_bytes() instead of unsound Vec::from_raw_parts
`from_raw_parts()` is only sound if the alignment is the same, so it
can't be used to covert to a `Vec<u8>` from a type with a greater
alignment.

This isn't hard to avoid, luckily.
2024-10-21 18:10:53 +02:00
Vukašin Vojinović
50d6dc3d21 fix(menu): use corner radius from theme 2024-10-21 17:59:46 +02:00
Ian Douglas Scott
b8c429facb Add COSMIC_DISABLE_DIRECT_SCANOUT env var
Like `anvil`. Useful for testing and working around issues.
2024-10-15 11:45:46 +02:00
Ian Douglas Scott
087be20365 Add util function for boolean env vars
It's probably good to be consistent about what is recognized as "true"
without copying the same code.
2024-10-15 11:45:46 +02:00
may
a4d875e35e cursor follows focus to center of window 2024-10-10 20:49:43 +02:00
Vukašin Vojinović
ea2215ec3f fix(window): center window title 2024-10-10 19:58:56 +02:00
Vukašin Vojinović
b7a34bdd1e fix(menu): styling
Also improves the styling of resize indicators, and removes the unnecessary `.density()` method call for the SSD header.
2024-10-10 19:58:56 +02:00
may
be38da47e9 use Grabbing cursor instead of Grab cursor
when i implemented the cursor-shape-v1 protocol i
didn't notice that the previous `CursorShape::Grab`
actually mapped to `CursorIcon::Grabbing` instead of
`CursorIcon::Grab`. this fixes that "regression".
2024-10-08 14:39:33 +02:00
Victoria Brekenfeld
07bd8bedef input: Treat pointer-shortcuts as potentially inhibited 2024-10-07 20:50:32 +02:00
Ian Douglas Scott
15a6425836
Set default output transform based on DRM panel orientation (#901) 2024-10-07 18:12:40 +02:00
Ian Douglas Scott
a96394f7a6 Update egui, smithay-egui, smithay 2024-10-02 23:55:10 +02:00
Christian Meissl
afdb656778 dnd: correct handling of cursor buffer offset 2024-09-23 11:13:21 +02:00
Victoria Brekenfeld
bd04d68106 overlap-notify: Initial implementation 2024-09-23 10:55:00 +02:00
Victoria Brekenfeld
9c7c41c508 toplevel-info/mgmt: Update to v2/v3 2024-09-23 10:55:00 +02:00
Victoria Brekenfeld
bbda6fb13d chore: Update cosmic-protocols 2024-09-23 10:55:00 +02:00
Victoria Brekenfeld
ad449f9db0 chore: libcosmic update 2024-09-20 12:43:58 +02:00
Ian Douglas Scott
d7ca0324c5 Remove needs_key_repetition argument
Not supressing key repetition in backends seems like it was a bug, and
should be fixed as of https://github.com/Smithay/smithay/pull/1535.

So an argument for this should be unnecessary now.
2024-09-19 16:23:25 +02:00
Ian Douglas Scott
6d017225e4 Move handling of keyboard swap action to a seperate function 2024-09-19 16:23:25 +02:00
Ian Douglas Scott
96c931a0c3 Split off KeyboardHandle::filter callback to separate method
This saves 7 levels of indentation, which seems like a plus.

The `InputEvent::Keyboard` branch of the `match` now fits clearly in one
screen. The `filter_keyboard_input()` method could probably still be
broken up more.

The method needs a few arguments, but it seems nice to make what it
depends on explicit.
2024-09-19 16:23:25 +02:00
Ian Douglas Scott
fb32d39b1b Update smithay 2024-09-19 16:23:25 +02:00
Ian Douglas Scott
d02aecce61 Use .modified_sym() instead of casting keycode to keysym
Not sure if this is actually used, and if so the code may need more
testing, but this definitely is more correct, at least.
2024-09-19 16:23:25 +02:00
Ian Douglas Scott
01d78689b5 Run cargo fmt 2024-09-19 16:23:25 +02:00
Dasha Mukhina
7c24e361aa fix: remove non-existent input 'nixpkgs' from 'crane'
crane does not have inputs at all.
2024-09-18 15:43:59 +02:00
Dasha Mukhina
55c83a3e30 fix: add wayland, x11 libraries in runtime
fixes 'libwayland-egl.so could not be loaded' and 'Initializing X11 Backend failed' on NixOS.
2024-09-18 15:43:59 +02:00
Dasha Mukhina
57eb827469 style: reformat flake.nix using nixfmt-rfc-style 2024-09-18 15:43:59 +02:00
Dasha Mukhina
6fc7fd2baf fix: unresolved import [of std] on NixOS in RA
On NixOS, when entering the devshell, Rust Analyzer couldn't locate `std` (sysroot) since it was missing.
2024-09-18 15:43:59 +02:00
Jeremy Soller
3e1b352297 Add com.system76.CosmicFilesDialog as floating window exception 2024-09-11 14:51:11 -06:00
Ian Douglas Scott
b820c97c66 Destroy X11Wm when we lose connect to X server
This fixes the issue where X11 windows freeze and can't be closed
when Xwayland dies.
2024-09-11 07:15:02 +02:00
Victoria Brekenfeld
4d215755f6 shell: Fix incomplete focus_stack after swapping 2024-09-10 21:10:02 +02:00