Commit graph

1340 commits

Author SHA1 Message Date
Paul Daniel Faria
e5263bbad8 Update leds when devices are added
This fixes #1104

LEDs on keyboard will now update to match the
compositor state when they're plugged in.
2025-01-06 12:13:51 +01:00
David Brochero
68b6156aa8
Fix sticky toggle crashes on maximized windows (#1110) 2025-01-06 12:10:49 +01:00
Yureka
9b78a2d780 refactor(shell/element): refactor how decorations height is accessed
This fixes several things:
- The xwayland code previously incorrectly used the SSD_HEIGHT (for Windows) even when the X11 surface was in a stack
- The SSD_HEIGHT was defined in surface.rs, even though rendering serverside decorations is done in the window/stack

Rename (min|max)_size to (min|max)_size_without_ssd in CosmicSurface and make it act accordingly
Add a new (min|max)_size() in CosmicWindow and CosmicStack, which takes the surface's (min|max)_size and adds the decorations.
Change all callers to use (min|max)_size() from the window or stack respectively, except is_dialog() where it does not matter.
2024-12-28 15:32:03 +01:00
Ian Douglas Scott
1118aa2877 When removing output global, use disable_global, remove with timer
This should fix an issue where output hotplug can sometimes cause
clients (including XWayland) to crash with a protocol error trying to
bind the output.

Using a timer doesn't seem ideal, but seems to be the correct way to do
this at present. Wlroots `wlr_global_destroy_safe` is basically the same
as this.

Adding a `LoopHandle` argument to `OutputConfigurationState::new` seems
awkward, but maybe better than a handler method for removing globals.
(`IdleNotifierState::new` also takes a `LoopHandle`). Perhaps Smithay
could provide some kind of helper for this.
2024-12-19 00:17:38 +01:00
Victoria Brekenfeld
7ac204ee79 focus: Fix active/focused output on refresh_focus
Previously removing the last output could have left seats with an
invalid active output. We already have logic to check this in
`refresh_focus` but failed to apply it before `update_pointer_focus`.
Let's fix that.
2024-12-16 20:14:37 +01:00
Victoria Brekenfeld
f2e53f09c9 shell: Fix stacking maximized windows 2024-12-16 17:29:56 +01:00
Ian Douglas Scott
6707c92522 toplevel-info: Fix behavior with multiple instances of global
Instead of looking for toplevel handles for the client, look for
toplevel handles for the specific global instance.
2024-12-14 09:32:11 +01:00
Victoria Brekenfeld
2e1f6a4746 shell: Unset focused outputs on remove_output 2024-12-13 16:23:30 +01:00
Victoria Brekenfeld
9b4127555e kms/surface: Fix racy output disable 2024-12-12 14:29:50 +01:00
Ashley Wulber
5b89ad27fb fix: manually scale the damage 2024-12-12 07:53:58 +01:00
Ashley Wulber
3132767a60 fix: improve damage tracking 2024-12-12 07:53:58 +01:00
Ashley Wulber
892c05f4fc fix(iced): use internal_ref size 2024-12-12 07:53:58 +01:00
Ashley Wulber
6c8325856f chore: update deps 2024-12-11 18:28:17 +01:00
Ashley Wulber
5f650e7d08 feat: alt+shift+tab 2024-12-11 18:28:17 +01:00
Vukašin Vojinović
7de52054ff chore: update iced/libcosmic 2024-12-11 16:58:16 +01:00
Ian Douglas Scott
0d0b89d538 Call data_init.init even if weak references are not alive 2024-12-11 10:58:42 +01:00
Ian Douglas Scott
16a1214207 output_configuration: Use unwrap in calls to Resource::data
Having if conditions for these is unnecessary when they should never be
reached. (This is commonly unwrapped in `smithay`.)

Some of these else conditions fail to call `data_init.init` with a new
id, so they'd result in a crash later anyway.
2024-12-11 10:58:42 +01:00
Ian Douglas Scott
fdfc5cbeb4 Use WeakOutput when accessing data of ZwlrOutputHeadV1
It seems cd9ff0b7bb broke mirroring.
Though it's also a bug that if any of these if conditions is not met,
the data will not be initialized.

Fixes https://github.com/pop-os/cosmic-epoch/issues/1341.
2024-12-11 10:58:42 +01:00
Ashley Wulber
2c01c94477 fix: activation of an element outside the current workspace
If the activated element is outside the current workspace, its workspace should be set to urgent
2024-12-10 17:37:01 +01:00
Michal Rostecki
9b50d0f506 main: Update D-Bus activation environment also on non-systemd systems
On systems without systemd, use zbus to update D-Bus activation
environment with `WAYLAND_DISPLAY` and `DISPLAY` variables.

Fixes #1037
2024-12-09 16:33:15 +01:00
Victoria Brekenfeld
7829e7696d focus: Only consider focused output 2024-12-05 18:37:09 +01:00
Victoria Brekenfeld
fce52cb6a2 focus: Un-activate non-active workspaces 2024-12-05 18:37:09 +01:00
Ashley Wulber
76863aaf9b fix: filter by active workspace in overlap notify 2024-12-05 18:20:10 +01:00
Victoria Brekenfeld
fc84fa9948 shell: Fix windows global geometry to include ssd 2024-12-05 18:20:10 +01:00
Ian Douglas Scott
e3b41c5c55 input: Apply output transform to touch/tablet events 2024-12-02 19:50:05 +01:00
Ian Douglas Scott
eaeca9a244 input: Define function for transforming touch/tablet event position 2024-12-02 19:50:05 +01:00
Alyssa Ross
69d251fb74 screencopy: don't force opaque window backgrounds
This meant that, for windows that were not fully opaque, there was no
way to capture their transparency.  No way to put a window with
transparency on top of a background in OBS, for example.
2024-12-02 18:02:48 +01:00
Ashley Wulber
a14d075aa0 refactor: add namespace 2024-11-27 17:23:14 +01:00
Ashley Wulber
60558e18fd overlay-notify: Implement handler 2024-11-27 13:20:18 +01:00
Ashley Wulber
895261c2bf overlap-notify: Implementation fixes 2024-11-27 13:20:18 +01:00
Victoria Brekenfeld
81b9fb179b output-configuration: Support cosmic-ext v2 2024-11-27 09:37:01 +01:00
Victoria Brekenfeld
80965a61b9 kms: Adaptive VRR support 2024-11-27 09:37:01 +01:00
Victoria Brekenfeld
d72bf54628 deps: Update smithay 2024-11-27 09:37:01 +01:00
Victoria Brekenfeld
dbb51e827d kms: Fix enabling outputs 2024-11-27 09:37:01 +01:00
Alyssa Ross
7e8cb91d23 Unthrottle windows in screencopy sessions
If an individual window was being screencast, and that window was not
visible, for example because it was minimized, that window would only
be rendered every 995ms, which did not look good on the screencast.

Now, non-visible windows with active screencopy sessions, as well as
windows that are mapped on non-visible workspaces with active
screencopy sessions, are rendered every 1/60th of a second, which
matches the frame rate of the video produced by
xdg-desktop-portal-cosmic.  In future, it might be good to let
screencopy clients suggest a redraw rate for captured windows.
2024-11-18 18:25:57 +01:00
Ian Douglas Scott
cd9ff0b7bb output_configuration: Use WeakOutput as user data instead of Output 2024-11-18 18:24:53 +01:00
Ian Douglas Scott
8d7f491830 Use WeakOutput instead of Option<WeakOutput> 2024-11-18 18:24:53 +01:00
Ian Douglas Scott
1b96256622 Update smithay 2024-11-18 18:24:53 +01:00
Ian Douglas Scott
17b61bbfab ci: Add cargo fmt check 2024-11-18 18:24:53 +01:00
Ian Douglas Scott
61692b21ad Run cargo format 2024-11-18 18:24:53 +01:00
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