Bug 382789 - Certain Xwayland applications do not have a window title
Summary: Certain Xwayland applications do not have a window title
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: core (other bugs)
Version First Reported In: git master
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL: https://phabricator.kde.org/D7046
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-27 09:07 UTC by Fabian Vogt
Modified: 2017-08-21 16:11 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:
mgraesslin: Wayland+
mgraesslin: X11-
mgraesslin: ReviewRequest+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Vogt 2017-07-27 09:07:14 UTC
Applications like "glxgears" and "xterm" have an empty window title, although WM_NAME is set correctly (the name of the binary).
Comment 1 Martin Flöser 2017-07-27 14:49:00 UTC
WM_NAME is not used for window title.
Comment 2 Fabian Vogt 2017-07-27 14:52:07 UTC
(In reply to Martin Flöser from comment #1)
> WM_NAME is not used for window title.

glxgears has only two properties that have the value "glxgears", which is shown as a window title in a pure X11 session:

> WM_ICON_NAME(STRING) = "glxgears"
> WM_NAME(STRING) = "glxgears"

So I'm not sure where else the title/caption would come from.
Comment 3 Martin Flöser 2017-07-27 17:06:16 UTC
Relevant code is:

QString Client::readName() const
{
    if (info->name() && info->name()[0] != '\0')
        return QString::fromUtf8(info->name()).simplified();
    else
        return KWindowSystem::readNameProperty(window(), XCB_ATOM_WM_NAME).simplified();
}

I assume KWindowSystem::readNameProperty does not work on Wayland
Comment 4 Martin Flöser 2017-07-27 17:24:24 UTC
And readNameProperty is problematic. It's still XLib based and thus we cannot use it from within Wayland where we only have xcb.
Comment 5 Martin Flöser 2017-08-01 19:37:04 UTC
Patch at https://phabricator.kde.org/D7046
Comment 6 Martin Flöser 2017-08-21 16:11:01 UTC
Git commit c87230c3a5feb6b31938189bd3dd69eaee490def by Martin Flöser.
Committed on 21/08/2017 at 15:58.
Pushed by graesslin into branch 'master'.

Use xcb-icccm to read the name property

Summary:
The KWindowSystem call which we used doesn't work on Wayland as it's only
implemented in the xcb variant and cannot be made available for Wayland
in an easy way as it is still XLib based.

This change turns the optional XCB-ICCCM dependency in a required one
and thus can use the functionality provided by said library to implement
what KWindowSystem provided.

Test Plan: New test case which failed with old code

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7046

M  +1    -1    CMakeLists.txt
M  +23   -0    autotests/integration/x11_client_test.cpp
M  +22   -3    client.cpp

https://commits.kde.org/kwin/c87230c3a5feb6b31938189bd3dd69eaee490def