Commit graph

17224 commits

Author SHA1 Message Date
Roman Gilg
a39c74059e Remove BasicScreens class
Summary:
After porting all platforms to using AbstractOutput the BasicScreens
class is not needed anymore.

Test Plan: Compiles

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Maniphest Tasks: T11098

Differential Revision: https://phabricator.kde.org/D21800
2019-06-14 14:22:29 +02:00
Roman Gilg
6ac1585e12 Fix xdg-output creation
In 1a11abc821 some function calls in the createXdgOutput function were
accidentally removed resulting in possibility of broken setup on startup.

Add these calls back again.
2019-06-14 12:10:28 +02:00
Laurent Montel
6df7b2e863 Use new logging category directory when ECM>=5.59 2019-06-13 13:31:51 +02:00
Roman Gilg
1a11abc821 [platforms/x11/standalone] Port to AbstractOutput
Summary:
Represent outputs in the X11 session via AbstractOutput. For that we
move all Wayland specific parts of AbstractOutput into a new subclass
AbstractWaylandOutput and let the outputs of our Wayland backends inherit
from there.

This should allow us to get rid of the Screens class later on.

Test Plan: Manually in X session.

Reviewers: #kwin, zzag, davidedmundson

Reviewed By: #kwin, zzag, davidedmundson

Subscribers: ngraham, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19208
2019-06-13 11:39:25 +02:00
Roman Gilg
8040c559cb [platforms/x11/windowed] Port to AbstractOutput
Summary:
To homogenize our backends and as another step to remove the Screens class
use the AbstractOutput class in the windowed X11 backend.

Test Plan: Manually in X session.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: davidedmundson, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19207
2019-06-13 11:27:59 +02:00
Alexander Potashev
29e4ca26a6 Merge branch 'Plasma/5.16' 2019-06-12 12:58:28 +03:00
Yuri Chornoivan
b24aa90af7 Really use the translations. Patch by Victor Ryzhykh <victorr2007@yandex.ru> 2019-06-12 12:57:29 +03:00
Gabriel Felipe Huwe
92d482b331 [effects/screenshot] Remove outdated reference to KSnapshot
Summary:
Since KSnapshot is no longer used, I modified the text in `effect_builtins.cpp` to reflect that, changing it to a generic "screenshot tools".

BUG: 408407
FIXED-IN: 5.17.0

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: filipf, davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21700
2019-06-10 08:48:19 -06:00
l10n daemon script
d3f1078c94 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"
2019-06-09 08:29:13 +02:00
l10n daemon script
e4ba37109f 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"
2019-06-09 05:13:32 +02:00
Roman Gilg
2c088894b4 [autotests] Fix decoration input test
Since d51b8dc093 the test fails on CI, apparently because we test with
Breeze default settings, which is no borders now and we can move a bit into
the window geometry and still be on the border if borders exist, otherwise
not.

For now fix it by checking if there are borders or not and then test
accordingly. But long-term we should test both cases and besides not rely on
external decorations for our test, instead use a fake specific for our
integration testing.
2019-06-07 14:48:45 +02:00
Roman Gilg
846961bfae Delayed focus updates for Toplevels without surface
Summary:
XWayland clients have a surface associated with them asynchronously. In this
case we don't directly want to set focus on this Toplevel, but wait until the
surface is set.

This patch aims in conjunction with an unrelated fix to SDL at improving Steam
Big Picture Mode in our Wayland session.

Test Plan: Steam BPM regains focus on game close.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: anthonyfieroni, davidedmundson, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19262
2019-06-06 23:34:49 +02:00
Roman Gilg
2e20cac5e2 [platforms/fbdev] Port to AbstractOutput
Summary:
To homogenize our backends and as another step to remove the Screens class
use the AbstractOutput class in the framebuffer backend.

Test Plan: Manually on VT enforcing the framebuffer backend.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19199
2019-06-06 22:36:40 +02:00
Roman Gilg
d3ad6bc0b9 kconfig_update for auto border size introduction
Summary:
If a user has set his border size explicitly in the past also respect this
selection with the new auto border size mode by setting auto borders to
false on update.

For this a kconf_update file and a sed based shell script is added.

Test Plan: Manually.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: zzag, davidedmundson, kwin

Tags: #kwin

Maniphest Tasks: T8707

Differential Revision: https://phabricator.kde.org/D13480
2019-06-06 22:27:00 +02:00
Roman Gilg
d51b8dc093 [decorations] Let KDecoration plugins recommend a border size per default
Summary:
This is an alternative solution to T8707 and in comparision to D13276 a less
drastic change to KWin's default behavior.

Instead of changing the border size default for all KDecoration plugins by
switching the default from border size Normal to None introduce new
functionality, which allows a KDecoration plugin to recommend a border size in
its metadata. By default KWin listens for these recommendations and sets the
border size accordingly.

If there is no metadata recommending a border size, KWin falls back to the
current setting of Normal sized borders.

A user is able to override the recommendations from the KCM, which has been
extended accordingly.

Test Plan: Manually with adjusted metadata of Breeze.

Reviewers: #kwin, #plasma, #vdg, ngraham

Reviewed By: #vdg, ngraham

Subscribers: hpereiradacosta, filipf, anemeth, davidedmundson, abetts, graesslin, ngraham, zzag, kwin

Tags: #kwin

Maniphest Tasks: T8707

Differential Revision: https://phabricator.kde.org/D13284
2019-06-06 22:24:45 +02:00
Jonathan Riddell
97532b3b1f Update version number for 5.16.0
GIT_SILENT
2019-06-06 12:03:01 +01:00
Roman Gilg
82b9d3b59e Merge branch 'Plasma/5.16' 2019-06-05 16:47:34 +02:00
Roman Gilg
7c7fb758ad Avoid again invalid geometry of internal clients
Summary:
This adds again the workaround from 1fb2eace3f, which got temporarily
removed by 9b922f8833.

BUG: 386304

Test Plan: Manually

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21601
2019-06-05 16:40:12 +02:00
l10n daemon script
1b8e5061ab 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"
2019-05-31 08:34:35 +02:00
l10n daemon script
c62650394f 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"
2019-05-31 05:14:47 +02:00
Aleix Pol
cd7fae95a4 Forward and log exit code of the nested process
Summary: Otherwise it's hard to tell if it failed.

Test Plan: Found out that my session was crashing.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21465
2019-05-29 17:00:44 +02:00
Yuri Chornoivan
835f3dfde9 Really use the translations. Patch by Victor Ryzhykh <victorr2007@yandex.ru> 2019-05-29 15:16:04 +03:00
Vlad Zagorodniy
fe27847025 Merge branch 'Plasma/5.16' 2019-05-27 17:31:47 +03:00
Vlad Zagorodniy
4ece0a9f40 Merge branch 'Plasma/5.12' into Plasma/5.16 2019-05-27 17:31:10 +03:00
Vlad Zagorodniy
67444e3659 [effects/screenshot] Upload data to xpixmap in chunks
Summary:
xcb_put_image doesn't handle big images well. Contrary to XPutImage, the
caller must manually split the data in such a way that each xcb_put_image
request doesn't exceed the maximum request length. Not doing so will result
in libxcb shutting down the connection.

CCBUG: 338489
CCBUG: 388182

Test Plan: Take a screenshot of an active fullscreen client on a 4K monitor.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21370
2019-05-27 17:30:21 +03:00
Vlad Zagorodniy
4bbef8d128 [scripting] Emit clientAdded for Wayland clients
Summary:
Currently, if a script relies on clientAdded to setup some required
connections, then it probably won't work with Wayland clients because
clientAdded is emitted only for X11 clients.

Test Plan:
* Installed sticky window snapping script, it works;
* Installed a couple of tiling scripts, with some small changes, they work.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: strobach, TomButler, davidedmundson, mart, graesslin, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D17097
2019-05-24 00:27:32 +03:00
Vlad Zagorodniy
689d89ae4e [scripting] Port the remaining bits of API to AbstractClient
Currently, clientArea(ClientAreaOption, const Client *) and clientList()
are quite X11-specific, which results in having some tiling scripts not
working with Wayland clients. This change is the first step towards working
tiling scripts in the Wayland session.
2019-05-24 00:27:11 +03:00
Nate Graham
1516595742 [kcmkwin/touchscreen+screenedges] Call KRunner KRunner
Summary:
In the context of the Touch Screen and Screen Edges KCM, using the term "Run Command" to
refer to KWin is inaccurate and misleading. By using a string that starts with an action
verb and no ellipses, it is suggested that the action is literally to run some command,
prompting the user to think "which command will it run? How do I choose what it is?"

This patch changes the action text to "Show KRunner" which is the proposed new standard.

See {T10966} for more information and reasons why to do this.

Test Plan:
{F6842531}

{F6842530}

Reviewers: #vdg, #kwin, ndavis

Reviewed By: #vdg, ndavis

Subscribers: ndavis, davidedmundson, kwin

Tags: #kwin

Maniphest Tasks: T10966

Differential Revision: https://phabricator.kde.org/D21342
2019-05-22 12:18:29 -06:00
Vlad Zagorodniy
2cff5cb70a [tabbox] Properly determine depressed modifiers on X11
Summary:
A keysym can be assigned to several keycodes, so more proper way to
determine whether given modifier is depressed is to iterate over all
returned keycodes and see if any is pressed.

If we check only the first keycode, then alternative mappings may not
work, e.g. alt key mapped to win, etc.

BUG: 407720

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21302
2019-05-21 15:43:10 +03:00
Antonio Rojas
f59f8ffcf7 Merge branch 'Plasma/5.16' 2019-05-17 18:57:11 +02:00
Antonio Rojas
94d2fea23a Move knsrc files to the new location
Instead of the old legacy /etc/xdg location

Differential Revision: https://phabricator.kde.org/D21254
2019-05-17 18:56:27 +02:00
Nate Graham
1b9eaa62c2 Revert "Revert "Handle XdgShell window geometry in configure request sizes""
Plasma 5.16 has branched, and support is now in Frameworks with
https://cgit.kde.org/kwayland.git/commit/?id=6da6c7c7e090c024a8288088f9b96ef2bacf38a5,
So this can go into KWin master now.

This reverts commit 24cbe48656.
2019-05-17 08:13:54 -06:00
Vlad Zagorodniy
7f593a67ad Send axis_source, axis_discrete, and axis_stop
Summary:
So far KWin didn't send axis_source, axis_discrete, and axis_stop. Even
though most of those events are optional, clients need them to work as
expected. For example, one needs axis_source and axis_stop to implement
kinetic scrolling; Xwayland needs axis_discrete to prevent multiple
scroll events when the compositor sends axis deltas greater than 10, etc.

BUG: 404152
FIXED-IN: 5.17.0

Test Plan:
* Content of a webpage in Firefox is moved by one line per each mouse
  wheel "click";
* Scrolled gedit using 2 fingers on GNOME Shell, sway, and KDE Plasma;
  in all three cases wayland debug looked the same (except diagonal scroll
  motions).

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19000
2019-05-17 12:06:10 +03:00
Vlad Zagorodniy
81cdfd2ebf Keep internal clients in the unmanaged layer
Summary:
All internal clients live in the x stacking order, but when such a
client is closed, it will be moved to the normal stacking order.

Given that internal clients don't specify the desired layer, they will
be moved to the normal layer, which is not really what we want because
it means that the task switcher window will be placed below docks.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21116
2019-05-17 11:45:19 +03:00
Jonathan Riddell
b00f1fccce Update version number for 5.16.80
GIT_SILENT
2019-05-16 14:17:35 +01:00
Jonathan Riddell
7c1a7c35f3 Update version number for 5.15.90
GIT_SILENT
2019-05-16 11:00:42 +01:00
Jonathan Riddell
0c67056708 bump Qt version to 5.12 as agreed at start of cycle 2019-05-16 10:13:14 +01:00
Vlad Zagorodniy
d94eb29d07 [effects/thumbnailaside] Specify screen projection matrix
Summary:
The Lanczos filter is applied to thumbnails, so we need to specify screen
projection matrix in order to properly project window coordinates into
screen-space.

BUG: 407485

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21224
2019-05-15 12:35:00 +03:00
Vlad Zagorodniy
67b2746ecd Compute correct boundaries in checkWorkspacePosition
Summary:
When a client sets a strut, checkWorkspacePosition will be called to
bump clients that touch corresponding screen edge.

In order to do that, checkWorkspacePosition needs to calculate client
boundaries before and after the restricted move area was changed. As it
turns out, if the client reserves space "between" screens, calculated
boundaries can be incorrect, which may lead to some funky results, e.g.
shrunken clients.

For example, let's say that there is a dual-monitor setup. If a client
reserves some amount of space at the right border of the left screen,
then clients on the right monitor will have rightMax which is equal to
the x coordinate of screenArea.

To fix that, this change ensures that only restricted areas belonging
to the same screen as the client are taken into account when computing
the boundaries.

BUG: 404837
BUG: 406573

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20987
2019-05-15 11:07:14 +03:00
Vlad Zagorodniy
0aa288bfae Port away from deprecated qFind
Test Plan: Compiles, the number of compiler warnings has been reduced from 990 to 202.

Reviewers: #kwin, apol, davidedmundson

Reviewed By: #kwin, apol, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21217
2019-05-15 11:03:29 +03:00
David Edmundson
24cbe48656 Revert "Handle XdgShell window geometry in configure request sizes"
This reverts commit bc83065ceb.

Turns out the relevant wayland code wasn't merged. This will have to
wait till next plasma for a fix.
2019-05-10 21:43:08 +01:00
David Edmundson
bc83065ceb Handle XdgShell window geometry in configure request sizes
Summary:
The size passed to an XDG shell configure request should match the
window size of the given window, we don't want to include the size of
any shadows that may be drawn by the client.

Kwin has the same concept of geometry for both window management, input
and rendering.

In order to approach this in a way that does not risk any regressions
with kwin's current structure AbstractClient::geometry remains the
canonical source and we handle the window within that internally within
ShellClient treating the windowGeometry as a set of margins from this.

This is part of a much bigger task (T10867). This patch addresses
windows growing when starting a drag based resize.

BUG: 403376

Test Plan:
Unit test
gtk3-demo

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20937
2019-05-10 16:34:43 +01:00
David Edmundson
ce1a5eae15 Support NET_WM_STATE_FOCUSED
Summary:
This is used by GTK clients to know whether to draw as though they have
focus or not. Whilst it's most visible for CSDs headers, use of the
active/inactive palette (or backdrop class in GTK terms) applies
everywhere.

Rationale of the flag is to allow the WM to hint visual states without
giving input, i.e so you can hint that the parent of a modal dialog
should be shown as active. Though kwin only sets it on the truly active
window to match the behaviour our other windows follow.

BUG: 398832

I expect this to be potentially controversial as it's new code in X11,
so in advance:

* Unlike GTK_FRAME_EXTENTS, it is part of the specificiation (albeit
1.4) even i3 supports it.

* It does fix a real world issue

* It's only 2 lines (plus trivial boiler plate in kwindowsystem)

* It's in code path that we rely on for our existing code

* If there's a situation where this does break, the worst that will
happen is a client gets a visual hint to have focus incorrectly, which
ultimately is the same as the current state

Test Plan:
Used my CSS for breeze-gtk
moved between windows

Reviewers: #kwin, rooty, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, ognarb, ngraham, rooty, graesslin, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19613
2019-05-10 15:32:55 +01:00
Harald Sitter
988ca97c96 Update kf5 version requirement to 5.58.0
GIT_SILENT
2019-05-09 15:09:32 +02:00
Fabian Vogt
7804eb41d9 Fix crash due to dangling reference
Summary:
Returning a reference to a value on the stack is broken.
This caused kwin_wayland to crash in openQA with a nullptr deref.

BUG: 407199

Test Plan: Only build tested.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21085
2019-05-08 19:15:05 +02:00
l10n daemon script
ee60653640 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"
2019-05-08 05:51:51 +02:00
Vlad Zagorodniy
e8b45cce11 [effects/cubeslide] Cancel active animation when number of desktops has changed
Summary:
If a virtual desktop is removed, then desktopChanged will be followed by
numberDesktopsChanged signal. In which case, we have to cancel the
active animation because front_desktop might be no longer valid when
it's time to perform compositing.

BUG: 406452

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21064
2019-05-07 15:13:09 +03:00
Vlad Zagorodniy
c438ecbb70 Don't crash when highlighted tabbox client is closed
Summary:
The compositor tries to switch to the next tabbox client when currently
highlighted client is closed. Though there is a small issue with that.
Because the switch happens too late, a dangling pointer can be inserted
into the unconstrained stacking order, which can lead to a crash later on.

There are two cases:
- compositing is on;
- compositing is off.

Compositing is on: TabBox will try to un-elevate currently highlighted
client, though by that time the client no longer owns EffectWindow, so
this is basically a no-op (that's why we haven't experienced this bug
before).

Compositing is off: TabBox will try to restack currently hightlighted
client under the next tabbox client. Given that the restack method
doesn't do any sanity checks(see Client::manage why), a client that is
about to be destroyed will be re-inserted back into the unconstrained
stacking order.

This change ensures that the switch happens before currently highlighted
client is removed from the stacking order.

BUG: 406784

Test Plan:
- Turn off compositing;
- Follow steps to reproduce in the bug report (see comment 2).

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20916
2019-05-03 21:25:13 +03:00
Vlad Zagorodniy
0fb09cf413 Make session loading/saving helpers local to sm.cpp
Summary:
There is no point for keeping them in the Workspace class because they
are used only in sm.cpp.

Test Plan: Compiles.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20783
2019-05-03 21:24:07 +03:00
Nate Graham
48cacae8cf [kcmkwin/kwindecoration] Refine drag-and-drop button UI
Summary:
- Reduce the fake titlebar's height so it matches the real titlebar a bit better
- Reduce background opacity while dropping button to diminish visual noise
- Increase label size
- Re-word label for greater clarity
- Remove redundant icon (the text is enough)

BUG: 407109
FIXED-IN: 5.16.0

Test Plan: {F6804068, size=full}

Reviewers: #vdg, #kwin, GB_2, davidedmundson

Reviewed By: #vdg, #kwin, GB_2, davidedmundson

Subscribers: GB_2, abetts, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20968
2019-05-02 17:07:22 -06:00