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.
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.
`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.
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.
Previously, screenshots and screencopy panicked if no DRM render nodes
are present.
Instead, create a `GlowRenderer` using llvmpipe, if available. This
should work as a fallback until pixman is integrated.
Avoids a little duplication (matching two variants, instead of three
backends).
The behavior, including errors and panics, should be unchanged for now.
Performance should also not be impacted.
This should help for adding llvmpipe rendering without a device node on
the kms backend, or for adding a variant for pixman.
Manually starting `cosmic-panel` was not working properly in release
builds, because without `cfg!(debug_assertions)`, the `privileged` flag
wasn't sent on the panel, so it couldn't be propagated to the applets,
which also fail the `client_has_no_security_context()` check.
I don't see a way to have both the `cfg!(debug_assertions)` check and
`COSMIC_ENABLE_WAYLAND_SECURITY`. Now only the latter is used, and it
determines the value of `privileged` for clients started normally. In
the future, we could make the default value of
`COSMIC_ENABLE_WAYLAND_SECURITY` depend on `cfg!(debug_assertions)` if
desired.
This also corrects the inconsistency that the `cfg!(debug_assertions)`
check wasn't applied to the render-node-specific Wayland sockets.