Can I put borders on my windows?

Discussion in 'Apple' started by uymqlp502, Dec 25, 2006.

  1. uymqlp502

    uymqlp502 Guest

    I am using my Mac as an X Window server. The xterms and other apps that
    I use have no borders. That makes things confusing when the windows
    overlap. It's hard to tell where one window starts and the other one
    ends, and I end up clicking on the wrong one very often, then having to
    find the one I wanted, which is now buried. I've looked at the system
    preferences until I'm blue in the face, but I see nothing about adding
    borders to windows. Is there a way to do it? Thanks.
    uymqlp502, Dec 25, 2006
    1. Advertisements

  2. uymqlp502

    Tom Stiller Guest

    It's not a Mac problem. Look to your X11 window server and resources
    (e.g. .xinitrc and /.Xresources).
    Tom Stiller, Dec 26, 2006
    1. Advertisements

  3. uymqlp502

    uymqlp502 Guest

    This is still driving me nuts. I figured I could at least start my
    xterms with a command-line option to put a border on them. I looked at
    the xterm help, and it shows that -w, -bw, or -borderwidth followed by
    a number should allow me to set the border width in pixels. None of
    them do a da*m thing. What is going on here? Does the Mac have a
    screwed up implementation of X or what?
    uymqlp502, Jan 14, 2007
  4. There's more than one border to consider. The one that's mentioned in
    xterm's manpage is an inner border, not related to the one that the
    window manager makes. If you've only set it to a small number, it's
    not very noticeable. (For testing, I sometimes set it to something
    like 20, and then tweak the colors so it's distinct from the vt100
    drawing area).

    But you're probably looking for the window manager's borders, which
    commonly are drawn specially.
    Thomas Dickey, Jan 14, 2007
  5. uymqlp502

    uymqlp502 Guest

    I'll take any border I can get at this point. And, yes, I set the
    border size to a large number, and I varied the colors. I get the
    border, but it stays the same color as the background, so it is
    effectively a margin. Not quite what I want.
    And how do I get that border? I thought -bw or -borderwidth were
    supposed to do that, but they don't. I figure the Mac's version of
    xterm must be screwed up.
    uymqlp502, Jan 14, 2007
  6. Perhaps not xterm. Those options are supposed to be implemented in
    the Xt library. I'd noticed some problem with the options, and hadn't
    paid much attention to it (I generally don't customize things that much,
    since it makes it harder to see the system as users do).

    The command-line options for xterm (including those implemented in Xt)
    are telling it to set specific resource values.

    For instance, this chunk from Xt/Intrinsic.c:

    {"-bordercolor","*borderColor", XrmoptionSepArg, (XtPointer) NULL},
    {"-borderwidth",".borderWidth", XrmoptionSepArg, (XtPointer) NULL},
    {"-bw", ".borderWidth", XrmoptionSepArg, (XtPointer) NULL},
    {"-display", ".display", XrmoptionSepArg, (XtPointer) NULL},
    {"-fg", "*foreground", XrmoptionSepArg, (XtPointer) NULL},

    show that -fg applies to all widgets in xterm (the "*"), but -bw applies
    only to the top-level widget (the "."). (That's if no value was already
    applied to that specific ".borderWidth" pattern).

    What I do - set it in my resource file. Depending on the system, that
    could be your $HOME/.Xdefaults file. In my systems, I set $XAPPLRESDIR
    to point to my directory containing a "XTerm" file.

    For instance (in _that_ file):

    XTerm*borderWidth: 15
    XTerm*borderColor: red

    makes xterm's that I start from the command-line have a very noticeable
    border. xterm's started from the desktop don't - they have the
    environment set without $XAPPLRESDIR - but as I commented, I use that
    for testing (and fixed some color issues in the border recently).

    xterm supports ANSI color, VT220 emulation and UTF-8
    There's an faq at
    Thomas Dickey, Jan 14, 2007
  7. uymqlp502

    uymqlp502 Guest

    Thanks, but that didn't help. I'd show you what I did, but the Mac
    won't allow me to cut from an xterm and paste into this window. I'll
    tell you I've about had it with this toy computer. I'm about ready to
    trade it in for a real computer.
    uymqlp502, Jan 14, 2007
  8. I forgot to mention that you can "always" specify one or more resource values
    on the command line, e.g.,

    xterm -xrm "XTerm*borderWidth:20"

    That sort of thing can of course be put into a shell script.
    (If _that_ doesn't work, then perhaps the Mac's got some functionality
    removed - I've not used X there, or been on a Mac for a long time).
    Thomas Dickey, Jan 14, 2007
  9. uymqlp502

    Bob Harris Guest

    You can always do a screen capture on the Mac using

    Command-Shift-3 for an entire screen shot
    Command-Shift-4 drag to select the area to capture
    Command-Shift-4-Space to select a window

    As for borders, it is my guess that this is just a window manager
    issue. X11 by default uses a thin layer between X11 and the
    MacOSX GUI, and it is my guess that not all bells and whistles of
    X11 have conversions. Just a guess.

    It is possible to install and run alternate X11 window managers.
    Check out and
    I do not know if these would be any better.

    You would copy /etc/X11/xinit/xinitrc to $HOME/.xinitrc and modify
    the last line where it says "exec quartz-wm" to start a different
    window manager.

    If you really really must have window borders, and you want a
    different OS to use them in, you could...

    If you have an intel Mac, you could just run Linux in Parallels,
    or in the VMware Fusion beta.

    If you have a PowerPC Mac, you could install something YellowDog
    Linux and I think several other distributions have PowerPC
    versions too.

    Personally, it doesn't bother me. The Shadow is more than enough
    for me to tell where the edge of a window is. I've been using X11
    on my Mac at work for 2 years solid. It has never been a problem
    for me, and I am Unix/Linux kernel developer and have been since
    '95, so I've spend a lot of time using X11.

    Bob Harris
    Bob Harris, Jan 15, 2007
  10. uymqlp502

    Steve Hix Guest

    For just a bit more context, *which* window?

    I've just done exactly that, copying text from xterm to
    And Pages, NeoOffice and OpenOffice.
    (Just tried it in this MT-Newswatcher window. Worked, too.)

    Before you go off looking for a "real computer", you might want to make
    sure you're not looking at a problem specific to a given application, or
    perhaps in assuming something works like you expect it to, rather than
    how the (new to you?) system actually works.
    Steve Hix, Jan 15, 2007
  11. uymqlp502

    uymqlp502 Guest

    The truth is that I don't really need them badly, but sometimes I get
    annoyed by little things that don't work the way they should. It *is*
    annoying to not be able to tell where one window begins and the other
    Yes, I have an Intel Mac. Good idea. I'll look into it.
    uymqlp502, Jan 15, 2007
  12. uymqlp502

    uymqlp502 Guest

    I've tried several times unsuccessfully to cut from an xterm or xemacs
    and paste into my Thunderbird email client. It just doesn't work, and
    having to retype stuff because the cut and paste doesn't work is very
    annoying. I really hope this can be fixed somehow because that is a
    significant issue.

    By the way, I am wondering if there is something better than xterm
    available for the Mac. On Sun Solaris, I have access to a terminal type
    called dtterm (if I recall correctly). I find that it is more
    convenient than xterm because when I double click on a filename, for
    example, I get the filename highlighted (xterm gets thrown off by
    special characters such as dashes, etc.) But unfortunately, when I try
    to display a dtterm on Solaris on the Mac (using the Mac as an X
    terminal), it doesn't work. It seems that many things just don't work
    on the Mac.

    The bottom line here is that I got a Mac because is is now unix based,
    but it seems to have a lot of issues yet to be resolved, particularly
    with regard to X windows.
    uymqlp502, Jan 15, 2007
  13. It's configurable (in xterm):

    Clicking the middle mouse button twice in rapid succession
    will cause all characters of the same class (e.g. letters,
    white space, punctuation) to be selected. Since different
    people have different preferences for what should be
    selected (for example, should filenames be selected as a
    whole or only the separate subnames), the default mapping
    can be overridden through the use of the charClass (class
    CharClass) resource.

    Perhaps more recent than the xterm on your system, I modified it to
    also accept regular expressions (which makes it easier to select
    complicated things like URLs).
    Thomas Dickey, Jan 15, 2007
  14. uymqlp502

    Paul Sture Guest

    Hmm - it isn't working for me either. What key combinations you use?
    I'm working with a fresh installation of X11 here, so perhaps I'm seeing
    the same thing.
    Paul Sture, Jan 15, 2007
  15. uymqlp502

    Bob Harris Guest

    This sounds like you have the drop shadow turned off. I have
    absolutely no problems telling where the edge of a window is in
    X11 windows displayed on my Mac (like I said, I've been using x11
    everyday for 2 years). Are you running something like
    "ShadowKiller" or "WindowShade X"? They kill the shadow, but then
    you can easily loose things like window edges.
    Note: VMware Fusion Beta is free right now, and it also has all
    the debugging code enabled so its performance may be sub-optimal.
    Parallels is in the $70-80 range (shop around), but Parallels has
    been out for a while now and is updated regularly.

    More on alternate window managers, and borders:

    Using and FinkCommander, I just installed vtwm,
    modified my .xinitrc to launch vtwm when starting X11 and now my
    xterm has borders just like you want.

    So you can get and use alternate window managers (I just picked on
    1 window manager via Fink, there are others). However, I'm not
    sure what if any Mac to X11 integration there is.

    By the way, I'm sticking with the default X11 window manager, but
    I figured I could use your post as an excuse to play with new

    Bob Harris
    Bob Harris, Jan 15, 2007
  16. uymqlp502

    Bob Harris Guest

    It is annoying, but you can copy from X11 to MacOSX.

    X11 Preferences -> Input -> Enable keyboard shortcuts under X11

    Now you can

    Select X11 Text
    Command-C to copy into MacOSX clipboard
    Command-V to paste into any MacOSX application

    The key being the "Enable keyboard shortcuts under X11"
    preference. After that it looks a lot like any other Mac

    Pasting from MacOSX to X11

    Select MacOSX text
    Command-C to copy into MacOSX clipboard
    Option-Click to paste into X11 application

    To make my life easier at work, I have reprogrammed my 4 button
    mouse using USB Overdrive so that when I'm in X11 one of the
    buttons does the Option-Click and when I'm in any other MacOSX
    application it does Command-V. At work I then use that button for
    most of my paste work. And yes I have another button that does
    Command-C :)

    NOTE: I do NOT know how well any of these copy/paste issues will
    work with other window managers. While I've demo'ed other window
    managers, I've never really tried to learn them. They may work
    just as well or they many totally ignore the MacOSX clipboard.
    Personally I use iTerm as my terminal. It has tabbed windows so I
    can and do have 16 or more terminal session open at the same time.

    I have modified my $HOME/.xinitrc to launch iTerm instead of xterm
    when X11 starts up (and I start X11 as a login item).

    open /Users/Shared/Applications/iTerm/iTerm &

    (you should get your first copy of .xinitrc by copying
    /Local/Applications/iTerm/iTerm is just where I put my downloaded
    iTerm. Where you put yours is up to you.

    By starting iTerm when I launch X11, it inherits DISPLAY. But you
    set DISPLAY in any MacOSX terminal application using the value

    Part 2. I do not export any xterm from a remote system to my Mac
    and X11. Rather I "ssh -Y" from iTerm to the
    remote system. The -Y exports DISPLAY for me automatically.

    Not the benefit of this to me is that iTerm is a MacOSX
    application, and all copy/paste functions work by MacOSX rules
    between MacOSX apps.

    I remember from a previous post that you use xemacs. I'm a Vim
    user (I guess we can not be friends :) ) and I spend a lot of
    time using Vim via those 16 iTerm sessions.

    I do use X11 for some gui based apps, gvimdiff, TightVNC (via the
    Fink unstable builds), Tarantella when I have to, OpenOffice (but
    I tend to use NeoOffice; the Mac port of OpenOffice), and a few
    company specific X11 gui apps.

    You can download and install other X11 terminal emulators such as
    rxvt via Fink. But like I said, I prefer iTerm as it is a MacOSX
    app that lets me do all my Unix terminal work via ssh sessions.
    I've got iTerm bookmarks that quickly login to my frequently
    visited remote systems.
    I got a Mac because it was a Mac :) I'm delighted it has a Unix
    under the hood. If you want a Sun/HP-UX/Tru64/AIX/Linux
    workstation, then MacOSX is not it.

    Then again, I think once you learn the "Secret Handshake" a MacOSX
    system can play fairly nice in a Unix world, but it will never be
    perfect. And while most things on a Mac are much easier to learn,
    X11 is not one of them, hence learning the tricks.

    Just my 2 cents.

    One more bit of advice. Go to <> and search
    for various Unix style solutions. MacOSXHints has been a great
    place finding out how to do advanced things on the Mac and a lot
    of Unix based solutions are posted there. It is an invaluable
    resource for the MacOSX/Unix user.

    Bob Harris
    Bob Harris, Jan 15, 2007
  17. uymqlp502

    Bob Harris Guest

    Make sure
    X11 -> Preferences -> Enable keyboard shortcuts under X11
    is enabled.

    With that option enabled

    Select X11 text
    Command-C puts text in MacOSX clipboard
    Command-V pastes into any MacOSX application

    Paste into X11

    Select MacOSX text
    Command-C puts text into MacOSX clipboard (like you expect)
    Option-Click pastes into X11 application

    Bob Harris
    Bob Harris, Jan 15, 2007
  18. uymqlp502

    Steve Hix Guest

    Having Thunderbird version 0.9 (20041103) here, I thought I'd try
    copying a directory listing from xterm and emailing it to me. My X11
    version is X11 1.1.3 - XFree86 4.4.0, installed from the MacOS X 10.4
    distribution DVD, updated periodically.

    Worked perfectly here. I wonder if there is some configuration problem
    with your set up, or perhaps you're using an X11 other than one that
    ships with OS X?
    Use it daily. When I'm working from home, I VPN into the work network,
    then ssh to my office workstation and fire up dtterm and some other
    Once I'm inside the company network, here's how I fire up dtterm:

    - ssh -Y <my workstation's full address> -l <my login name>

    - Go through the short dance of welcoming

    - Fire up my utilities: dtterm&; dtfile&; soffice&

    And wait awhile until they finally come up; takes a while if I'm
    telecommuting, a second or three if I'm in a lab in the same building at

    The ssh invocation works with the OS X 10.4 version of X11, but not the
    10.3 version, by the way. I think that the 10.3 version uses ssh -X ...,
    but I haven't used it, and don't have a 10.3 system available to try.

    If you're using some other X11 from some other source, things may be
    very different in some details, or not.
    There's Unix, and there's Unix; you're not going to get the same
    behavior in some details between various vendor's implementations, or
    even a given vendor over extended periods. BSD is different to sVr4, etc.
    Steve Hix, Jan 15, 2007
  19. uymqlp502

    Steve Hix Guest

    I tried two ways; going up to the Edit menu in xterm to copy the
    selection, then switch to the other application's edit menu to paste.

    Then, noting the keystrokes listed in the menus, cmd-C to copy, cmd-V to
    paste, except for OpenOffice, where paste is control-V.

    I can't think of anything I might have done at any time in the past to
    cause it to work, nor that it ever didn't work. (I still get tripped up
    over the three-button mouse handling stuff though, and I've been using
    Sun's mice for 20+ years now.)
    Steve Hix, Jan 15, 2007
  20. uymqlp502

    Steve Hix Guest

    Duh... forgot about the preferences; I just set them a long time ago and
    never checked back.
    Steve Hix, Jan 15, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.