Menu

#1097 BadFont error using multiple X servers

obsolete: 8.3.2
open
6
2002-10-08
2001-11-19
No

The script below documents and demonstrates the
problem. I've worked around this in my environment, so
it isn't urgent for me, but it would be nice if it
could be fixed or documented as a limitation.

Ken Fitch

#
# This tk/tcl script demonstrates the X BadFont
error thrown when
# we set up a toplevel for display on an X server
that is different
# from the X server derived from "-display" or
the
# DISPLAY environment
# variable.
#
# Using multiple screens on a single X server
host seems to be OK
#
# This problem was seen on a Solaris system
running Tk/Tcl 8.3.2
#
# To test on your system:
#
# - you need X server access to some
other machine on your
# network
#
# - invoke as "wish <this script>"
# (it should exit normally)
#
# - invoke as "wish <this script>
-display <remote_X_server>:0.0"
# (it should throw a BadFont
error)
#
# Alternatively, you can edit the X_screen line
to use a remote X server
# and omit the "-display" stuff. The key is to
get the "." window and the
# ".my_toplevel" windows to be rendered on
different hosts.
#
##################################################################################
#
# I'm not sure if there's an easy (or hard) fix
for this or not. This does
# not seem to me to be a common case, so it may
be sufficient to simply
# document the behavior. I have no idea what
would happen on a non-Unix system.
#
# It would be nice if the code could detect the
situation, and at least
# circumvent the X error(s).
#
#

set X_screen ":0.0"

eval font create symbolic_font

set window [toplevel .my_toplevel -screen $X_screen]
button $window.button -text "Touch here" -font
symbolic_font

puts "default window screen: [winfo screen .]"
puts "my_toplevel window screen: [winfo screen
.my_toplevel]"

puts "about to delete named font symbolic_font ..."
font delete symbolic_font
update

puts "about to create named font symbolic_font ..."
font create symbolic_font
update
puts "taking a nap ..."
after 3000
puts "exiting normally"
exit

Discussion

  • Jeffrey Hobbs

    Jeffrey Hobbs - 2002-07-24

    Logged In: YES
    user_id=72656

    I do get the error:

    default window screen: lorax:0.0
    my_toplevel window screen: woset:0.0
    about to delete named font symbolic_font ...
    about to create named font symbolic_font ...
    X Error of failed request: BadFont (invalid Font parameter)
    Major opcode of failed request: 55 (X_CreateGC)
    Resource id in failed request: 0x200000b
    Serial number of failed request: 57
    Current serial number in output stream: 63

    which likely indicates some info about the font is not cleared
    properly, or some error should be thrown since you can't
    really delete a named font while it is still in use.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2002-10-08
    • priority: 5 --> 6
    • assigned_to: hobbs --> hobbs
     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2002-10-08

    Logged In: YES
    user_id=72656

    Richard did a lot of work on multiple display cleanup ...
    passing to him as he may have a quick solution.

     
MongoDB Logo MongoDB