Maximized windows get resized to this when the last output gets removed, which
can increase VRAM load unnecessarily. As the placement tracker resizes windows
back to their original size, we can reduce the size of the placeholder output
without causing additional issues
Opening the user actions menu causes auto-hiding layer-shell windows
(such as Kickoff, KRunner) to hide, closing the menu and having KWin
transfer focus back to the window which is now half-destroyed.
XdgToplevelWindow::acceptsFocus() also checks for isDeleted().
The brightness overrides are for displays with missing or broken brightness
data in their EDID, and allow the user to work around those displays. In
the future we could also offer an HDR calibration process that allows determining
the correct brightness values for the screen.
The gamut wideness setting allows the user to tweak what gamut KWin assumes
sRGB applications to have. This is useful for working around the gamut mapping
displays do, which make sRGB content look washed out, and also to allow
users to make colors of sRGB apps look more saturated if they wish to.
glReadPixels reads from the bound framebuffer, so create an offscreen
framebuffer and attach the texture to it
Co-authored-by: Jan Grulich <jgrulich@redhat.com>
This allows Plasma to gracefully close windows on shutdown by sending
xdg_toplevel.close. If after 10 seconds windows are still open because
they prompt for unsaved changes or similar cases, a notification is
shown to either prompt or logout regardless.
CCBUG: 461176
Never auto-activate Wayland windows when "Extreme" focus stealing
prevention is configured. This allows to more easily find places
where window activation isn't properly implemented, such as on
application startup.
The closefb ioctl removes the userspace reference from the framebuffer but does
not try to disable planes and outputs if the buffer is still used. This allows
for example for smoother transitions between SDDM and the Plasma session
This is not compatible with plugins that install their own filters. The
approach in this patch is not elegant, but it should work. Another option
would be to convert these filters and spies to QObjects and use QObject
ownership model, but this would be also too excessive just to save a few
lines of code.
We don't need an intermediate widget class here, we can set up the UI directly, like it's done in several effect KCMs already
Not only does this simplify the code, it also fixes crashes due to broken ownership
BUG: 477020
Effect::initConfig() definition can't be moved to effect.h because
it's going to create a cyclic dependency. On the other hand, the real
benefit of initConfig() is doubtful. It's a shortcut for calling
Config::instance(effects->config()), which is small amount of code.
If there's a supported mechanism to handle the format, announce them as
supported.
If there are modifiers supported by the graphics card (even though as
external only), offer them as well.
Otherwise the animation feels wrong while activating with a gesture.
Now when a 1:1 gesture is ongoing, then the Overview effect will stop
animating the overviewVal/gridVal values. I implemented this by porting
to states, giving 1:1 gestures their own states, and only animating the
change between states.
BUG: 476536
After merging libkwineffects and libkwin, EffectsHandler and EffectWindow
have effectively become redundant. On the other hand, Effect and the
associated factory code is still relevant. In order to split relevant and
"legacy" code, this change extracts the Effect class in its own header.
It's also a good idea to split kwineffects.h header because it's quite
huge...
This leaks to other processes that are started by KWin.
The QPA sets ThreadedOpenGL capability to false which suffices
to use the basic render loop with OpenGL.
Effects can hold references to closed windows, which can cause problems
after the workspace is destroyed.
This change makes ApplicationX11 unload effects before destroying the
Workspace and the Compositor similar to how it's done in main_wayland.
BUG: 475511
It doesn't look wrong anymore, presumably what caused it to look wrong before
was just a bug. Blending in sRGB or PQ is still technically wrong, but it
looks okay, and that's an acceptable tradeoff to make in order to get the
responsiveness and power usage improvements the hardware cursor offers
This 1. is more familiar terminology as on other platforms (Gnome, Android); 2. avoids confusion with a planned future day/night light/dark color scheme switcher.
They cause stutters and reduced frame rates on some Intel laptops because the
buffers don't become readable in time, so disable the checks until that's fixed
on the driver side. For debugging purposes, the environment variable
KWIN_DRM_DISABLE_BUFFER_READABILITY_CHECKS can be used to override the default
behavior.
BUG: 476860
this improves the out of the box behavior which has regressed a bit over
time. since we default to kcfg_ActiveMouseScreen=true the active screen
by default follows the pointer. during early startup we position the
pointer on a Placeholder output, this output does eventually get
replaced by the real output(s). because of the update logic we'd
re-position the pointer on the closest real output, but that isn't
necessarily the intended primary output.
e.g. consider an eDP + HDMI setup depending on the geometries involved
the cursor may end up on the HDMI screen by default rather than the eDP
resulting in plasma-welcome opening on the HDMI output.
to mitigate this problem we now track whether the last output was a
placeholder and if so we instead try to position the pointer on the
current primary output
The indirection no longer required because libkwineffects has been
merged with libkwin. EffectWindow will be eventually dropped in favor
of apis provided by Window and WindowItem.
The rationale behind the check was sandboxed apps could have a different
mount namespace to kwin, therefore lying about the executable path was
doable.
Moving forward anything sandboxed will have a security context app Id.
Anything not sandboxed can circumvent these checks anyway.
This significantly improves application launch time.
The security context appId is set by the launching container (i.e
flatpak) and is therefore more trustworthy than any other source of
application ID.
Use this when looking up allowed wayland extensions.
This allows KWin to securely identify the client for a given connection,
without relying on the process name.
This patch does not do anything meaningful with the application ID other
than store it.
This first version does not support kwin restarts, it can come
afterwards.
Testing done:
With latest flatpak, running `WAYLAND_DEBUG=1 flatpak run org.telegram.desktop |& grep security`
shows that flatpak itself bound the security context, and the client did not see it advertised.
The configuration file may contain entries that have the same output identifiers if
there's a bug in the implementation. To repair the config, this commit checks for
duplicate entries in the output list and removes them when loading the config file.
OffscreenQuickView replaces the contents of the default scene. Nothing
will be repainted beneath it.
On the other hand, if the OffscreenQuickView contains translucent region,
there might be visual glitches. To prevent that, this change makes
scene effect views opaque.
We want some quick views to be opaque, for example SceneEffect views.
This changes adds an api allowing to specify whether the given
OffscreenQuickView must be opaque or translucent.
If another compositor changes the color encoding and color range properties, the
resulting colors will be wrong. This commit ensures they're always set to BT.709
limited range to prevent that
When a display gets turned off while a pageflip event was still pending, the pending
state gets changed immediately, without waiting for the pageflip event to arrive first.
When this happens, activePending() returns false, and so the pageflip event gets discarded.
This commit changes the logic to only check for activePending() when the pageflip is for a
modeset, avoiding that issue.
BUG: 476340
BUG: 476341
BUG: 476342
BUG: 437520
BUG: 475146
It's used as a float and otherwise it makes (some?) drivers very
confused as they're required to cast at runtime.
The original value is double so it makes sense to keep the same type.
Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
As KWin measures render times properly now, these settings and estimations
should no longer be necessary, so this commit replaces them with one hardcoded
algorithm that should prevent most dropped frames and reduce latency
When sorting surfaces in the ancestor order we need to ignore null
surfaces.
In addition to that, we also need to properly handle the case where
a transaction with dependencies is unlocked and it contains null
surfaces.
For example, if there are three transactions A -> B -> C, and the B
transaction is unlocked, we cannot apply it until transaction A is
applied. The readiness check is based on checking the first pending
transaction of the surface. But if the surface is null, the check
will be skipped, which is not ideal as transaction B can be applied
before transaction A now. To address that, this change makes every
transaction entry remember the previous transaction. With that, the
readiness check can be performed even if the surface has been destroyed.
BUG: 475648
It doesn't make sense for a window to become 1x1 pixels small. When we have
server side decorations we also know that the decoration takes a lot of
space, so this commit enforces a bigger minimum size for decorated windows
BUG: 469237
Window::acceptsFocus() is not taken into account when a window is
activated using Workspace::activateWindow(). The main reason is because
of different input models on X11.
Instead, Window::takeFocus() should check itself if the window accepts
focus.