After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 160236 - no window title if none of the *_NAME properties are set
no window title if none of the *_NAME properties are set
Status: RESOLVED OBSOLETE
Product: metacity
Classification: Other
Component: general
2.9.x
Other Linux
: Normal minor
: ---
Assigned To: Metacity maintainers list
Metacity maintainers list
Depends on:
Blocks:
 
 
Reported: 2004-12-02 17:55 UTC by Ruben Vermeersch
Modified: 2020-11-06 20:08 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
No window title (4.21 KB, image/png)
2004-12-02 17:56 UTC, Ruben Vermeersch
  Details
Deal with apps that don't set any *_NAME properties (6.81 KB, patch)
2004-12-21 04:31 UTC, Elijah Newren
needs-work Details | Review

Description Ruben Vermeersch 2004-12-02 17:55:16 UTC
When using Java, metacity doesn't show the window titles, look at the screenshot
attached for a better idea.

I'm running metacity 2.9.0 and java 1.5
Comment 1 Ruben Vermeersch 2004-12-02 17:56:16 UTC
Created attachment 34409 [details]
No window title
Comment 2 Ruben Vermeersch 2004-12-02 17:57:45 UTC
Btw: It appears that it does work on KDE (atleast that's what I'm told, I'm not
coming anywhere near a KDE desktop)
Comment 3 Elijah Newren 2004-12-02 18:26:39 UTC
In a terminal, please type
   xprop | grep "^WM.*NAME"
then click on the title-less Java window, then copy-and-paste the terminal
output into this bug report.
Comment 4 Ruben Vermeersch 2004-12-02 21:30:01 UTC
Outputs absolutely nothing.

The full output is this:

_NET_WM_ICON_GEOMETRY(CARDINAL) = 777, 1026, 245, 24
_NET_FRAME_EXTENTS(CARDINAL) = 4, 4, 21, 4
_NET_WM_DESKTOP(CARDINAL) = 2
WM_STATE(WM_STATE):
                window state: Normal
                icon window: 0x0
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x3, 0x1, 0x1, 0x4e0050, 0x18
_NET_WM_STATE(ATOM) = 
WM_HINTS(WM_HINTS):
                Client accepts input or input focus: False
                Initial state is Normal State.
WM_NORMAL_HINTS(WM_SIZE_HINTS):
                user specified location: 0, 0
                program specified location: 0, 0
                program specified size: 435 by 183
                window gravity: NorthWest
WM_PROTOCOLS(ATOM): protocols  WM_TAKE_FOCUS, WM_DELETE_WINDOW
WM_CLASS(STRING) = "sun-awt-X11-XFramePeer", "DozoWereld"
WM_CLIENT_LEADER(WINDOW): window id # 0x3200007
Comment 5 Havoc Pennington 2004-12-06 18:07:47 UTC
There's no title set on that window... what title shows up in KDE?
Maybe it displays the WM_CLASS or something?
Comment 6 Ruben Vermeersch 2004-12-06 20:22:43 UTC
I guess it does, all I know is that the title is displayed correctly on KDE
(although I can't confirm that, haven't seen/touched KDE).

The title that should be shown is "DozoWereld", so if it would display the
WM_CLASS, it only displays the second part.
Comment 7 Elijah Newren 2004-12-21 04:31:12 UTC
Created attachment 35072 [details] [review]
Deal with apps that don't set any *_NAME properties

This patch:
  1) Moves set_window_title and set_icon_title from window-props.c to window.c
     and exports them (which includes a slight rename).
  2) Adds a title_set flag
  3) In the update_wm_class, if the title has not yet been set, then set it to
     the WM_CLASS.
Comment 8 Havoc Pennington 2004-12-21 05:29:16 UTC
Comment on attachment 35072 [details] [review]
Deal with apps that don't set any *_NAME properties

I'm a little skeptical this is a good idea unless the specs say we should do
this; maybe if twm and mwm did it at least I'd feel better. If this is a
kwin-only behavior I'd say we should back it out of kwin and get the apps
fixed.

I think I'd skip window->title_set, instead have 
window->using_wm_name
and window->using_wm_icon_name then use the class if neither other property is
in use.

Note that the whole thing is dependent on the order of loading the properties;
so we should probably check that the order is right and add a comment not to
reorder them.

To avoid the order dep we'd have to keep around the value of all three
properties and I don't want to use that memory.

if we kept title_set I think it has to be a different flag for title and icon
title.

Slightly nicer than moving set_title() into window.c might be to port
update_wm_class() into window-props.c framework (write a reload_wm_class
basically)
Comment 9 Havoc Pennington 2004-12-21 05:32:02 UTC
It'd be a nice general cleanup btw to get all the window properties into that 
initial_props array rather than having all the update_* functions.
Then you get to nuke most of the property_notify() function too.
Comment 10 Elijah Newren 2004-12-21 06:09:22 UTC
> I'm a little skeptical this is a good idea unless the specs say we should do
> this; maybe if twm and mwm did it at least I'd feel better. 

I went looking, but was unable to find anything that said we should do this. 
However, apps are not required to set any of WM_NAME, WM_ICON_NAME,
_NET_WM_NAME, or _NET_WM_ICON_NAME by either the ICCCM or EWMH.  (The EWMH does
state that apps SHOULD set it, but not MUST.  I couldn't find anything as far as
requirements for apps in the ICCCM--it seemed to focus only on WM requirements).
 So, it appears to be perfectly valid for apps to be stupid, like this Java
example.  WM behavior appears to be undefined in this case.  Maybe we should
request that the EWMH define it?

> If...I'd say we should...get the apps fixed.

Actually, I'd prefer that over this patch.  Using WM_CLASS seems like a lame
punt/hack to me.

> Note that the whole thing is dependent on the order of loading the properties

Right, and this is perhaps slightly complicated by the fact that the ICCCM
explicitly forbids WM_CLASS changes unless the window is withdrawn, whereas
there is no such requirement on any of the *_NAME properties.
 
> port update_wm_class() into window-props.c framework

Does that make sense given that the ICCCM explicitly forbids change WM_CLASS
unless the window is withdrawn?  I thought (but didn't check) that the reload_*
functions where for things that could change more dynamically...
Comment 11 Havoc Pennington 2004-12-22 21:57:30 UTC
The main point of window-props.c isn't for dynamic changes (though it simplifies
that), the main point is to load all props for a new window in a single round trip.
Comment 12 Luis Villa 2005-01-03 01:56:16 UTC
I'd hazard a guess that this is not a common case (since it has not been
reported previously) so marking minor and confirming (based on the conversation :)
Comment 13 Elijah Newren 2005-01-03 02:01:37 UTC
Fixing the title...
Comment 14 André Klapper 2020-11-06 20:08:10 UTC
bugzilla.gnome.org is being replaced by gitlab.gnome.org. We are closing all old bug reports in Bugzilla which have not seen updates for many years.

If you can still reproduce this issue in a currently supported version of GNOME (currently that would be 3.38), then please feel free to report it at https://gitlab.gnome.org/GNOME/metacity/-/issues/

Thank you for reporting this issue and we are sorry it could not be fixed.