Summary:
_pluggedController disconnection happens when session is closed
by closeInNormalWay or closeInForceWay and calling
disconnectController leads to Konsole crash. Also a case when
closeInNormalWay is false was not considered.
BUG: 410607
FIXED-IN: 19.08.1
Test Plan:
1. Open Konsole
2. Open one more tab
3. Try to close Konsole
4. Pick option "Close Current Tab" (assuming you have not check
'Do not ask again')
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: hindenburg, konsole-devel, #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D23246
Summary:
Randomize colors using HSLuv color space instead of HSL. It has
perceptually uniform lightness, which means every color with the same
lightness value is perceived as equally bright by humans. Displays
quality and lack of calibration in most monitors lowers this uniformity,
but even on worst color display it should be better than standard HSL.
More information about HSLuv: http://www.hsluv.org/
Minor changes:
* Random seed takes PID into account to prevent repeated colors in
separate Konsole processes
* Key names in a config were changed
* Adapted "Black on random light" color scheme
Breeze with random ranges on default bg and fg: hue=360° saturation=100:
{F6754773}
To be done in future:
* Automatically convert color schemes which use old randomization
method.
Reviewers: #konsole, #vdg
Subscribers: hindenburg, #vdg, #konsole
Tags: #konsole, #vdg
Differential Revision: https://phabricator.kde.org/D20263
Summary:
In all the cases that were changed, the bounding rect is needed. A few
places were not ported, since they need more careful investigation.
This reduces deprecation warnings.
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: hindenburg, konsole-devel
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D23144
Summary:
When there is only one tab and a process is running, remove the
'close current tab' option when attempting to close Konsole.
Test Plan:
1. Open Konsole (assuming you have not check 'Do not ask again')
2. Start any process (ie top)
3. Try to close Konsole
Should only be 2 options, 'Close window' and 'Cancel'
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: hindenburg, ngraham, konsole-devel
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D23146
When XDG_CURRENT_DESKTOP ≠ kde, perssing and immediately releasing Alt
key makes focus get stuck in menu. Fix this by overriding QProxyStyle.
This does not influence menu accelerators (e.g. Alt+f to access "File" in
menu), which continue working according to user settings.
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
BUG: 410641
FIXED-IN: 19.08
Differential Revision: https://phabricator.kde.org/D22980
Fixes a problem detected by Coverity Scan.
Coverity Scan log (relevant part)
---------------------------------
```
(...)
*** CID 241675: (UNINTENDED_INTEGER_DIVISION)
/zpool/projects/Devel/KDE/src/konsole/src/TerminalDisplay.cpp: 728
in Konsole::TerminalDisplay::drawCursor(QPainter &, const QRect &,
const QColor &, const QColor &, bool &)()
722 painter.setPen(cursorColor);
723 724 if (_cursorShape == Enum::BlockCursor) {
725 // draw the cursor outline, adjusting the area so that
726 // it is draw entirely inside 'rect'
727 int penWidth = qMax(1, painter.pen().width());
CID 241675: (UNINTENDED_INTEGER_DIVISION)
Dividing integer expressions "penWidth" and "2", and then converting
the integer quotient to type "double". Any remainder, or fractional
part of the quotient, is ignored.
728 painter.drawRect(cursorRect.adjusted(penWidth / 2 + 0.5,
729 penWidth / 2 + 0.5,
730 - penWidth / 2 - penWidth % 2 + 0.5,
731 - penWidth / 2 - penWidth % 2 + 0.5));
732 733 // draw the cursor body only when the widget has focus
/zpool/projects/Devel/KDE/src/konsole/src/TerminalDisplay.cpp: 729
in Konsole::TerminalDisplay::drawCursor(QPainter &, const QRect &,
const QColor &, const QColor &, bool &)()
723 724 if (_cursorShape == Enum::BlockCursor) {
725 // draw the cursor outline, adjusting the area so that
726 // it is draw entirely inside 'rect'
727 int penWidth = qMax(1, painter.pen().width());
728 painter.drawRect(cursorRect.adjusted(penWidth / 2 + 0.5,
CID 241675: (UNINTENDED_INTEGER_DIVISION)
Dividing integer expressions "penWidth" and "2", and then converting
the integer quotient to type "double". Any remainder, or fractional
part of the quotient, is ignored.
729 penWidth / 2 + 0.5,
730 - penWidth / 2 - penWidth % 2 + 0.5,
731 - penWidth / 2 - penWidth % 2 + 0.5));
732 733 // draw the cursor body only when the widget has focus
734 if (hasFocus()) {
(...)
```
How the initial terminal size is set:
* TerminalDisplay calculates size in pixels from requested columns/rows
count, and uses it as the size hint.
* TabbedViewContainer, which wraps TerminalDisplay and QTabBar,
and MainWindow, which wraps TabbedViewContainer, calculates their
sizes from their children's size hints. It is assumed the size
is equal to children's bounding rectangle size, eventually increased
by visible margins.
* TerminalDisplay adjusts its size to fill the window. In this case,
this should change nothing.
QTabWidget's (TabbedViewContainer base class) sizeHint() includes
some (*nonexistent*) margins added by widgets style (by default 2*2,
2*4 in Breeze). Those were propagated to the window size and were
increasing TerminalDisplay size.
Reimplemented TabbedViewContainer::sizeHint() returns the size of its
children's bounding rectangle.
rects creates a temporary vector with all the rectangles and
returns the result, destructing in the end. we don't need that
if we are only interested in iterating thru the rects. QRegion
has begin / end so it's usable in Q_FOREACH and range based for.
This reverts commit d689ba5403.
I should have tested this more; this breaks a number of things as
switching doesn't execute the 'Command'. Since the next release is
close, let's just revert for now.
FIXED-IN: 19.08
CCBUG: 319926