Commit graph

26698 commits

Author SHA1 Message Date
Yifan Zhu
ea4fa87bc6 utils/xcbutils: Don't call toXNative with unsigned integer
Instead use signed integers, to prevent the implicit cast from unsigned
integers to qreal.

BUG: 482687
2024-03-08 19:25:39 +00:00
Xaver Hugl
b19426879f opengl/openglcontext: fix capitalization of isOpenGLES 2024-03-08 17:26:54 +00:00
Xaver Hugl
2f3b05e733 opengl: move "isOpenGLES" from eglutils to eglcontext and rename it
It's named in a confusing way and only used in eglcontext
2024-03-08 17:26:54 +00:00
Xaver Hugl
179af074eb opengl/glframebuffer: move s_fbos to OpenGlContext 2024-03-08 17:26:54 +00:00
Xaver Hugl
493797ff31 opengl: move extension function resolving and debug output into OpenGlContext 2024-03-08 17:26:54 +00:00
Xaver Hugl
7618be3697 opengl/glplatform: remove dependency on OpenGlContext 2024-03-08 17:26:54 +00:00
Xaver Hugl
605401dcfc opengl: move glsl version to OpenGlContext 2024-03-08 17:26:54 +00:00
Xaver Hugl
c5cd8d1318 port most uses of GLPlatform::isGLES to use OpenGlContext directly 2024-03-08 17:26:54 +00:00
Xaver Hugl
5aa2606f04 opengl/glplatform: remove GLPlatform::supports method
There's only one "feature" left, so the method for it can be used instead
2024-03-08 17:26:54 +00:00
Xaver Hugl
c41da588f6 opengl: move timer query detection to OpenGLContext 2024-03-08 17:26:54 +00:00
Xaver Hugl
568da29fbf opengl: move pack invert detection to OpenGlContext 2024-03-08 17:26:54 +00:00
Xaver Hugl
a8b9e8d262 opengl: remove most of glutils 2024-03-08 17:26:54 +00:00
Xaver Hugl
bb0d1fc45e opengl: move static vertex buffer variables to OpenGlContext 2024-03-08 17:26:54 +00:00
Xaver Hugl
f98477e05b opengl/glframebuffer: move static variables to OpenGlContext 2024-03-08 17:26:54 +00:00
Xaver Hugl
1b4a9abbe3 opengl/gltexture: remove all the static things
The static fbo is removed, and the rest is moved to OpenGlContext
2024-03-08 17:26:54 +00:00
Xaver Hugl
feeacf37db opengl: require support for fbos
It's effectively required already, as they're used everywhere
2024-03-08 17:26:54 +00:00
Xaver Hugl
e763cd9eec opengl: remove the global shadermanager instance 2024-03-08 17:26:54 +00:00
Xaver Hugl
1b21b08130 opengl: move shader manager getter to OpenGlContext 2024-03-08 17:26:54 +00:00
Nate Graham
7ff51ba47c Raise target mobile device DPI
A target mobile DPI of 135 is rather low and results in excessively
large scale factors, so everything is too big.. Let's raise it a
little bit to improve the default level of information density on
these devices that are designed to be held close to the face.

This has the effect of changing the calculated default scale factor for
the following devices:

| Device     | Device DPI | Old scale factor | New scale factor |
| ---------- | ---------- | ---------------- | ---------------- |
| Steam Deck | 204        | 1.5              | 1.25             |
| PinePhone  | 268        | 2.0              | 1.75             |
| OnePlus    | 388        | 3.0              | 2.5              |

Devices are taken from the autotest data found at
https://invent.kde.org/plasma/kscreen/-/blob/master/tests/kded/configs/AutogeneratedMobileScreenScales.json
2024-03-08 17:14:16 +00:00
Xaver Hugl
f3d9e5c90c backends/drm: handle dumb buffer target correctly
It's independent of the multi gpu import mode

BUG: 482859
2024-03-08 16:19:58 +00:00
Vlad Zahorodnii
9bf7c294a8 plugins/fadingpopups: Fix autohidden panels blinking when plasmashell launches
The autohidden panels "blink" because this effect animates their opacity.

The dock windows are animated because, as the comment says, the old effect
animated almost every window.

Conceptually, animating docks doesn't align with the purpose of this effect.
2024-03-08 16:07:36 +00:00
Nate Graham
a136a159f9 Allow harmless XWayland key snooping by default
Wayland has a design philosophy of prohibiting keyloggers, which is
sane. However X11 did not, and a lot of X11 apps were developed with the
expectation of being able to sniff keyboard events to handle global
shortcuts. When such apps are run in a Wayland session under XWayland,
these features break.

Historically we have prohibited this in the name of security. In Plasma
5.27, we gave users a KCM they can use to choose their preferred balance
of security and unbreaking XWayland apps with global shortcuts. But we
still defaulted to total 100% security, at the expense of breaking these
apps by default.

However today we have a compromise that unbreaks them 99% of the time
while not meaningfully reducing security: we can have KWin only prohibit
XWayland apps from reading alphanumeric key events that don't have a
modifier key pressed at the same time. This still prevents those apps
from acting as keyloggers and reading your password or all the text you
type, but does allow those apps that have a legitimate need to read key
events for global shortcuts do so, because global shortcuts will involve
modifier keys being held down.

Due to the way the security modes work, making this change will also
allow XWayland apps to read non-alphanumeric keystrokes without any
modifiers being held down, but that's also fine for security since you
can't use any of those keys to type text or passwords.
2024-03-08 15:51:41 +00:00
Łukasz Patron
f5cb109a87 xwayland: Disconnect xwaylandEavesdropsMouseChanged signal on finish
It appears that this was missed in 183637502d.
2024-03-08 11:57:10 +00:00
Vlad Zahorodnii
e2cbed7060 Port IdleDetector to QBasicTimer
QBasicTimer is lighter and it properly handles timeout values bigger
than INT32_MAX.

CCBUG: 482077
2024-03-08 13:12:09 +02:00
Vlad Zahorodnii
18e414443e Add timeout assert in IdleDetector
CCBUG: 482077
2024-03-08 11:09:42 +02:00
Patrik Fábián
40b8637ab8 xdgshellwindow: Always update window position and size along all axes when fully miximizing window
BUG: 482086
2024-03-08 08:33:56 +00:00
Nicolas Fella
7078f4e3af Fix sending window to all desktops
NET::OnAllDesktops is a special desktop number (-1), desktopForX11Id will not return a desktop for it

When all desktops are requested pass an empty desktop list, the following code will handle it appropriately

BUG: 482670
2024-03-08 08:21:29 +00:00
l10n daemon script
2103eb8d16 GIT_SILENT Sync po/docbooks with svn 2024-03-08 01:20:07 +00:00
Nate Graham
7992d01fbd kcms/effects: add keywords for newly-introduced cursor effects
BUG: 482607
FIXED-IN: 6.1
2024-03-07 10:35:25 -07:00
Vlad Zahorodnii
b674b458df Rename Workspace::updateClientArea as Workspace::rearrange
We need to re-arrange layer shell surfaces, compute new struts and adjust
the windows in a single step.

Workspace::updateClientArea() is the best candidate for that, so this change
repurposes that function from computing work areas to a generic relayouting
function.

CCBUG: 482361
2024-03-07 13:41:02 +02:00
Vlad Zahorodnii
a489bfa12c wayland: Fix windows shrinking when output layout changes
When the output layout changes, the Workspace is going to update the
struts and then go through every window and see whether it should be
moved or resized.

On the other hand, the layer shell windows react to output changes on
a timer. Furthermore, it's not synchronized with the workspace rearranging
the managed windows. It means that when Workspace::desktopResized() runs,
the panel struts can be slightly outdated, i.e.

- An output layout change occurs
- Workspace::desktopResized() is called but the struts can be wrong
- some time later, LayerShellV1Integration::rearrange is called, it
  fixes layer shell window geometries and struts
- after the layer shell integration has finished rearranging the
  layer shell windows, it calls Workspace::desktopResized(), but the
  damage had already been caused

With the proposed change, the Workspace and the LayerShellV1Integration
will rearrange the windows in sync.

CCBUG: 482361
2024-03-07 13:41:01 +02:00
Mouse Zhang
9ca738ffec Add .directory to .gitignore 2024-03-07 17:20:53 +08:00
Mouse Zhang
769c63c834 plugins/backgroundcontrast: remove dolphin directory file 2024-03-07 17:17:36 +08:00
l10n daemon script
5401d6c213 GIT_SILENT Sync po/docbooks with svn 2024-03-07 01:19:27 +00:00
l10n daemon script
34545553b2 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2024-03-07 01:13:03 +00:00
Xaver Hugl
e4349536a3 backends/drm: also set legacy gamma after VT switches
Just like with modes, the gamma state is unknown after VT switches, and has
to be explicitly set again to ensure it's correct
2024-03-07 01:50:43 +01:00
Xaver Hugl
d1bc39a6ea backends/drm: don't set gamma with legacy unless really necessary
It seems to have a pretty large performance impact
2024-03-07 01:50:43 +01:00
Xaver Hugl
568f9fb666 backends/drm: ignore ctm support on legacy
BUG: 482143
2024-03-07 01:50:20 +01:00
Xaver Hugl
4a42829841 backends/drm: move tracking of legacy direct scanout presentation to DrmPipeline
The behavior between direct scanout and normal presentation being different is an
implementation detail of DrmPipeline, the output layers shouldn't need to care
2024-03-06 21:42:26 +01:00
Aleix Pol
1d57c9a5af effects: Use chrono to specify the animation times
Makes both the API and its uses explicit in terms of what unit the times
are on.
2024-03-06 10:19:55 +00:00
Vlad Zahorodnii
f82542790c plugins/shakecursor: Enable by default
Multi monitor setups with 4K screens are not uncommon and one of the
annoyances associated with such setups is that you lose the track
of the cursor sometimes. It's natural to shake the cursor in such
occasions.

This change enables the shake cursor effect to improve the desktop
experience. One potential risk associated with doing so is that the cursor
can be magnified in some undesired situations. It is true. But we took a
great precaution of that and added some heuristics to avoid triggering the
effect in such cases given all the data we have available.
2024-03-05 21:32:35 +00:00
Vlad Zahorodnii
dcd20922d9 plugins/shakedetector: Optimize ShakeDetector
Only store one history item for movement in the same direction.
With this optimization I measure m_history.size() <= 15 for all kinds of
movements, including back and forth, and circular.
2024-03-05 18:30:51 +00:00
Vlad Zahorodnii
0bc60023f5 plugins/shakecursor: Prefer operator[] over at()
Bounds checks are redundant. Plus kwin is built with exceptions disabled.
2024-03-05 17:38:14 +00:00
Vlad Zahorodnii
2ad896c71d plugins/shakecursor: Make the cursor big enough upon the first shake
The current behavior is that the cursor size follows how hard or fast
the cursor is shaken. While this looks fancy, given the purpose of this
plugin, it should be possible to magnify the cursor as easy as possible
without interfering or false triggering.

This change implements a sort of a compromise. When the cursor is shaken
for the first time, the cursor is magnified by some certain scale factor.
Then every next shake magnifies the cursor further by a smaller amount.
2024-03-05 18:34:30 +02:00
Vlad Zahorodnii
8736e44e1a effect: Fix EffectWindow::contentsRect()
It should specify the client rect inside the frame.

2556378dfa incorrectly assumed that the
buffer geometry includes the decoration.

BUG: 482294
2024-03-05 13:34:35 +00:00
Vlad Zahorodnii
bfd755aee9 Fix confined pointer being able to escape the surface
When using fractional scaling, an xwayland window's client geometry can
have some fractional part. When that's the case, .toRect() can shrink the
client geometry or extruding the decoration borders inside the surface.

On the other hand, the pointer is going to be confined as long as the
wl_surface is focused. If the focus jumps to the decoration, the pointer
constraint is going to be broken. Unfortunately, the focus can shift to
the decoration even though the wl_surface is still focused because of the
pesky .toRect().

BUG: 482448
CCBUG: 477124
2024-03-05 13:23:59 +00:00
Vlad Zahorodnii
0c8b3251e5 examples: Fix License metadata 2024-03-05 11:02:37 +00:00
l10n daemon script
2b8b53a105 GIT_SILENT Sync po/docbooks with svn 2024-03-05 01:20:02 +00:00
l10n daemon script
a33fe84f57 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2024-03-05 01:14:33 +00:00
Dominique Hummel
d0a6bd3404 effects/windowview: use correct enum value for PointerDevice
BUG: 482191
2024-03-04 23:14:55 +00:00