1. 25 Aug, 2019 1 commit
    • Mariusz Glebocki's avatar
      Apply new window flags only when necessary · b88e677b
      Mariusz Glebocki authored
      Applying settings in Configure Konsole dialog was causing every Konsole
      window to be hidden and shown again. This was leading to information
      related to window management (window state, desktop, position/display,
      etc.) to be lost - windows were appearing on current display, current
      desktop, at new positions.
      
      The hide/show action is triggered by setting window flags. Only "remove
      window titlebar and frame" option really changes the flags, so it is
      pointless to set them again in other cases. Now, flags are not set when
      they are the same as current ones.
      
      Additionally, when "remove window titlebar and frame" option is changed
      and new flags are different, windows' positions and displays are
      restored. Other properties are still being lost.
      
      Test cases
      ----------
      
      * Open a few Konsole windows, put them on different desktops and
        at different positions.
      * Open Configure Konsole dialog, change any option different than
        "remove window titlebar and frame".
      * Apply
      
      **Before**
      
      Konsole windows have been moved to current display and current desktop.
      Their positions have changed. The configuration window has been placed
      under them.
      
      **After**
      
      The side effects mentioned above do not occur.
      
      ---
      
      * Open a few Konsole windows, put them on different desktops and at
        different positions.
      * Open Configure Konsole dialog, change "remove window titlebar and
        frame" option.
      * Apply
      
      **Before**
      
      Konsole windows' titlebar and frame became visible/invisible.
      The windows have been moved to current desktop. Both their positions
      and display have changed. The configuration window has been placed
      under them.
      
      **After**
      
      Like before, except windows' position and display - they are restored
      now.
      b88e677b
  2. 24 Aug, 2019 6 commits
  3. 23 Aug, 2019 4 commits
  4. 22 Aug, 2019 1 commit
  5. 20 Aug, 2019 1 commit
  6. 18 Aug, 2019 2 commits
    • Kurt Hindenburg's avatar
      82bca348
    • Kurt Hindenburg's avatar
      Fix crash on "Close Current Tab" handling · 62a5f1d7
      Kurt Hindenburg authored
      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
      62a5f1d7
  7. 17 Aug, 2019 5 commits
  8. 16 Aug, 2019 4 commits
  9. 13 Aug, 2019 1 commit
  10. 10 Aug, 2019 1 commit
  11. 07 Aug, 2019 1 commit
  12. 06 Aug, 2019 2 commits
  13. 05 Aug, 2019 2 commits
  14. 02 Aug, 2019 2 commits
    • Friedrich W. H. Kossebau's avatar
    • Mariusz Glebocki's avatar
      Mark intended integer division in double context · c5ed6009
      Mariusz Glebocki authored
      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()) {
      
      (...)
      ```
      c5ed6009
  15. 01 Aug, 2019 2 commits
  16. 26 Jul, 2019 1 commit
  17. 25 Jul, 2019 1 commit
  18. 19 Jul, 2019 2 commits
    • Mariusz Glebocki's avatar
      Fix initial terminal size · efb621d0
      Mariusz Glebocki authored
      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.
      efb621d0
    • Tomaz  Canabrava's avatar
      Remove obsolete call 'rects', use begin / end iterators. · 47d97aa0
      Tomaz Canabrava authored
      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.
      47d97aa0
  19. 18 Jul, 2019 1 commit