<div><br></div><div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Sat, 13 Dec 2025 at 20:15 Cristian S <<a href="mailto:cristian_s@gmx.com">cristian_s@gmx.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    I'm trying to figure out where this bug is coming from.<br>
    I'm discussing these particular versions of Konsole and
    KWidgetsAddons as published on Debian Snapshots:<br>
    <br>
    #    konsole 20.12.1-1 (sources at
<a href="http://snapshot.debian.org/package/konsole/4%3A20.12.1-1/#konsole_4:3a:20.12.1-1" target="_blank">http://snapshot.debian.org/package/konsole/4%3A20.12.1-1/#konsole_4:3a:20.12.1-1</a>)<br>
    #    kwidgetsaddons 5.78.0-2 (sources at
<a href="http://snapshot.debian.org/package/kwidgetsaddons/5.78.0-2/#libkf5widgetsaddons5_5.78.0-2" target="_blank">http://snapshot.debian.org/package/kwidgetsaddons/5.78.0-2/#libkf5widgetsaddons5_5.78.0-2</a>)<br>
    </div></blockquote><div dir="auto"><br></div><div dir="auto">this is from 5 years ago, any chance you can update?</div><div dir="auto"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div bgcolor="#FFFFFF" text="#000000" dir="auto"><br>
    The issue I'm trying to fix is with the confirmation dialogs shown
    for example by Konsole when trying to close a Konsole window
    containing a process or more  can updstill running in it.<br>
    <br>
    This confirmation dialog uses the KMessageBox widget from
    KWidgetsAddons.<br>
    Looking in kwidgetsaddons-5.78.0/src/kmessagebox.h,  at line 409, I
    see this:<br>
    <br>
    ====================================<br>
    <font face="Courier New, Courier, monospace" style="font-family:"Courier New",Courier,monospace;color:rgb(0,0,0)">/**<br>
       * Display a Yes/No/Cancel "warning" dialog with a listbox to show
      information<br>
       * to the user.<br>
       *<br>
       * @param parent  Parent widget.<br>
       * @param text    Message string.<br>
       * @param strlist List of strings to be written in the listbox. If
      the<br>
       *                list is empty, it doesn't show any listbox,
      working<br>
       *                as warningYesNoCancel.<br>
       * @param caption Message box title. The application name is added
      to<br>
       *                the title. The default title is i18n("Warning").<br>
       * @param buttonYes The text for the first button.<br>
       *                  The default is KStandardGuiItem::yes().<br>
       * @param buttonNo  The text for the second button.<br>
       *                  The default is KStandardGuiItem::no().<br>
       * @param buttonCancel  The text for the third button.<br>
       *                  The default is KStandardGuiItem::cancel().<br>
       * @param dontAskAgainName If provided, a checkbox is added with
      which<br>
       *                further questions can be turned off. If turned
      off<br>
       *                all questions will be automatically answered
      with the<br>
       *                last answer (either Yes or No).<br>
       *                The string is used to lookup and store the
      setting<br>
       *                in the applications config file.<br>
       *                The setting is stored in the "Notification
      Messages" group.<br>
       *                If @p dontAskAgainName starts with a ':' then
      the setting<br>
       *                is stored in the global config file.<br>
       * @param options  see Options<br>
       *<br>
       * @return  @p Yes is returned if the Yes-button is pressed. @p No
      is returned<br>
       *          if the No-button is pressed. @p Cancel is retunred if
      the Cancel-<br>
       *          button is pressed.<br>
       *<br>
       * To be used for questions "Do you want to save your changes?"<br>
       * The text should explain the implication of choosing 'No'.<br>
       *<br>
       * The default button is "Yes". Pressing "Esc" selects "Cancel"<br>
       */<br>
      KWIDGETSADDONS_EXPORT ButtonCode warningYesNoCancelList(QWidget
      *parent,<br>
              const QString &text,<br>
              const QStringList &strlist,<br>
              const QString &caption = QString(),<br>
              const KGuiItem &buttonYes = KStandardGuiItem::yes(),<br>
              const KGuiItem &buttonNo = KStandardGuiItem::no(),<br>
              const KGuiItem &buttonCancel =
      KStandardGuiItem::cancel(),<br>
              const QString &dontAskAgainName = QString(),<br>
              Options options = Notify);<br>
    </font>====================================<font face="Courier New,
      Courier, monospace" style="font-family:"Courier New",Courier,monospace;color:rgb(0,0,0)"><font face="sans-serif" style="font-family:sans-serif;color:rgb(0,0,0)"><br>
        <br>
        So the description in the comment clearly says the default
        button is "Yes".<br>
        I take this to mean "the leftmost button having the initial
        focus".<br>
        Also note the order of these buttons is 1="Yes", 2="No",
        3="Cancel".<br>
        <br>
        Now looking in konsole-20.12.1/src/MainWindow.cpp,  at line 620,
        I see this:<br>
        <br>
        ====================================<br>
        <font face="Courier New, Courier, monospace" style="font-family:"Courier New",Courier,monospace;color:rgb(0,0,0)">result =
          KMessageBox::warningYesNoCancelList(this,<br>
              i18ncp("@info",<br>
              "There is a process running in this window. "<br>
              "Do you still want to quit?",<br>
              "There are %1 processes running in this window. "<br>
              "Do you still want to quit?",<br>
              processesRunning.count()),<br>
              processesRunning,<br>
              i18nc("@title", "Confirm Close"),<br>
              KGuiItem(i18nc("@action:button",<br>
                  "Close &Window"),<br>
                  QStringLiteral("window-close")),<br>
              KGuiItem(i18nc("@action:button",<br>
                  "Close Current &Tab"),<br>
                  QStringLiteral("tab-close")),<br>
              KStandardGuiItem::cancel(),<br>
              // don't ask again name is wrong but I can't update.<br>
              // this is not about tabs anymore. it's about empty tabs
          *or* splits.<br>
              QStringLiteral("CloseAllTabs"));</font><br>
      </font></font><font face="Courier New, Courier, monospace" style="font-family:"Courier New",Courier,monospace;color:rgb(0,0,0)"><font face="sans-serif" style="font-family:sans-serif;color:rgb(0,0,0)">====================================<br>
      </font></font><br>
    So here, the first button is "Close Window" as "Yes", the second is
    "Close Current Tab" as "No" and the third is "Cancel" as "Cancel".<br>
    So absolutely correct.<br>
    <br>
    Therefore "Close Window" should be shown as the leftmost button and
    having the initial focus.<br>
    <br>
    Yet, when actually running Konsole, the first (leftmost) button with
    initial focus is "Cancel", and "Close Window" is the rightmost
    button, which is exactly backwards from the stated behavior of
    KMessageBox.<br>
    <br>
    Now my opinion is that this is a bug from KWidgets/KMessageBox and
    not from Konsole, and I base this opinion on the fact that this
    behavior is common to other KDE programs, for instance Konqueror or
    KWrite.<br>
    I attached to this message screenshots of these confirmation dialogs
    from Konsole and Konqueror for reference.<br>
    <br>
    My question for the readers of this message is: did any of the
    Konsole developers notice this backward behavior of the buttons in
    KMessageBox?<br>
    <br>
    Has anybody tried to figure out a way to fix this, and, if so, can
    they share their findings here?<br>
    <br>
    I just want to figure out how to get the buttons back in the correct
    order with the focus on the first.<br>
    Maybe someone can suggest how to do this?<br>
    Maybe reverse the order of the buttons in the
    warningYesNoCancelList() function call in <font face="Courier New,
      Courier, monospace" style="font-family:"Courier New",Courier,monospace;color:rgb(0,0,0)"><font face="sans-serif" style="font-family:sans-serif;color:rgb(0,0,0)">konsole-20.12.1/src/MainWindow.cpp</font></font>
    ?  Would that do it?<br>
  </div>

</blockquote></div></div>