Re: Aw: Re: setWindowIcon for QDialog

Martin Flöser <[email protected]>
Newsgroups gmane.comp.kde.devel.general,gmane.comp.kde.devel.kwin
Message-ID <[email protected]>
Am 2019-03-06 23:13, schrieb Friedrich W. H. Kossebau:
> Hi,
> 
> allow me to chime in with my AFAIK, which though is confirmed by my 
> quick look
> at the code:
> 
> Am Dienstag, 5. März 2019, 18:21:00 CET schrieb Martin Flöser:
>> 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.h
>> tml#_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
> 
> Isn't the more relevant code here the one at the start of that method?
> 
>     // First read icons from the window itself
>     const QString themedIconName = iconFromDesktopFile();
>     if (!themedIconName.isEmpty()) {
>         setIcon(QIcon::fromTheme(themedIconName));
>         return;
>     }
> 
> From what I remember, one of the issues with Wayland (and then also 
> with KWin
> & its custom X-equivalent "_KDE_NET_WM_DESKTOP_FILE") is that while 
> title
> properties for windows are supported, icons are not (something about 
> graphics
> resources and different metadata design *insert proper knowledge*). So 
> the
> window managers and running-app-instance managers take the icon name 
> only from
> the desktop file, no longer enabling to overwrite the icon for certain
> windows.
> Isn't this the issue still? At least I remember this vaguely from some 
> time
> ago.

Not in this case as the window is missing the icon property as can be 
seen in the xprop output.

But apart from that: yes if the desktop file is specified, the icon is 
preferred over the custom icon. But in this specific case it's not the 
reason.

Cheers
Martin

> 
>> 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:
>> >
>> > _NET_WM_ICON_NAME(UTF8_STRING) =
>> > _KDE_NET_WM_DESKTOP_FILE(UTF8_STRING) = "org.kde.labplot2"
>> > _KDE_NET_WM_COLOR_SCHEME(STRING) =
>> > "/usr/share/color-schemes/BreezeHighContrast.colors"
>> > XdndAware(ATOM) = BITMAP
>> > _KDE_NET_WM_USER_CREATION_TIME(CARDINAL) = 2840133529
>> > WM_NAME(STRING) = "Import Data to Spreadsheet or Matrix"
>> > _NET_WM_NAME(UTF8_STRING) = "Import Data to Spreadsheet or Matrix --
>> > labplot2"
>> > _MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x7, 0x26, 0x1e, 0x3, 0x0
>> > _NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_DIALOG,
>> > _NET_WM_WINDOW_TYPE_NORMAL
>> > _XEMBED_INFO(_XEMBED_INFO) = 0x0, 0x1
>> > WM_CLIENT_LEADER(WINDOW): window id # 0x5000008
>> >
>> > WM_HINTS(WM_HINTS):
>> >                 Client accepts input or input focus: True
>> >                 Initial state is Normal State.
>> >
>> > _NET_WM_PID(CARDINAL) = 29202
>> > _NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 83886351
>> > WM_CLASS(STRING) = "labplot2", "labplot2"
>> > WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS,
>> > _NET_WM_PING, _NET_WM_SYNC_REQUEST, _NET_WM_CONTEXT_HELP
>> >
>> > WM_NORMAL_HINTS(WM_SIZE_HINTS):
>> >                 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
>> > web-frontend...
>> >
>> > GESENDET: Montag, 04. März 2019 um 15:08 Uhr
>> > VON: "David Edmundson" <[email protected]>
>> > AN: kde-devel <[email protected]>, "Kwin, NET API, kwin styles API,
>> > kwin modules API" <[email protected]>
>> > BETREFF: Re: setWindowIcon for QDialog
>> >
>> > On Mon, Mar 4, 2019 at 1:49 PM Aleix Pol <[email protected]> wrote:
>> >> On Sun, Mar 3, 2019 at 11:00 AM Alexander Semke
>> >
>> > <[email protected]> wrote:
>> >> > With kwin, the specified icons are not shown
> 
> This quote sadly misses the possibly relevant initial " and I always 
> get the
> default application's icon shown."
> 
> Cheers
> Friedrich
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.