Commit graph

2917 commits

Author SHA1 Message Date
Ismael Asensio
8b9472e0bf [kcm/kwinrules] Fix types property for NET::AllTypesMask
When the user selects all of the types or none of them, the "types"
property must be set to a special value (`NET::AllTypesMask = -1`),
different than the sum of all the flags together.

This re-implements this behaviour as the old KCM, fixing some heuristics
that prevented finding the rule corresponding to the current window.

The enum name that handles this property has been changed to `NetTypes`
to make it more explicit.

BUG: 423214
FIXED-IN: 5.19.3

TEST PLAN:
1. Open the `Application specific settings` on a window via menu
2. Select every "Window Type" (or none of them)
3. Give the rule a different name than the default and save
4. Open it again and check that the same rule is found
2020-06-25 15:44:11 +00:00
Ismael Asensio
3bfc750a79 [kcm/kwinrules] Fix detection of wmclass property
Property `wmclass` of a window rule works in a special way, as it can have
two meanings depending on `wmclasscomplete` flag:
- false: only matches `resourceClass`
- true: matches `resourceName` and `resourceClass`

This MR fixes two subtle bugs when detecting the properties of a window:

In the first case, `resourceName` was being wrongly set instead, which
prevented window matching for windows where those two values differ.

Also, the `wmclass` field was always set to `resourceName` independently
of `wmclasscomplete` property.

BUG: 423138
FIXED-IN: 5.19.3
2020-06-24 18:13:42 +00:00
Cyril Rossi
170741c499 KCM KWin Decoration : kcfgc File attribute should point to kcfg file
BUG: 423398
FIXED-IN: 5.19.3
2020-06-24 09:48:40 +02:00
Benjamin Port
a8979aa4e4 KCM Compositing: Fix save state
use settings objects to track state instead of a class member that will need to be synchronized.

BUG: 423223
2020-06-22 09:24:11 +02:00
Méven Car
396a9da557 KCMoptions: delay initialization after QObject creation in standalone
BUG: 423111
FIXED-IN: 5.19.2
2020-06-18 12:15:18 +02:00
l10n daemon script
430ca2a33e 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"
2020-06-18 08:32:20 +02:00
l10n daemon script
8027ccd6d6 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"
2020-06-17 16:54:45 +02:00
l10n daemon script
ce5b9c3612 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"
2020-06-11 09:38:33 +02:00
Ismael Asensio
e307038f84 [kcm/kwinrules] Fix slow scrolling through rules list
Every `AbstractItemDelegate` was instantiating a `Kirigami.ActionToolBar`,
which is a very expensive component, rising CPU usage specially on long lists.

Use `Kirigami.SwipeListItem` instead, as is seems the proper component.

BUG: 421537
2020-06-10 21:29:08 +00:00
l10n daemon script
f18deb69f1 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"
2020-06-09 09:19:42 +02:00
Shubham Jangra
48a5bfee0f [KCM] Fix label in Screen Edges system settings 2020-06-03 20:37:07 +05:30
l10n daemon script
051cba15ce 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"
2020-06-02 09:11:06 +02:00
Ismael Asensio
0a06ee12c6 [kcm/kwinrules] Fix "window role" combo not showing up
Correctly set the policy of `windowrole` property to `StringMatch`.

BUG: 422302
FIXED-IN: 5.19
2020-06-01 20:23:40 +02:00
l10n daemon script
a3139650a7 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"
2020-05-31 14:23:06 +02:00
Ismael Asensio
623ee1011c [kcm/kwinrules] Fix first item position on property list
The first time the list in `Add properties` is shown, the position of the first
delegate is miscalculated as (0, 0) and gets hidden behind the section header.
It only repositions when the delegate is destroyed and re-created, for example, when
setting and deleting a filter text. (https://bugs.kde.org/show_bug.cgi?id=422289)

This works-around it by delaying the `overlayModel` filtering until the list is first
shown, which makes the delegate position correctly.

BUG: 421583
FIXED-IN: 5.19
2020-05-31 10:54:28 +00:00
Ismael Asensio
91eee99fca [kcm/kwinrules] Extend upper limit of position and size spinners
Currently, the spinners used to edit position and size rules have an upper
limit of 4098, which may be not enough for wide/hdpi/mutiple screens.

The property itself has no such limit in the `.kcfg` schema
This is just an issue with the editor.

BUG: 421892
FIXED-IN: 5.19
2020-05-22 16:03:32 +02:00
Ismael Asensio
bd5e34f5b4 [kcm/kwinrules] Detect virtual desktops in Wayland
The list of virtual desktops is retrieved using a DBus method, instead of
`KWindowSystem`, to make it work both in Wayland (as well as X11).

FIXED-IN: 5.20
BUG: 416165
2020-05-19 00:49:15 +02:00
Ismael Asensio
fdd9ed53d9 [kcm/kwinrules] Fix Placement setting
Summary:
Since the port to KConfigXT, the setting "placement" is stored using the enum value, instead of a string equivalent.
This updates the kcm model to be able to communicate this property with the config schema.

BUG: 421586
FIXED-IN: 5.19.0

Test Plan:
- In a rule set the "Initial Placement" property
- The value is stored in `~/.config/kwinrulesrc`
- Close/reopen the kcm. The placement value is correctly loaded.

Reviewers: #kwin, #plasma, zzag

Reviewed By: #kwin, #plasma, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29790
2020-05-18 20:27:59 +02:00
Ismael Asensio
db7fb26eed [kcm/kwinrules] Fix size properties not being stored
Summary:
Use `QSize`/`QPoint` to handle and store coordinate values (size and position)

Previously, the rules model stored the "coordinate" type properties as a
`QString` with format `x, y`.

This fails when setting the properties to the config schema, as it requires
a proper `QPoint` or `QSize` value, specially the latter which can't be
convert from such a string.

BUG: 421055
FIXED-IN: 5.19.0

Test Plan:
- Add a new rule and set its position and size properties
- Hitting apply stores the right values in `~\.config\kwinrulesrc`
- Close the kcm and reopen, the values are loaded
- Property detection still works for size and position

Please note that there is a pre-existing bug of some position/sizes not being
applied to the windows in some cases, when using `Apply Initially`.
Better try using the `Force` policy.

Reviewers: ngraham, #kwin, #plasma, zzag

Reviewed By: #kwin, #plasma, zzag

Subscribers: zzag, ltoscano, yurchor, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29764
2020-05-15 19:45:11 +02:00
Ismael Asensio
973957127d [kcm/kwinrules] Fix placeholder message in RulesEditor
Summary:
Fix the anchoring of the placeholder message after https://phabricator.kde.org/R108:9e5498238f88ece28f4f0d22da00879280cb7955
It needs to center on the free space, not the whole ListView.

Test Plan
Before: {F8323417}
After: {F8323416}

Reviewers: ngraham, broulik, #vdg, #plasma

Reviewed By: ngraham, #vdg

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29783
2020-05-15 19:44:43 +02:00
Vlad Zahorodnii
a68c0959a6 Revert "Improve partial maximization strings"
Summary:
This reverts commit 45bf53adab.

We cannot change config values for existing users since it will break
their installations.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, bshah, broulik, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29736
2020-05-14 12:46:40 +03:00
Nate Graham
45bf53adab Improve partial maximization strings
Summary:
e.g. "Vertically maximize" is more natural and expressive than "Maximize (vertical only)"

See D29671#inline-169882.

Test Plan: New strings appear in the KCM

Reviewers: zzag, #vdg, #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29729
2020-05-13 12:31:02 -06:00
Vlad Zahorodnii
88c4de60fd [kcmkwin/kwinoptions] Use text to describe maximize button actions
Summary:
Currently, we use icons to display possible maximize button actions. The
problem with those icons is that they are confusing even for me, a person
who knows kwin in and out. The size_all icon implies that if you click the
maximize button, you'll be able to move the window around. Same goes with
the size_ver and size_hor icons, they indicate that user will start
resizing the window in the vertical and horizontal direction, respectively.

Test Plan:
Before

{F8312394}

After

{F8312395}

Reviewers: #kwin, #vdg, ndavis

Reviewed By: #vdg, ndavis

Subscribers: ngraham, ndavis, broulik, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29671
2020-05-13 09:23:36 +03:00
Nate Graham
9e5498238f [kcmkwin/kwinrules] Set saner width for Placeholder messages so they don't overflow
See D29692
2020-05-12 14:12:04 -06:00
Kai Uwe Broulik
65f611f700 [kcmkwin/kwinrules] Change translation domain
Make it consistently kcm_kwinrules to match the KAboutData

Differential Revision: https://phabricator.kde.org/D29674
2020-05-12 10:58:30 +02:00
Vlad Zahorodnii
e19fa3d5c2 [kcmkwin/kwinoptions] Fix default for MaximizeButtonRightClickCommand
Summary:
KWin assumes that the default value for MaximizeButtonRightClickCommand
is Maximize (horizontal only).

Reviewers: #kwin, broulik

Reviewed By: broulik

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29673
2020-05-12 11:32:46 +03:00
l10n daemon script
a35792e59d 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"
2020-05-12 06:33:43 +02:00
Ismael Asensio
471554b7a3 [kcm/kwinrules] Fix layout misalignment of list items
Summary:
Remove anchors within `Kirigami.AbstractListItem` delegates.
They were causing random misalignment of items in the main and the overlay `ListView`s

Test Plan:
Before {F8284332}
After {F8284333}

Reviewers: broulik, #vdg, #kwin, ngraham

Reviewed By: #vdg, ngraham

Subscribers: ahiemstra, ngraham, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29423
2020-05-06 20:22:25 +02:00
Kai Uwe Broulik
760765ed52 Merge branch 'Plasma/5.18' 2020-05-06 15:15:42 +02:00
Kai Uwe Broulik
5ea54eda5d [kcmkwin/kwindecoration] Don't exec() QDialog
Using nested event loops with QML is always troublesome.

BUG: 421053
FIXED-IN: 5.18.6

Differential Revision: https://phabricator.kde.org/D29473
2020-05-06 15:15:03 +02:00
Yuri Chornoivan
d5e5e2f1c7 Fix message extraction 2020-05-04 18:09:13 +03:00
Ismael Asensio
1a3cb256d7 [kcm/kwinrules] Improve export buttons
Summary:
Small UX improvements when exporting rules

Add a `Select All` button
Disable `Save` if no rules are selected
In export mode set button text to `Cancel Export`

Test Plan: {F8276279}

Reviewers: #kwin, #vdg, filipf

Reviewed By: #vdg, filipf

Subscribers: filipf, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29341
2020-05-02 19:43:02 +02:00
Laurent Montel
86cbf73386 Fix compile with strict iterator 2020-05-01 13:02:39 +02:00
l10n daemon script
f579dc339c 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"
2020-04-29 10:52:05 +02:00
Yuri Chornoivan
385c8d3db6 Make the string translatable
Summary:
Currently this string is marked as untranslatable for the unknown reason

Patch by Victor Ryzhykh

Test Plan: Translate, run.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29271
2020-04-29 09:34:53 +03:00
l10n daemon script
34de0b746e 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"
2020-04-29 06:38:00 +02:00
Andreas Sturmlechner
1e70f08093 kwinscreenedges: Fix build (missing main.ui in kcm_kwintouchscreenedges_PART_SRCS)
Summary: kwinscreenedgeconfigform.cpp:23:10: fatal error: ui_main.h: No such file or directory

Test Plan: kwin builds again.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29212
2020-04-26 20:16:54 +02:00
Nate Graham
f9faa94ccc [kcmkwin/kwinrules] Port placeholder message to Kirigami.PlaceholderMessage
Summary: Depends on D29152

Test Plan:
{F8256396}

{F8257685}

Reviewers: iasensio, #kwin, zzag

Reviewed By: iasensio, #kwin, zzag

Subscribers: kwin

Tags: #kwin

Maniphest Tasks: T13021

Differential Revision: https://phabricator.kde.org/D29141
2020-04-24 08:30:07 -06:00
Ismael Asensio
a158d3cbd3 Rules kcm: Use new property ComboBox.currentValue
Summary:
Use the properties `valueRole` and `currentValue`, introduced in Qt5.14 for `QQC2.ComboBox`

This didn't work before due to QQC2 version being mis-detected at build time, so the code mocked an internal `currentValue` property.

After D28859, it is now required to fix:
   "file:///home/nate/kde/usr/share/kpackage/kcms/kcm_kwinrules/contents/ui/RulesEditor.qml"
   "Error loading QML file.\n42: Type RuleItemDelegate unavailable\n68: Type OptionsComboBox unavailable\n35: Cannot override FINAL property\n"
   QCoreApplication::postEvent: Unexpected null receiver

Test Plan:
Try to edit a rule or add a new one.
The rule editor page shows.

Reviewers: ngraham, #kwin, zzag

Reviewed By: ngraham, #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29145
2020-04-24 15:09:51 +02:00
Cyril Rossi
db9d7a7f5d KCM KWinScreenEdge fix build issue
Summary: Remove Q_ASSERT() and add a None value to Monitor::Edge enum to convert ElectricBorder NONE or COUNT

Test Plan: Fix kwin build

Reviewers: #kwin, ngraham, zzag

Reviewed By: #kwin, ngraham, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29104
2020-04-23 08:48:25 +02:00
l10n daemon script
8c7956b923 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"
2020-04-23 06:36:52 +02:00
Ismael Asensio
a04b40dadb KWinRules KCM Redesign
Summary:
Replacement KCM to configure kwin rules, using a QML-based UI.

After some work on the task T12729, it is almost feature-par with the previous module, and adapted to the recent move to KConfigXT.

Test Plan:
{F8208046}
{F8208047}

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

Reviewed By: #plasma, #kwin, #vdg, ngraham, davidedmundson, zzag

Subscribers: ngraham, davidedmundson, hchain, broulik, zzag, kwin

Tags: #kwin, #vdg

Differential Revision: https://phabricator.kde.org/D28152
2020-04-22 21:34:48 +02:00
Cyril Rossi
cf7762eaa8 KCM KWinScreenEdges disable widgets if is immutable
Summary:
Same as D28507

Disable screen edge modification, but allow the user to open an edge context menu and see the settings.

To set an edge immutable, just add `[$i]` right after the entry in `ElectricBorders` group, although the edges settings are shared between some `[Effect-something]` group under the key `BorderActivateSomething`.

Since one entry like `BorderActivateSomething` lists all edges that use this effect, it doesn't make sense to set it immutable.

Test Plan:
In `kwinrc`, set the `ElectricBorders` and/or `Windows` group immutable or any entry.

```
[ElectricBorders]
BottomLeft[$i]=None
Left=None
Right=None
Top[$i]=None

[Windows][$i]
ElectricBorderCornerRatio=0.29
ElectricBorderDelay=300
ElectricBorderMaximize=false
ElectricBorderTiling=true
ElectricBorders=2
```

Reviewers: ervin, bport, meven, zzag, #kwin, mart

Reviewed By: ervin, zzag, #kwin, mart

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D28508
2020-04-22 11:10:17 +02:00
Cyril Rossi
a9c0337113 KCM KWinTouchEdges disable edge if is immutable
Summary:
Disable touch screen edge modification, but allow the user to open an edge context menu and see the settings.

To set an edge immutable, just add `[$i]` right after the entry in `TouchEdges` group, although the edges settings are shared between some `[Effect-something]` group under the key `TouchBorderActivateSomething`.

Since one entry like `TouchBorderActivateSomething` lists all edges that use this effect, it doesn't make sense to set it immutable.

Test Plan:
In `kwinrc`, set the `TouchEdges` group immutable or any entry.

```
[TouchEdges]
Bottom=None
Left=None
Right=None
Top[$i]=None
```

Reviewers: ervin, bport, meven, zzag, #kwin, mart

Reviewed By: ervin, zzag, #kwin, mart

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D28507
2020-04-22 11:10:12 +02:00
Cyril Rossi
128eb13c09 KCM KWinScreenEdges port to KConfigXT
Summary: Following D27862 port KWinScreenEdges to KConfigXT, handle isSaveNeeded and isDefault KCModule state.

Reviewers: #kwin, ervin, bport, meven, zzag

Reviewed By: #kwin, ervin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D28475
2020-04-22 11:10:02 +02:00
Cyril Rossi
01314f8e9a KCM KWinTouchScreen port to KConfigXT
Summary:
Also manage KCModule states (isSaveNeeded and isDefaults)

BUG: 405573

Test Plan:
* exec kcmshell5 kwintouchscreen
* In an edge, select action Present windows - All desktops, then apply
* close and reopen
* Should display action Present windows - All desktops in the previously selected edge.

* Do same test with Present windows - current desktop

Reviewers: #kwin, ervin, bport, meven, zzag

Reviewed By: #kwin, ervin, meven, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27862
2020-04-22 11:09:39 +02:00
Albert Astals Cid
df89d4d83e GIT_SILENT Fix scripty failing
There's no *.h file here anymore

CCMAIL: meven29@gmail.com
2020-04-21 23:11:15 +02:00
Méven Car
e95d1dc950 KCM/Compositing: Use KConfig XT in UI
Summary:
Use KConfig XT to manage most fields of the KCM.
Simplify code.

Depends on D27955

Test Plan: No functional change

Reviewers: #kwin, ervin, crossi, bport, hchain, zzag

Reviewed By: #kwin, ervin, bport, zzag

Subscribers: anthonyfieroni, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27988
2020-04-20 10:12:05 +02:00
Cyril Rossi
3284e19646 KCM KWinTabbox disable widget if property is immutable.
Summary:
Some widget cannot be managed by KCModule, so we have to disable the widget if the property is immutable.
Remove unused parameter in `createConnections()`

Test Plan: Add [$i] right after the key or group in kwinrc, the widget should be disabled.

Reviewers: #kwin, ervin, bport, meven, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D28484
2020-04-14 14:08:36 +02:00
David Edmundson
bee3afdd51 [kcmkwin] Make dialog non blocking
Summary:
It's invoked from QML.

Nested event loops invoked directly from QML is asking for crashes.

BUG: 419118

Test Plan:
Opened KCM
Opened dialog for some settings
Window was still modal as before
Settings were saved
(though they didn't seem to be applied..maybe another bug?)

Reviewers: #kwin, apol

Reviewed By: apol

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D28293
2020-04-07 09:27:31 +01:00