Bug 399462 - Default behavior is wrong when BorderlessMaximizedWindows=true
Summary: Default behavior is wrong when BorderlessMaximizedWindows=true
Status: RESOLVED FIXED
Alias: None
Product: lattedock
Classification: Plasma
Component: application (show other bugs)
Version: git (master)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Michail Vourlakos
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-06 20:18 UTC by trmdi
Modified: 2018-10-06 22:15 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 0.8.2
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description trmdi 2018-10-06 20:18:25 UTC
STEPS TO REPRODUCE
1. Set BorderlessMaximizedWindows=true manually in kwinrc
2. Start Latte with the default setting.

OBSERVED RESULT
Latte writes BorderlessMaximizedWindows=false

EXPECTED RESULT
It shouldn't touch that value UNLESS users enable the Latte option.
Comment 1 trmdi 2018-10-06 20:27:03 UTC
If users don't enable the option in Latte:
  - don't touch that kwin value, regardless of the kwin value.
(The bug happens when the kwin value = true, Latte value = default (false) )


Else:
  - Latte manages it as the current implementation
Comment 2 trmdi 2018-10-06 20:52:12 UTC
More general. Current implementation:
If: - Latte option: OFF
    - kwin BorderlessMaximizedWindows value <> the layout's specific value (*)

-> when start Latte with the layout (*):
OBSERVED RESULT
Latte writes BorderlessMaximizedWindows to the specific value of the layout

EXPECTED RESULT
It shouldn't touch that value UNLESS users enable the Latte option.
Comment 3 trmdi 2018-10-06 21:01:15 UTC
By "Latte option", I mean the "canDisableBorders" key.

canDisableBorders=false -> don't modify BorderlessMaximizedWindows. But currently it does.
canDisableBorders=true -> ok, Latte manages it
Comment 4 trmdi 2018-10-06 21:19:51 UTC
I guess you miss some `m_corona->universalSettings()->canDisableBorders()` here https://github.com/KDE/latte-dock/blob/09fe5e385b4df76afbd342fab61afe6c642aaaf1/app/layout.cpp#L201
Comment 5 Michail Vourlakos 2018-10-06 21:38:30 UTC
(In reply to trmdi from comment #0)
> STEPS TO REPRODUCE
> 1. Set BorderlessMaximizedWindows=true manually in kwinrc
> 2. Start Latte with the default setting.
> 
> OBSERVED RESULT
> Latte writes BorderlessMaximizedWindows=false
> 
> EXPECTED RESULT
> It shouldn't touch that value UNLESS users enable the Latte option.


You see a fault but you dont understand the reason. This is on purpose. Latte respects the default values of kwin... If the user does not touch the kwin value at all which is BorderlessMaximizedWindows=false the Latte wont activate it... This is the majority of cases...

Latte v0.8 supports multiple layouts and these layouts can have different values for BorderlessMaximizedWindows. The only solution was that if the user wants to set BorderlessMaximizedWindows then it should do it in Latte way... The users must be educated it this... The alternative would be that Latte would break the kwin default option BorderlessMaximizedWindows=false and that is not an option...

The problem arises when:

a) a user manually sets  BorderlessMaximizedWindows=true
b) a user activates it in AWC

and for both [a] and [b] the user uses Latte>=v0.8 ...

this is going to be solved and the solution applied to Latte only if there is an opinion that doesnt break kwin default behavior and respects also MultipleLayouts of Latte...
Comment 6 trmdi 2018-10-06 21:44:46 UTC
Wait...
So what is the purpose of "canDisableBorders=false" ?
Comment 7 trmdi 2018-10-06 21:49:09 UTC
> If the user does not touch the kwin value at all which is BorderlessMaximizedWindows=false the Latte wont activate it...

You are wrong.
You can test that with these steps:
1. set canDisableBorders = false
2. set BorderlessMaximizedWindows=false
3. start latte with a layout that has BorderlessMaximizedWindows=true

OBSERVED RESULT
Latte writes BorderlessMaximizedWindows=true (that is not your intention right?)

EXPECTED RESULT
It shouldn't touch that value UNLESS users enable the Latte option.
Comment 8 trmdi 2018-10-06 21:55:25 UTC
I'm not talking about the case canDisableBorders=true

I'm talking about the case canDisableBorders=false.
Comment 9 trmdi 2018-10-06 22:04:27 UTC
(In reply to trmdi from comment #4)
> I guess you miss some `m_corona->universalSettings()->canDisableBorders()`
> here
> https://github.com/KDE/latte-dock/blob/
> 09fe5e385b4df76afbd342fab61afe6c642aaaf1/app/layout.cpp#L201

You just missed an condition at this line.
Comment 10 Michail Vourlakos 2018-10-06 22:07:17 UTC
(In reply to trmdi from comment #7)
> > If the user does not touch the kwin value at all which is BorderlessMaximizedWindows=false the Latte wont activate it...
> 
> You are wrong.
> You can test that with these steps:
> 1. set canDisableBorders = false
> 2. set BorderlessMaximizedWindows=false
> 3. start latte with a layout that has BorderlessMaximizedWindows=true
> 


reproduced and this is a bug...
Comment 11 Michail Vourlakos 2018-10-06 22:14:46 UTC
Git commit f62f7485c03c96d944e01171f4657e618a008475 by Michail Vourlakos.
Committed on 06/10/2018 at 22:14.
Pushed by mvourlakos into branch 'v0.8'.

dont break BorderlessMaximized window default

--dont update the BorderlessMaximized value if
the user hasnt explicitly enabled it from Latte
options.
FIXED-IN: 0.8.2

M  +2    -1    app/layout.cpp

https://commits.kde.org/latte-dock/f62f7485c03c96d944e01171f4657e618a008475
Comment 12 Michail Vourlakos 2018-10-06 22:15:36 UTC
(In reply to trmdi from comment #9)
> (In reply to trmdi from comment #4)
> You just missed an condition at this line.

fantastic catch! thanks!!!