Since the debug console has Qt.BypassWindowManagerHint flag set, it
won't be placed or ensured that it stays in the work area.
On the other hand, unlike X11, kwin won't have problems if the debug
console is managed on wayland.
BUG: 453920
We need to send sizes in a format that param buffers understand.
This fixes some glitches we'd see when sharing a window and resizing it.
Thanks Jan Grulich for pointing me in the right direction!
BUG: 461590
Our logical co-ordinates for shape can be floating. The shape is used to
determine final vertices on screen.
The commit appears to introduce some new loops but they're mostly what
QRegion would be doing internally so it shouldn't impact performance.
For most cases we just have a single rectangle in our shape anyway.
opaqueRegion is unchanged for now.
With 74eb0d8, ConfigureNotify events are always sent when moving windows. It's no longer necessary
to send a final ConfigureNotify event after a window is moved.
This removes the optimization that sends only one ConfigureNotify event after moving is completed.
However, other windows may depend on ConfigureNotify events to adjust their position in a timely
manner. For example, the shadow window surrounding the main login window of WeChat on Wine.
BUG: 449302
If the platform doesn't support setting gamma ramps, let the request
fail. In long term, we need a software fallback too so this property is
not that relevant.
Makes it possible to assign a pointer button event as the trigger to a
button rebind. This would make it possible to make a mouse click the
outcome of such actions.
It's odd to manipulate host cursor position and it's not highly
important, for example we haven't had a need to warp the cursor on
wayland.
The main motivation behind this change is to slim down the Platform to
make it more output oriented.
- By scaling: make sure we are scaling by the feed size rather than the
output size, which is irrelevant in this case.
- By positioning: properly position the outputs on the feed if the feed
scale is != 1
If a window was moved by the user, it got effectively blacklisted from being
ever restored again. Instead of only tracking the last restore point, compare the
current window state with the state it had when the output configuration was last
seen. If either that or the last restore point match the window, restore the old
window state.
We use KWIN_NAME, KWIN_INTERNAL_NAME_X11 and KWIN_INTERNAL_WAYLAND
properly only in a few places. In other, we use hardcoded names.
Let's not bother and hardcode kwin names everywhere rather than have one
foot in and one foot out, it's simpler.
Due to being a compositor, kwin has to conform to some certain
interfaces. It means a lot of virtual functions and function tables to
integrate with C APIs. Naturally, we not always want to use every
argument in such functions.
Since we get -Wunused-parameter from -Wall, we have to plumb those
unused arguments in order to suppress compiler warnings at the moment.
However, I don't think that extra work is worth it. We cannot change or
alter prototypes in any way to fix the warning the desired way. Q_UNUSED
and similar macros are not good indicators of whether an argument is
used too, we tend to overlook putting or removing those macros. I've
also noticed that Q_UNUSED are not used to guide us with the removal no
longer needed parameters.
Therefore, I think it's worth adding -Wno-unused-parameter compiler
option to stop the compiler producing warnings about unused parameters.
It changes nothing except that we don't need to put Q_UNUSED anymore,
which can be really cumbersome sometimes. Note that it doesn't affect
unused variables, you'll still get a -Wunused-variable compiler warning
if a variable is unused.
There were overflows in the bandwidth estimation calculation. To simplify things,
also only generate common modes if the display doesn't advertise them on its own
already.
Seems we can't have a plural with an argument in singular and not in the
plural
a format specification for argument 2, as in 'msgstr[0]', doesn't exist in 'msgid_plural'
msgfmt: found 1 fatal error
Makes it possible to follow the dbus service for locale configuration,
making it possible to have third parties integrate with Plasma.
This is done opt-in for now, it can be adopted generally in the future,
if necessary.
This rewrite ensures that
- formats are tested for multi-gpu transfer
- dmabuf with either 10bpc or 8bpc buffers are preferred to cpu copy
- formats where drmModeAddFB2 fails are skipped
kwin can crash for reasons that have nothing to do with compositing. If
that's the case, after two crashes compositing will be permanently
disabled and you would need to go to system settings to reenable it, the
timestamp based check in the x11 backend won't be effective.
CCBUG: 452344
We don't need to emit {x,y,width,height}Changed signals ourselves. We
also need to send an expose event otherwise the window can be rendered
incorrectly if it's resized. The logic follows QtWayland implementation.
With the pull approach, the XdgOutputV1Interface class doesn't have to
be exposed in the public api and can be made private to simplify the
implementation of the xdg-output-v1 protocol.
Currently, kwin will continue matching dnd actions after a drop. This is
mainly needed in order to make "ask" action work.
However, it appears like there are clients in the wild that update offer
actions after receiving wl_data_source.dnd_drop_performed and wl_data_device.drop
events.
One could argue that's a client bug, and perhaps it is, but the spec is
vague about that. In meanwhile, let's make sure that dnd action matching
is active after drop only when the selected data source action is "ask."
KPluginMetaData in KF 6 doesn't load desktop files anymore. It means
that plasma packages need to come with json metadata files.
This change adjusts the generic scripted config loader so it can load
configuration even for packages with no metadata.desktop files.
As the drm format number of 10 bit colors is lower, the fallback sorting
preferred those formats, even if KWIN_DRM_PREFER_COLOR_DEPTH=24 was set.
To fix that, prefer 8 bit colors over something random.
The X11 standalone backend has an obscure fallback to hw screen
inversion if compositing is disabled. While it's great, it conflicts
with existing features such as night color.
In order to make code cleaner and clean up dependencies, this change
moves screen inversion shortcut to the invert effect. While it can
potentially affect users that don't use compositing, I think the number
of such affected people is very small.
In hindsight, preferring hw over sw transform is nice, but I think we
need to analyze it first and then come up with a proper solution that
integrates with color management and works great both on x11 and wayland.
renderWindow bypasses all other effects and simply calls the code that
is responsible for the final render of the window. This means that any
effects that are active on the window are skipped, including things that
may change how the window is rendered like the invert effect. To fix
that, ensure we render the window with all effects applied.
BUG: 459417
The screen needs to stay black until it gets enabled again, otherwise
slight timing differences can cause the screen to turn on full brightness
again immediately before turning off.
BUG: 460902
With the addition of KGlobalAccel::globalShortcutActiveChanged(),
there's a way to monitor all triggered actions without adding any
boilerplate code.
This change removes the KGlobalAccel bits from the Platform class. This
reduces the amount of boilerplate code; currently we need to be careful
about ensuring that Platform::setupActionForKGlobalAccel() is called.
Another reason behind this change is to simplify the api of Platform and
remove things that don't have anything to do with outputs.
`QMouseEvent::globalPos()` returns QPoint rather than QPointF, which
internally rounds the screen position. This can result in mouse
positions that are outside the screen, leading to problems. Since
screenPos() seems to be the same, use that so we get a QPointF instead.
Additionally, apply similar changes to the other events.
In a bunch of cases, we want to floor when converting to QPoint rather
than rounding. As it gets tedious to repeat the same code over and over,
add a helper function.
Use isNull on QSizeF to check for a zero delta instead of comparing it
with a default-constructed QSizeF, which in practice initializes to
(-1.0,-1.0). This caused relative motion events to be omitted if the
delta happened to be equal to (-1.0,-1.0), causing mouse jumping in some
applications.
BUG: 444510
Signed-off-by: John Brooks <john@fastquake.com>
The signal will be emitted if text-input-v3 applies a new enable state
if it's already enabled.
In Gtk's implementation, sending text_input_v3.enable for the second
time has the similar semantics of text-input-v2.showInputPanel. Try to
connect them together and add corresponding test.
See also: a95cfb1c45/gtk/gtkimcontextwayland.c (L555)
This way, the footer actions collapse into a menu when there's not enough space
to show them all, instead of being cut off.
BUG: 460793
FIXED-IN: 5.26.2
All these properties have XCB_ATOM_STRING type. From the ICCCM spec
[2.7.1]
STRING as a type or a target specifies the ISO Latin-1 character
set plus the control characters TAB (octal 11) and NEWLINE (octal 12).
testDbusInterface fails with Qt 6 build because QCOMPARE detects the
type difference between QString and QByteArray.
Since these properties being byte arrays has caused reasonable amount of
discomfort, let's make them QStrings. It will fix the test and make some
scripted effect code more cleaner.
The CI now has the ability to limit the passing unit test requirements
to more specific platform configurations, so the not yet working Qt 6
unit tests shouldn't block this anymore.
In some cases, stateCommitted may fire after a new surface being focused
and in correctly set input method to be inactive. This can be reproduced
by switch client between an active text input v3 client and text input
v2 client.
RenderGeometry is a list of vertices that should be rendered. It's
needed so we can convert WindowQuadList to device coordinates and do
clipping in device coordinates. The intention is also to use it to
replace arbitrary float arrays in effects eventually.
This rounds the position of geometry in the OpenGL scene, which means
things that are fractionally scaled and end up between pixel boundaries
are instead aligned to pixels. This doesn't fully solve the fractional
scaling blurriness, as we still need the application to provide a buffer
with the correct size. If we do have a buffer with the correct size, we
will now render properly aligned. For example, internal clients should
now be correct.
Task Manager has this option, so let's keep them consistent.
Surprisingly, when a window is set to "All Desktops", choosing "All
Desktops" again clears that flag, i.e. sets the window back to only
single desktop. But it is not intuitive at all. So let's have this
separate action to pin a window to current desktop.
Note: Wayland allows for multiple but not all desktops to be assigned to
a window, so it works differently there. Should we have a similar
option there too?
BUG: 458415
Client-side wrappers for input-method-unstable-v1 fail to build because
wl_keyboard_interface is referenced in the header file generated by
wayland-scanner.
Unfortunately, qt6_generate_wayland_protocol_client_sources() forces
--include-core-only argument, this is addressed in Qt 6.4.1, but in
meanwhile let's ship a copy of Qt6WaylandClientMacros.cmake file until
the required Qt version is out.
Since we now use an orthographic matrix as main projection matrix, the
glide and sheet effects don't really work as intended anymore. To fix
that, copy over the old perspective matrix and use that as base rather
than the current orthographic matrix.
It is quite a bit easier to reason about the conversion to device
coordinates when we actually have code that does that, instead of
implicitly assuming OpenGL handles it. Additionally, it means we don't
need to convert back to logical coordinates again when we're rounding
pixel values.
Rather than a perspective matrix, which is rather unexpected when coming
from something like QtQuick. Generally, when doing 2D you want an
orthographic matrix so Z values do not matter.
Apparently this was originally done for 3D effects, but there are only
two of those remaining (glide and sheet) and for those, the effects
themselves can set up a perspective projection matrix.
If we are using the software renderer
QQuickWindow::createTextureFromNativeObject returns null. We already
checking for kwin using GL compositing so we can expand to check
QtQuick's usage.
reconfigure is hooked up to a config watcher that is applicable on X11
and wayland.
A runtime check is added to reconfigure, if we're not initialised we
have nothing to reconfigure. initialise calls reconfigure at the end of
the method.
Since QPointF can have values that exceed INT_MAX, "distance <
minDistance" may not be triggered for the first output.
In order to make Workspace::outputAt() more robust to such extreme
cases, this patch changes the type of minDistance from int to qreal to
avoid truncation and adds an explicit check to initialize bestOutput
when we see the first workspace output.
It would be also great to add size hints sanitization code in kwin, but
it can be done later.
BUG: 460446
---
Should close:
* https://errors-eval.kde.org/organizations/kde/issues/321
* https://errors-eval.kde.org/organizations/kde/issues/341
When the slide effect paints a virtual desktop, it translates both
windows and the clip region.
Since the clip region slides too, the blur effect needs to be careful.
At the moment, the blur effect computes the blur region as follows:
- get the value of the blur region hint from client, map it to the
global coordinate space, and intersect it with the clip region
- apply translation and scale to the blur region
- pass the blur region to doBlur()
However, the translation transform must be applied before intersecting
the blur region with the clip region.
BUG: 460382
If the output is turned back on before m_turnOffTimer expires, the
dpms input event filter won't be reset and all input events will go to
the void.
BUG: 460322
AnimationEffect inherits from CrossfadeEffect as it may do a crossfade,
but it also has to perform non-crossfading activities with a custom
shader.
For crossfades we want to draw the old and new window, but this isn't
needed where the crossFadeProgress remains at 0.
BUG: 460277
Crossfade is now hanlded by regular scene painting, only by offscreen
effects. There is no need for scene code to have awareness and use a
more expensive shader.
In libinput 1.19, three new pointer axis events were added in order to
provide support for high-resolution scrolling.
LIBINPUT_EVENT_POINTER_AXIS is de-facto deprecated and new users of
libinput should use instead SCROLL_WHEEL, SCROLL_FINGER, and
SCROLL_CONTINUOUS.
Discrete deltas were replaced with v120 delta values. 120 corresponds to
a single discrete delta. Smaller values correspond to "partial" wheel
ticks.
https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/72
It's impossible to properly map EffectWindow::hasAlpha() to wayland
abstractions, where a window can have subsurfaces.
The main motivation behind this change is to move Window::hasAlpha() and
Window::depth() to X11Window.
At the moment, EffectWindow::hasAlpha() is used as a micro-optimization.
API and ABI breaking change in libkwineffects.
It's unnecessary on wayland and there's a bug in m_isDamaged
initialization. We need to set m_isDamaged to true otherwise
SurfaceItemX11 won't attempt to query the damage.
At the moment, the keyboard interception code in the effects system
relies on Qt code processing key events. However, since QDesktopWidget
is removed in Qt 6, this is a blocker for Qt 6 port.
This change ports the X11 backend to private xkb keymap as indicates in
the todo comment. It allows us to drop the last QDesktopWidget usage.
SlideDocks option was added after receiving negative feedback about
sliding docks. SlideBackground option was added to provide smooth
transition path for old users.
In hindsight, adding SlideDocks option was a mistake. It provides
excessive configurability in exchange for more code complexity.
With the virtual backend, it makes more sense to create outputs on
demand. It makes code clear, it would be also nice to use the virtual
backend for virtual outputs rather than have every backend implement its
own virtual outputs.
Qt 6 insists on this being exported, which in turns fails as this is
actually not implemented. There seemingly is an implementation, but that's
in a different namespace, so this can never have been used from the
outside anyway.
Currently, windows are not highlighted as expected in the window view
effect if the keyboard focus belongs to another screen view.
In general, it makes more sense to apply "Window.window.activeFocusItem"
constraint only to heap.selected.
With DamageReportNonEmpty damage report level, the x server will
send kwin a DamageNotify when the damage region changes from empty to
not empty.
The damage region will be made empty when SurfaceItemX11 calls
xcb_damage_subtract().
It appears like xcb_generate_id() can return us an already associated
XID, which eventually results in xcb_damage_subtract() failing and
breaking state tracking in SurfaceItemX11. KWin will no longer receive
DamageNotify events and some windows will freeze.
In order to make getting BadIdChoice less catastrophic, this change
makes the SurfaceItemX11 reset m_isDamaged after successfully fetching
the damage region. If xcb_generate_id() returns us a bad id, kwin will
try to fetch the damage again in the next frame.
BUG: 456511
It makes no sense to play the animation if the window is invisible. It
can also produce unexpected results if the window is not on current virtual
desktop as animate() will temporarily force the window to be visible.
If an invisible window is animated, e.g. minimized window, the maximize
effect will temporarily make it visible in order to play the animation,
which is unexpected.
Activities are loaded async. During this time any fetch of activity
information is incorrect as we will treat any settings as invalid.
We need to ignore attempts to set activities during this time, but also
refresh Window's concept of activities once we are loaded.
BUG: 438312
Display::outputsIntersecting() computes the logical geometry using the
oriented mode size and the scale factor, but OutputInterface's scale
factor is ceil()ed up, so the resulting logical geometry can be incorrect.
BUG: 459733
X/Y/Width/Height all get changed in the polish event so this only has
any effect in bindings before the first frame.
It seems this was leftover from development where we didn't have initial
values synced up properly.
This removes the "OpenGLIsUnsafe" flag and replaces it with a timestamp
that we can check to see how long ago we tried enabling compositing, so
we can retry it if a certain amount of time has elapsed.
BUG: 452344
The drm fd can get stuck in readable state, in which case the
QSocketNotifier will fire the activated signal as often as it can
leading to high cpu usage.
We need to read() the drm fd in order to make the socket notifier stop
firing QSocketNotifier::activated.
This change removes the m_platform->isActive() check to ensure that
drmHandleEvent() gets called, in general, it should be safe as we only
notify the outputs about completed pageflips.
BUG: 452726
With this change, when the specified output is disconnected, it will
just behave as if none were selected but when it's connected again it
will pick it back up.
BUG: 456857
QRect.contains(somePointF.toPoint()) will round the values.
This is problematic for the case of a mouse being at -0.4, we will
consider it in bounds for the screen, but obviously this doesn't match
any surfaces.
The detection and confineToBoundingBox need to behave the same and
floor.
BUG: 459328
Instead of InputMethod directly calling showClient() on the input panel,
call methods that properly show or hide the panel as needed, with readyForPainting
set appropriately. This removes the cases where it's shown without being ready for
painting, which causes crashes.
BUG: 459404
This makes kwin's behavior consistent with other wayland compositors
(sway, GNOME Shell, etc) and it's reasonable to provide all the
information about the data source before wl_data_device.enter. It also
makes Firefox happier.
Relevant discussion upstream: https://gitlab.freedesktop.org/wayland/wayland/-/issues/322
CCBUG: 445661
Window rules code can call maximize(requestedMaximizeMode()), in which
case the Window will emit clientMaximizedStateAboutToChange but the
maximize mode may not actually change.
This change moves the emission of of the clientMaximizedStateAboutToChange
signal to Window::changeMaximize(). The reason for doing so is that
window rules have the final decision what the maximize mode will be.
CCBUG: 459301
The last fix was not complete without registering the shortcut from the
start. It worked after changing it in system settings at runtime though.
Amends 984388dba4.
This may happen when all windows are minimized, and the effect was
started in "Window class on current desktop" mode (Ctrl+F7).
BUG: 459244
FIXED-IN: 5.26
KQuickAddons::ConfigModule sets the translation domain based on the plugin id
That is kcm_kwin_scripts. However the translation domain is kcm-kwin-scripts, which breaks loading translations
Also fix Messages.sh to extract from QML
BUG: 458438
The js code contains code such as
window.frameGeometry = {x: 42, y: 42, width: 100, height: 50};
However, QJSEngine doesn't know how to convert js object to QRect. For
that purpose, we need to register conversion functions.
So far, we kept registering converter functions only for integer based
geometry types, i.e. QRect, QSize and QPoint. In 5.26, Window was ported
to QRectF, QSizeF and QPointF, but the corresponding conversion helpers
were not added.
BUG: 459369
The desktopClient is a weak pointer and therefore can be null. This
makes sure that we are not calling a null instance of it.
It seems likely it was introduced here 45486ce515
This is a blind non-reproduced fix for the issue here:
https://errors-eval.kde.org/organizations/kde/issues/158/
Unlike D&D actions, this method does not return any feedback as to
whether an item drop was accepted by any other screen, and so whether it
is going through destruction process already, so the best we can do is
add another typeof/undefined check after calling that method.
Fixes the following error:
file:///usr/lib/qml/org/kde/kwin/private/effects/WindowHeapDelegate.qml:415:
TypeError: Cannot read property 'deleteDND' of undefined
DND was failing with the following error
file:///data/projects/usr/lib/qml/org/kde/kwin/private/effects/WindowHeap.qml:96: TypeError: Cannot read property 'mapToGlobal' of undefined
Change the render cycle for slide effect. Now, windows will be drawn on each desktop or not in the paintWindow() loop instead of the paintScreen() loop. This allows us to respect stacking order better by painting all of the same window together instead of per VD.
BUG: 457486
BUG: 458622
This special signal was designed to remove the need for such
bikesheddings and workarounds. Use it to react to user-driven changes.
BUG: 459202
FIXED-IN: 5.26
It is used in QML code, just like in windowview (Present Windows)
effect, but developers forgot to copy the implementation in C++
backend.
BUG: 459202
FIXED-IN: 5.26