Bug 415242 - BlackOnRandomLight colorscheme always gives black background
Summary: BlackOnRandomLight colorscheme always gives black background
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 19.12.0
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
: 415290 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-12-16 12:02 UTC by Wolfgang Bauer
Modified: 2020-01-13 09:26 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 19.12.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Bauer 2019-12-16 12:02:04 UTC
SUMMARY
Configuring konsole to use the "Black on Random Light" colorscheme results in a completely black window, because the background is always black instead of being random.

STEPS TO REPRODUCE
1. Open Settings->"Edit Current Profile"
2. Choose "Black on Random Light" color scheme in Appearance
3. Click "OK" and restart konsole

OBSERVED RESULT
Background is black, text is unreadable (because it's also black of course)

EXPECTED RESULT
Background should have a light color.

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.17.4
KDE Frameworks Version: 5.64.0
Qt Version: 5.13.1

ADDITIONAL INFORMATION
The problem seems to be that the color randomization doesn't work as expected.
If I remove the line "ColorRandomization=true" from /usr/share/konsole/BlackOnRandomLight.colorscheme, the background is light (yellow).
Comment 1 Mariusz Glebocki 2019-12-17 00:39:46 UTC
I've compiled 19.12.0 and couldn't reproduce black background. However, there was stack-use-after-scope bug in lightness randomization code - I guess in some cases it can cause wrong value being "randomized" (0 in your case).

This was recently fixed on master - are you able to compile and verify?

What happens when you turn on color randomization for Breeze color scheme? Is background black too, or does it use some dark (not black) color? To check:
* Edit Profile → Appearance
* Select "Breeze"
* Click "Edit"
* Select "randomly adjust colors for each session" check box
* Apply/OK
* Verify background color
* Click "Defaults" to restore original Breeze color scheme
Comment 2 Wolfgang Bauer 2019-12-17 07:22:40 UTC
(In reply to Mariusz Glebocki from comment #1)
> I've compiled 19.12.0 and couldn't reproduce black background. However,
> there was stack-use-after-scope bug in lightness randomization code - I
> guess in some cases it can cause wrong value being "randomized" (0 in your
> case).
> 
> This was recently fixed on master - are you able to compile and verify?
Yes indeed, it seems to work fine with https://cgit.kde.org/konsole.git/commit/?id=2251d55857c950cebaa5fe331b01b5ab220b03b4 on top of 19.12.0.

Maybe that commit should be backported to the 19.12 branch then.

> What happens when you turn on color randomization for Breeze color scheme?
> Is background black too, or does it use some dark (not black) color? To
> check:
> * Edit Profile → Appearance
> * Select "Breeze"
> * Click "Edit"
> * Select "randomly adjust colors for each session" check box
> * Apply/OK
> * Verify background color
> * Click "Defaults" to restore original Breeze color scheme

Interestingly, it worked fine with Breeze without that patch.

I noticed another glitch however: I cannot turn off the "Randomly adjust colors for each session" option anymore after I turned it on, it just stays on.
Clicking on "Defaults" works though.
Comment 3 Wolfgang Bauer 2020-01-05 17:31:17 UTC
(In reply to Wolfgang Bauer from comment #2)
> I noticed another glitch however: I cannot turn off the "Randomly adjust
> colors for each session" option anymore after I turned it on, it just stays
> on.
I found a fix for that: https://phabricator.kde.org/D26439

Still, can https://cgit.kde.org/konsole.git/commit/?id=2251d55857c950cebaa5fe331b01b5ab220b03b4 be backported to the 19.12 branch to fix the original problem?
19.12.1 is being tagged tomorrow.
Comment 4 Kurt Hindenburg 2020-01-05 18:25:09 UTC
Git commit 771c1733fd5ee9cfb854212b83df6de148608a65 by Kurt Hindenburg, on behalf of Wolfgang Bauer.
Committed on 05/01/2020 at 18:24.
Pushed by hindenburg into branch 'release/19.12'.

Copy _colorRandomization when copying a new ColorScheme

Summary:
The `_colorRandomization` property is new in 19.12, and should be
copied by the copy constructor as well.

This fixes the problem that it was not possible to disable the
"Randomly adjust colors for each session" option again once it was
enabled.
FIXED-IN: 19.12.1

Test Plan:
In the color scheme editor:
Choose "Black on Random Light" and click on Edit, disable
"Randomly adjust colors for each session", and click OK.
It's saved correctly now, previously it stayed on.

Alternatively, select some other color scheme, enable the option and
click OK. Then try to disable it again. This works now, previously it
also stayed on.

Select an existing colorscheme and click on New, the new color scheme
still properly inherits the "Randomly adjust colors for each session"
setting.

Reviewers: #konsole, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: hindenburg, konsole-devel

Tags: #konsole

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

M  +1    -0    src/ColorScheme.cpp

https://invent.kde.org/kde/konsole/commit/771c1733fd5ee9cfb854212b83df6de148608a65
Comment 5 Kurt Hindenburg 2020-01-05 18:25:13 UTC
Git commit 771c1733fd5ee9cfb854212b83df6de148608a65 by Kurt Hindenburg, on behalf of Wolfgang Bauer.
Committed on 05/01/2020 at 18:24.
Pushed by scmsync into branch 'release/19.12'.

Copy _colorRandomization when copying a new ColorScheme

Summary:
The `_colorRandomization` property is new in 19.12, and should be
copied by the copy constructor as well.

This fixes the problem that it was not possible to disable the
"Randomly adjust colors for each session" option again once it was
enabled.
FIXED-IN: 19.12.1

Test Plan:
In the color scheme editor:
Choose "Black on Random Light" and click on Edit, disable
"Randomly adjust colors for each session", and click OK.
It's saved correctly now, previously it stayed on.

Alternatively, select some other color scheme, enable the option and
click OK. Then try to disable it again. This works now, previously it
also stayed on.

Select an existing colorscheme and click on New, the new color scheme
still properly inherits the "Randomly adjust colors for each session"
setting.

Reviewers: #konsole, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: hindenburg, konsole-devel

Tags: #konsole

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

M  +1    -0    src/ColorScheme.cpp

https://commits.kde.org/konsole/771c1733fd5ee9cfb854212b83df6de148608a65
Comment 6 Kurt Hindenburg 2020-01-05 18:28:21 UTC
Git commit 7cfe2c8a36fd07394b98a076da2a144e750a885a by Kurt Hindenburg, on behalf of Wolfgang Bauer.
Committed on 05/01/2020 at 18:26.
Pushed by hindenburg into branch 'master'.

Copy _colorRandomization when copying a new ColorScheme

Summary:
The `_colorRandomization` property is new in 19.12, and should be
copied by the copy constructor as well.

This fixes the problem that it was not possible to disable the
"Randomly adjust colors for each session" option again once it was
enabled.
FIXED-IN: 19.12.1

Test Plan:
In the color scheme editor:
Choose "Black on Random Light" and click on Edit, disable
"Randomly adjust colors for each session", and click OK.
It's saved correctly now, previously it stayed on.

Alternatively, select some other color scheme, enable the option and
click OK. Then try to disable it again. This works now, previously it
also stayed on.

Select an existing colorscheme and click on New, the new color scheme
still properly inherits the "Randomly adjust colors for each session"
setting.

Reviewers: #konsole, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: hindenburg, konsole-devel

Tags: #konsole

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

(cherry picked from commit 771c1733fd5ee9cfb854212b83df6de148608a65)

M  +1    -0    src/ColorScheme.cpp

https://invent.kde.org/kde/konsole/commit/7cfe2c8a36fd07394b98a076da2a144e750a885a
Comment 7 Kurt Hindenburg 2020-01-05 18:28:25 UTC
Git commit 7cfe2c8a36fd07394b98a076da2a144e750a885a by Kurt Hindenburg, on behalf of Wolfgang Bauer.
Committed on 05/01/2020 at 18:26.
Pushed by scmsync into branch 'master'.

Copy _colorRandomization when copying a new ColorScheme

Summary:
The `_colorRandomization` property is new in 19.12, and should be
copied by the copy constructor as well.

This fixes the problem that it was not possible to disable the
"Randomly adjust colors for each session" option again once it was
enabled.
FIXED-IN: 19.12.1

Test Plan:
In the color scheme editor:
Choose "Black on Random Light" and click on Edit, disable
"Randomly adjust colors for each session", and click OK.
It's saved correctly now, previously it stayed on.

Alternatively, select some other color scheme, enable the option and
click OK. Then try to disable it again. This works now, previously it
also stayed on.

Select an existing colorscheme and click on New, the new color scheme
still properly inherits the "Randomly adjust colors for each session"
setting.

Reviewers: #konsole, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: hindenburg, konsole-devel

Tags: #konsole

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

(cherry picked from commit 771c1733fd5ee9cfb854212b83df6de148608a65)

M  +1    -0    src/ColorScheme.cpp

https://commits.kde.org/konsole/7cfe2c8a36fd07394b98a076da2a144e750a885a
Comment 8 Wolfgang Bauer 2020-01-05 18:53:56 UTC
*** Bug 415290 has been marked as a duplicate of this bug. ***
Comment 9 Wolfgang Bauer 2020-01-13 09:17:02 UTC
As https://cgit.kde.org/konsole.git/commit/?id=2251d55857c950cebaa5fe331b01b5ab220b03b4 is included in the latest 19.12.1 release, I suppose this can be closed now.

Thank you all!