Bug 399778

Summary: Special Application/Window Settings not applying
Product: [Plasma] kwin Reporter: Victor Prudniy <vityas_official>
Component: rulesAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: aligatorturtle, bret, bugseforuns, dontdieych, eagle.bugs.kde.org, fred_insurance, herdoralden, i, jonhjonhz, jsardid, kde, krewetki, laxmanpradhan, nate, neousr, pepko94, r.griff444, rikmills, shinkenviolet, trmdi
Priority: NOR    
Version: 5.14.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 5.14.3
Sentry Crash Report:
Attachments: Video demonstration of the bug

Description Victor Prudniy 2018-10-14 02:20:47 UTC
Created attachment 115634 [details]
Video demonstration of the bug

SUMMARY
This started after updating to plasma 5.14.0. Was working in 5.13.
Also there is discussion on reddit where people have same problem:
 https://www.reddit.com/r/kde/comments/9ntzo6/window_special_application_settings_doesnt_work/

STEPS TO REPRODUCE
1. trigger 'Special Application/Window Settings' menu
2. change something
3. click 'Ok'

OBSERVED RESULT
Changes not applied


EXPECTED RESULT
Changes applied

SOFTWARE VERSIONS
(available in About System)
KDE Plasma Version: 5.14.0
KDE Frameworks Version: 5.50.0
Qt Version: 5.11.2
Comment 1 Martin Flöser 2018-10-14 06:17:48 UTC
X11 or Wayland?
Comment 2 Robert Griffiths 2018-10-14 11:35:04 UTC
X11 or Wayland? On mine, X11 5.14 Neon User.
Additional info that may help, I successfully added my window rules from settings but these would only work when widgets were unlocked.
Comment 3 Martin Flöser 2018-10-14 15:05:01 UTC
What do you mean with "widgets were unlocked"?
Comment 4 Victor Prudniy 2018-10-14 15:09:48 UTC
X11 in my case
Comment 5 Robert Griffiths 2018-10-14 15:11:46 UTC
Unlock widgets from Plasma panel: I first tried creating a window rule in system settings, it saved but when I moved away from the window rule page and went back again it was gone. I tried this a few times and it only started working when I unlocked widgets on the Plasma panel.
Comment 6 Martin Flöser 2018-10-14 16:29:11 UTC
That must be unrelated. KWin does not read or care about the Plasma widget state.
Comment 7 Victor Prudniy 2018-10-14 19:48:58 UTC
Creating application rules from system settings works fine for me, only specific window/app settings triggered from alt+f3 menu not working. Now as a workaround I'm using global rule and it works.
Comment 8 Patrick Silva 2018-10-17 11:50:43 UTC
Same thing under Wayland. 

Operating System: Arch Linux 
KDE Plasma Version: 5.14.1
Qt Version: 5.12.0 beta2
KDE Frameworks Version: 5.51.0
Comment 9 Andrew Harrison 2018-10-19 05:56:18 UTC
Same here.  Neon 5.14, X11.  Recently upgraded from 16.04.
Comment 10 Bret J. Savino 2018-10-19 15:08:36 UTC
Happening on all 3 of my Neon boxes.  Set a window or application rule, click ok, nothing in the list of rules.  You can set it manually from the systemsettings>windowsettings>windowrules with the same result.  I have not tried exporting/importing.
Comment 11 Bret J. Savino 2018-10-20 07:06:37 UTC
Updated through 1 AM Mountain time Oct 20th 2018 have brought back the list of rules in Window rules and appear to be functioning.  Rules can be added manually or ALT+F3 > more actions > Special Window Settings.
Comment 12 Robert Griffiths 2018-10-20 08:16:53 UTC
Neon Dev Stable just did an update:

kwin/bionic,bionic,bionic,now 4:5.14.1+p18.04+git20181019.2337-0 all [installed,automatic]
kwin-addons/bionic,now 4:5.14.1+p18.04+git20181019.0033-0 amd64 [installed,automatic]
kwin-common/bionic,now 4:5.14.1+p18.04+git20181019.2337-0 amd64 [installed,automatic]
kwin-data/bionic,bionic,bionic,now 4:5.14.1+p18.04+git20181019.2337-0 all [installed,automatic]

Not resolved for me, can't add in SW or SA, tried Dolphin and Kate.
Comment 13 Andrew Harrison 2018-10-23 06:47:46 UTC
Have updated several times, but problem still persists.
Comment 14 Martin Flöser 2018-10-23 14:52:55 UTC
*** Bug 400202 has been marked as a duplicate of this bug. ***
Comment 15 dontdieych 2018-10-23 15:23:41 UTC
I've got this problem when dealing with firefox. Set rule from system setting is working but in title bar menu.

Arch Linux

$ pacman -Q plasma-desktop kwin plasma-framework qt5-base

plasma-desktop 5.14.1-1
kwin 5.14.1-1
plasma-framework 5.51.0-1
qt5-base 5.11.2-1
Comment 16 fredhoud 2018-10-24 19:18:19 UTC
This is regarding bug #399931, which I think is the same as #399778. It's very annoying that it cannot save the position to make the programs open where you want it to open, specially if you're working with two monitors and a bunch of programs running at the same time. I'm hoping this gets fixed sooner than later! Any estimation as to when this may get fixed?
Comment 17 krewetki 2018-10-28 20:08:40 UTC
I experience the same problem


my laptop:
Manjaro 18.0.0-rc Illyria
x86_64 Linux 4.18.16-1-MANJARO
bash 4.4.23
KDE 5.51.0 / Plasma 5.14.2
Comment 18 krewetki 2018-10-28 20:09:39 UTC
I experience the same problem


my laptop:
Manjaro 18.0.0-rc Illyria
x86_64 Linux 4.18.16-1-MANJARO
bash 4.4.23
KDE 5.51.0 / Plasma 5.14.2
Comment 19 Neousr 2018-10-30 22:24:35 UTC
Can reproduce on Neon 5.14.2.

(In reply to Victor Prudniy from comment #7)
> Creating application rules from system settings works fine for me, only
> specific window/app settings triggered from alt+f3 menu not working. Now as
> a workaround I'm using global rule and it works.

Same boat creating/modifying an application rule by the settings menu works it wont save if accessed by the title bar of the application.
Comment 20 Martin Flöser 2018-10-31 05:30:57 UTC
Please don't add any further "me too" comments: we know that this bug is valid.
Comment 21 Vlad Zahorodnii 2018-10-31 20:55:25 UTC
After bisecting it looks like a02797ca0608a302f466897d5bb5cd5cf4b9d13f introduced this bug.
Comment 22 David Edmundson 2018-10-31 22:20:19 UTC
Good work, config doesn't go out of scope so doesn't implicitly sync.
Comment 23 Vlad Zahorodnii 2018-10-31 23:26:18 UTC
(In reply to David Edmundson from comment #22)
> config doesn't go out of scope so doesn't implicitly sync.
I had the same thought.
Comment 24 Vlad Zahorodnii 2018-11-01 09:50:53 UTC
Git commit 95ff4a2d49d897739f58e931454edf0272798038 by Vlad Zagorodniy.
Committed on 01/11/2018 at 09:42.
Pushed by vladz into branch 'Plasma/5.14'.

Flush kwinrulesrc in RuleBook::save

Summary:
a02797ca0608a302f466897d5bb5cd5cf4b9d13f missed sync call to actually
write rules to disk.
FIXED-IN: 5.14.3

Test Plan: Changed opacity in Special Window Settings.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16580

M  +1    -0    rules.cpp

https://commits.kde.org/kwin/95ff4a2d49d897739f58e931454edf0272798038
Comment 25 dontdieych 2018-11-02 01:32:12 UTC
Thanks for that patch.

I'll report ASAP when I get this on Arch.

Thanks again.
Comment 26 Vlad Zahorodnii 2018-11-02 09:55:02 UTC
*** Bug 400574 has been marked as a duplicate of this bug. ***
Comment 27 Robert Griffiths 2018-11-02 11:47:42 UTC
Problem solved on mine, Neon Dev Stable, not sure if it was today's update because there have been a few over the last few days and I've not had a chance to check. Anyway, current kwin:

kwin/bionic,bionic,bionic,now 4:5.14.2+p18.04+git20181102.0029-0 all [installed,automatic]
kwin-addons/bionic,now 4:5.14.2+p18.04+git20181101.0044-0 amd64 [installed,automatic]
kwin-common/bionic,now 4:5.14.2+p18.04+git20181102.0029-0 amd64 [installed,automatic]
Comment 28 Martin Flöser 2018-11-07 19:20:47 UTC
*** Bug 399931 has been marked as a duplicate of this bug. ***
Comment 29 Martin Flöser 2018-11-09 16:28:27 UTC
*** Bug 400448 has been marked as a duplicate of this bug. ***
Comment 30 laxmanpradhan 2018-12-14 20:56:38 UTC
Seems to be a similar issue to this, so I will re-open rather than make a new bug.

Issue
I have some kwin Window Rules, basically for certain firefox windows, if the title of the window matches a string it will force the size and position so that it always appears on the screen where I want. This part works perfectly. The problem is that it seems to forget the rules.

The rules will be working perfectly, then suddenly it stops working. When I go back to the settings window, some of the rules will ramdomly be gone, different ones every time.

The issue seems to be that it can't save all the rules properly.

Steps to reproduce
Make several Window Rules from System Settings-> Window Mnagement->window rules. Wait a bit and they will dissapear and the rules stop working.

The rules that I have are substring match for the title for firefox, then size and position get set to force.

Work around
At first, I would leave the settings window open in another activity and then just press 'move up' and 'move down' to force and change, hit apply and it will keep working as normal. Sometimes this stops working just 1-2 mins later so I have exported all my rules so that I can reimport them quickly.

System
Operating System: Kubuntu 18.10
KDE Plasma Version: 5.14.4
Qt Version: 5.11.1
KDE Frameworks Version: 5.52.0
Kernel Version: 4.18.0-11-generic
OS Type: 64-bit
Processors: 8 × AMD Ryzen 5 2400G with Radeon Vega Graphics
Memory: 14.7 GiB of RAM

Investigations
My ~/.config/ foler has the following:
-rw------- 1 xx xx 1502 Dec  3 15:05 kwinrc
-rw------- 1 xx xx 1007 Dec  7 16:35 kwinrulesrc

where xx is my username.
Sometime the kwinrulesrc file will have a few rules rndomly missing.
I even tried to chmod 000 the file after importing all my rules again to make sure it can't be modified by another file, and the problem persisted, the rules were still in the file but the windows were not being positioned correctly. Of course now I can't use the gui to 'refresh' the rules so I had to change the permissions back and I now keep using the above workaround to refresh the rules.
Comment 31 Vlad Zahorodnii 2018-12-14 21:17:52 UTC
That's seems to be a different issue. Please file a new bug report.