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 322202 - display hostname of remote Xclients in the title bar
display hostname of remote Xclients in the title bar
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: general
trunk
Other Linux
: Normal enhancement
: ---
Assigned To: Metacity maintainers list
Metacity maintainers list
Depends on:
Blocks:
 
 
Reported: 2005-11-23 03:52 UTC by Danielle Madeley
Modified: 2005-11-23 17:08 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
Patch (3.30 KB, patch)
2005-11-23 03:53 UTC, Danielle Madeley
needs-work Details | Review
visual demonstration (24.29 KB, image/png)
2005-11-23 03:53 UTC, Danielle Madeley
  Details
refactoring per Elijah's comments (3.64 KB, patch)
2005-11-23 09:08 UTC, Danielle Madeley
needs-work Details | Review
final update (3.62 KB, patch)
2005-11-23 16:08 UTC, Danielle Madeley
accepted-commit_now Details | Review

Description Danielle Madeley 2005-11-23 03:52:59 UTC
When running Xclients on remote machines forwarding to your Xserver. It is
useful to know what machine the Xclient is running on (eg. if you're upgrading
multiple machines with a tool like Synaptic).

Discussion on the topic is on the list:
    http://mail.gnome.org/archives/desktop-devel-list/2005-November/msg00135.html

This patch will add "(on $machine)" to any machines that have WM_CLIENT_MACHINE
set to something other than the hostname of the machine running metacity.
Comment 1 Danielle Madeley 2005-11-23 03:53:31 UTC
Created attachment 55128 [details] [review]
Patch
Comment 2 Danielle Madeley 2005-11-23 03:53:55 UTC
Created attachment 55129 [details]
visual demonstration
Comment 3 Elijah Newren 2005-11-23 06:22:16 UTC
Thanks for the patch.  I personally think it makes sense for this kind of mixed
mode thing (I'd like it when I use it), and it should work no different than now
for both the everything-runs-locally and LTSP cases; however, Havoc is more
familiar with all the weird cases out there.  Havoc, can you think of anything
that this might be problematic for?

Anyway, some comments on the patch:

- No tabs allowed in Metacity code.  Tabs are Evil (TM).  ;-)

- coding style is to have braces two spaces further indented than the if/else
(the code between braces is still an extra two spaces beyond the braces); i.e.
gtk+ style.

- I'd rather have set_title_text() take an Atom parameter so that it can be
defined by as
  /**
   * Called by set_window_title and set_icon_title to set the value of
   * *target to an appropriately modified version of title.  Also sets the
   * specified atom if the window title is modified.
   */
i.e. have the meta_prop_set_utf8_string_hint() inside that function too.

- I'd rather remove the triple else that comes up in set_title_text(); leaving
it there would make it harder to make other title modifications.  Besides, I
think it'd be easier to just start a new if at the end that sets the utf8 string
hint property if modified is true and otherwise does the necessary string duping
to set *target.

- If a window has no title and is running on a different machine than metacity,
should it have a blank title or a title that merely states that it's running on
a different machine?  Your code does the first but it seems that the second
would be more consistent.
Comment 4 Danielle Madeley 2005-11-23 09:08:44 UTC
Created attachment 55139 [details] [review]
refactoring per Elijah's comments
Comment 5 Elijah Newren 2005-11-23 14:28:16 UTC
Looks good, just two more nitpicks:

- As per elsewhere in the code, stuff in an if/else branch that is not
surrounded by spaces should only be indented two more spaces over instead of four.

- The boolean check on atom seems a little weird (I had to go searching through
documentation to figure out what it meant and whethere it was okay; maybe I
should have known but I didn't).  I'd prefer it changed to "atom != None", so
that it's a little clearer.  It's still not the kind of thing we really check
anywhere (functions which take an atom only accept valid atoms seems to be the
convention) so it still stands out but I guess it doesn't hurt.
Comment 6 Danielle Madeley 2005-11-23 15:46:10 UTC
1. Ok. My apologies. I'm not highly familiar with the coding style. For
reference, is there a useful set of vim instructions to get this sort of indenting?

2. This is my fault. I kinda assumed that Atom was secretly a (void *) (which I
recall is popular in X land). I just wanted to check that something bad hadn't
been passed. Also perhaps to allow the function to be used without an Atom
(useful?).

Did you just want to clean it up and commit it at the same time, or did you want
me to send you another version?
Comment 7 Elijah Newren 2005-11-23 15:56:28 UTC
No worries; thanks for putting up with all the nitpicks.  :)  I think a large
number of the issues were due my having not been very clear when we talked in
IRC; sorry about that.  Anyway, I have no clue about how to modify vim to get
appropriate indentation and I don't know whether or not it's useful to to allow
the function to be used without an Atom (it's just not the kind of thing we do
elsewhere so thus the reason I started looking stuff up).  Havoc would have to
comment on the atom stuff.

Go ahead and attach a new version; I think this is pretty cool, but Havoc still
needs to approve it.
Comment 8 Danielle Madeley 2005-11-23 16:08:20 UTC
Created attachment 55152 [details] [review]
final update
Comment 9 Havoc Pennington 2005-11-23 17:01:10 UTC
Comment on attachment 55152 [details] [review]
final update

The patch seems fine to me; I don't honestly know if it will hose up ltsp (not
sure how that usually works), I think if it does cause big problems for an ltsp
setup we should consider reverting the patch. But fine to commit and give it a
shot.
Comment 10 Danielle Madeley 2005-11-23 17:08:02 UTC
2005-11-24  Davyd Madeley  <davyd@fugro-fsi.com.au>

        * src/window-props.c: display hostname in titlebar for remote X
          clients. Closes bug #322202.