Closed Bug 95833 Opened 23 years ago Closed 23 years ago

In GTK frontend, nsWindow::SetTitle() is confused

Categories

(SeaMonkey :: General, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: hp, Assigned: blizzard)

References

Details

(Whiteboard: have patch; needs testing for correctness with different locales)

Attachments

(1 file, 1 obsolete file)

Bug #41786 was reported that gtk_window_set_title() didn't work with twm. 
However, this bug report was bogus; someone was using an ancient/broken twm
or something. XFetchName() is ancient cruft, use XGetWMName(). The fix for
#41786 was therefore broken, introducing #43108. Direct-to-Xlib code was put in
to handle #41786, but the solution to #43108 was to change the direct-to-Xlib
code back to work just like gtk_window_set_title() and revert the #41786 fix.
Which means that you now have code that does the same thing as
gtk_window_set_title(), but is doing some unkosher behind-gtk's-back sort of
fiddling in order to do so - kind of pointless. (Note that XmbSetWMProperties()
used by GTK is the same as what Mozilla is currently doing via XStdICCTextStyle).

Complicating matters, I assume recent CVS versions of mozilla set the
_NET_WM_NAME hint in UTF-8.

As an additional bug, the fallback case of calling gtk_window_set_title() with
Latin-1 is broken; GTK does not take Latin-1 strings, it takes strings in locale
encoding.

Suggested fix:

 - GTK should always be passed locale encoding; nuke the Latin-1 case

 - always use gtk_window_set_title(), to avoid confusing GTK and probably 
   having bugs with future GTK versions; e.g. gtk_window_get_title() really 
   ought to work

I'll attach an untested patch (I'm not really set up to compile the beast ;-)
Attached patch suggested patch (obsolete) (deleted) — Splinter Review
BTW, if gtk_window_set_title() or other GTK functions don't work, please file a
GTK bug on bugzilla.gnome.org; simply inserting a hacky workaround isn't good
for long-term maintainability. Also, Owen probably could have saved you a bunch
of time trying to figure out what to do.

Granted, GTK bugzilla didn't exist at the time those older bugs were handled. ;-)
cc'ing pavlov and blizzard
hp, this is against 0.9.2, right?
Yep, I used the rawhide SRPM
I'm marking this NEW so it gets off our radar; I assume HP knows what
he's talking about, and I've verified the code hasn't been changed.
Havoc, if you have the time to do more random code reviews like this, we
would be very grateful :)

Module owners, how reasonable does this sound to you?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment on attachment 46253 [details] [diff] [review]
suggested patch

Does this patch break bugs 41786 and 43108?  the code you are removing was put in specifically for those bugs.
Well, I explained my views on #43108 and #41786 - I think they were basically
one big wild goose chase and the current code ended up doing the same thing 
GTK does anyhow. I could be wrong, testing it isn't a terrible idea, but
plain GTK does normally work with twm. ;-)

-> blizzard@mozilla.org
Assignee: asa → blizzard
Whiteboard: have patch
Frank, would you or someone on your team be willing to take the time to test out
this patch and make sure that it works in some random locales?
Whiteboard: have patch → have patch; needs testing for correctness with different locales
I played with this patch on HPUX. The hang (see bug 108765) actually happens 
inside Xlib call. So gtk_window_set_title is as robust as the existing block of 
code. I am OK with this patch from i18n perspective. 
So, just to be clear, this patch fixes your hang?
Yes, this patch fixed my hang on HPUX.
Blocks: 104864
Attached patch remerged patch (deleted) — Splinter Review
remerged patch
Attachment #46253 - Attachment is obsolete: true
Comment on attachment 57890 [details] [diff] [review]
remerged patch

eh, seems ok to me :)
sr=alecf
Attachment #57890 - Flags: superreview+
Comment on attachment 57890 [details] [diff] [review]
remerged patch

r=bryner
Attachment #57890 - Flags: review+
Checked in on the tip.
Blocks: 108765
Attachment #57890 - Flags: approval+
Comment on attachment 57890 [details] [diff] [review]
remerged patch

a=dbaron for 0.9.6
Checked into 0.9.6, too.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: