Web lists-archives.com

Re: Aw: Re: setWindowIcon for QDialog

Hi Alexander,

according to the xprop output the _NET_WM_ICON property is not set. The method inside Qt responsible for this is: https://code.woboq.org/qt5/qtbase/src/plugins/platforms/xcb/qxcbwindow.cpp.html#_ZN10QXcbWindow13setWindowIconERK5QIcon

This method is called indirectly from QWidget::setWindowIcon. I am pretty sure that it works as you can easily check by xprop any other Qt window. So the problem must be the icon. If I search for labplot-worksheet I find only an icon in size 22x22. Looking at the linked code, I notice that it's not one of the sizes Qt expects and also none of the sizes KWin expects, see https://cgit.kde.org/kwin.git/tree/client.cpp#n1583

My suggestion is to try whether any other icon works. And if it does so, ensure that all relevant icon sizes are available for the labplot-worksheet.


Am 2019-03-04 17:39, schrieb Alexander Semke:
not shown in the window bar, left to the window title. Please check
the attached screenshots. On windows the proper icon is shown, on
linux/kwin the applicaion icon is used.

It's X. The output of xprop:

_KDE_NET_WM_DESKTOP_FILE(UTF8_STRING) = "org.kde.labplot2"
XdndAware(ATOM) = BITMAP
WM_NAME(STRING) = "Import Data to Spreadsheet or Matrix"
_NET_WM_NAME(UTF8_STRING) = "Import Data to Spreadsheet or Matrix --
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x7, 0x26, 0x1e, 0x3, 0x0
WM_CLIENT_LEADER(WINDOW): window id # 0x5000008
                Client accepts input or input focus: True
                Initial state is Normal State.
WM_CLASS(STRING) = "labplot2", "labplot2"
                user specified location: 819, 262
                user specified size: 536 by 711
                program specified minimum size: 522 by 711
                window gravity: Static

P.S.: sorry for html and for the full-quote, writing from the

GESENDET: Montag, 04. März 2019 um 15:08 Uhr
VON: "David Edmundson" <david@xxxxxxxxxxxxxxxxxxxx>
AN: kde-devel <kde-devel@xxxxxxx>, "Kwin, NET API, kwin styles API,
kwin modules API" <kwin@xxxxxxx>
BETREFF: Re: setWindowIcon for QDialog
On Mon, Mar 4, 2019 at 1:49 PM Aleix Pol <aleixpol@xxxxxxx> wrote:

On Sun, Mar 3, 2019 at 11:00 AM Alexander Semke
<alexander.semke@xxxxxx> wrote:
> Hi,
> in LabPlot we have couple of modal dialogs, created on the heap
and shown with
> dlg->exec(). The dialog icon is set in the constructor of the
dialog via
> QDialog::setWindowIcon(), e.g.
> The icon is set/handled by the window manager if I understand this
> With kwin, the specified icons are not shown

Not shown where exactly?
Also X or xwayland?
Does running xprop and clicking on the window show the correct icon?