XSetWMName fails to set the window title
Jon Kristensen
jon.kristensen at dedikerad.se
Tue Jun 12 12:56:22 PDT 2007
tis 2007-06-12 klockan 16:33 +0100 skrev Glynn Clements:
> Jon Kristensen wrote:
>
> > I have a little problem using the X11 library, and I thought there might
> > be someone on this list that wanted to help me out a bit. If this mail
> > is off-topic or something, then I'm sorry.
> >
> > I want to set the window title, and below follows how I try to do it. I
> > know that the window handle unsigned long is correct, becuase I've
> > converted the number to hex and compared it to the output of `xwininfo'.
> >
> > I get no errors, the window title just doesn't get set.
> >
> > Any help would be greatly appreciated! :o)
>
> > // Code for GNU systems goes here. We open the X11 display.
> > static Display *display = XOpenDisplay (NULL);
>
> You should use the Display* which is associated with the window. A
> different Display* (even if it happens to refer to the same X server)
> may not work, as the X server will see two different clients: one owns
> the window, the other is calling XSetWMName(). The fact that both
> connections belong to the same process doesn't count (X may not even
> be aware of this, particularly if TCP connections are used).
>
> Although I'm not certain that this is the cause of your problem, it
> could be, and I don't see anything else wrong with the code.
Thank you so very much for your reply, I've been trying to solve it on
my own but havn't succeded! It means a lot!
I have two questions:
1) How do I get the Display* that is associated with the window, like
you describe?
2) If this isn't the problem, how would you go about isolating the
problem? XSetWMName() returns void so I can't check for info there. I
call XSetWMName 15 times and tried recording the X events using Xnee*
but since I only got event ids and other numbers, it didn't give me very
much. The output from Xnee follows.
(Note that request range 18-20 covers X_ChangeProperty, X_DeleteProperty
and X_GetProperty.)
jon at localhost ~/Desktop/Xnee-2.06 $ ./cnee/src/cnee --record --request-range 18-20
####################################
# System information #
####################################
# Date: 2007:06:12
# Time: 21:50:54
# Xnee program: cnee
# Xnee version: 2.06
# Xnee home: http://www.gnu.org/software/xnee/
# Xnee info mailing list: info-xnee at gnu.org
# Xnee bug mailing list: bug-xnee at gnu.org
# X version: 11
# X revision: 0
# X vendor: The X.Org Foundation
# X vendor release: 70200000
# Record version major: 1
# Record version minor: 13
# OS name: Linux
# OS Release: 2.6.20-gentoo-r8
# OS Version: #7 SMP Mon Jun 4 19:23:47 CEST 2007
# Machine: x86_64
# Nodename: localhost
# Display name: :0.0
# Dimension: 3200x1200
##############################################
# Xnee application arguments #
##############################################
# ./cnee/src/cnee --record --request-range 18-20
##############################################
# Displays #
##############################################
# display :0.0
# distribute
##############################################
# Files #
##############################################
# out-file stdout
# err-file stderr
##############################################
# Key Grabs #
##############################################
# stop-key 0
# pause-key 0
# resume-key 0
# insert-key 0
# exec-key 0
# exec-key xnee-exec-no-program
##############################################
# Recording limits etc #
##############################################
events-to-record -1
data-to-record -1
seconds-to-record -1
first-last 0
# Record all (including current) clients or only future ones
all-clients
# future-clients
# Store the starting mouse position
# store-mouse-position
##############################################
# Resolution #
##############################################
# Resolution
#recorded-resolution 3200x1200
#replay-resolution 1x1
#resolution-adjustment 0
##############################################
# Speed #
##############################################
# Speed
#speed-percent 100
##############################################
# Replaying limits etc #
##############################################
max-threshold 20
min-threshold 20
tot-threshold 40
##############################################
# Feedback #
##############################################
#feedback-none
#feedback-stderr
feedback-xosd
##############################################
# Various #
##############################################
# Plugin file
# plugin (null)
# Modes (currently not used)
#synchronised-replay 1
# Replay offset
#xnee_replay_offset 0x0
# Human printout of X11 data (instead of Xnee format)
# human-printout
# Delay before starting record/replay
# time 0
# Various
#########################################
# Record settings #
#########################################
# data_flags 7
# rState 5444448
# xids[0] 3
# xids[1] 0
# Number of Ranges 1
# RecordRange[0]
request-range 18-20
reply-range 0-0
extension-request-major-range 0-0
extension-request-minor-range 0-0
extension-reply-major-range 0-0
extension-reply-minor-range 0-0
delivered-event-range 21-21
device-event-range 0-0
error-range 0-0
[...]
NEW-WINDOW:1205,324:48234498,48234498,10531943,0,0,0:5x24+800+600:0,0:Imonia 0.1
1,18,18,7,48234498,981748
1,18,18,7,48234498,981748
1,20,20,6,48234498,981748
1,20,20,6,48234498,981748
1,18,18,10,48234498,981748
1,18,18,8,48234498,981748
1,18,18,6,48234498,981748
1,18,18,17,121,981748
1,18,18,17,121,981748
1,20,20,6,121,981748
1,20,20,6,10531943,981748
1,20,20,6,121,981748
1,20,20,6,10531943,981748
1,20,20,6,10531943,981748
1,18,18,6,10485763,981749
1,20,20,6,48234498,981749
1,20,20,6,10531943,981749
1,20,20,6,48234498,981749
1,18,18,6,10485763,981749
1,20,20,6,48234498,981749
1,20,20,6,48234498,981749
1,18,18,6,48234498,981749
1,20,20,6,48234498,981749
1,20,20,6,48234498,981749
1,18,18,6,48234498,981749
1,20,20,6,48234498,981749
1,20,20,6,48234498,981750
1,18,18,8,48234498,981750
1,20,20,6,48234498,981750
1,18,18,17,121,981750
1,18,18,17,121,981750
1,20,20,6,31457294,981750
1,20,20,6,48234498,981750
1,20,20,6,31457294,981750
1,20,20,6,31457294,981750
1,18,18,8,121,981750
1,20,20,6,48234498,981750
1,20,20,6,10496463,981750
1,18,18,8,121,981751
1,20,20,6,10496463,981751
1,20,20,6,48234498,981763
1,20,20,6,10496463,981763
1,18,18,17,121,981773
1,18,18,17,121,981773
1,18,18,8,121,981783
1,18,18,8,121,981784
1,20,20,6,48234498,981795
1,20,20,6,31457294,981795
1,20,20,6,48234498,981795
1,20,20,6,10531943,981795
1,20,20,6,48234498,981795
1,20,20,6,10531943,981795
1,20,20,6,48234498,981795
1,20,20,6,48234498,981795
1,20,20,6,48234498,981795
1,20,20,6,48234498,981795
1,20,20,6,48234498,981795
1,20,20,6,48234498,981796
1,20,20,6,48234498,981796
1,20,20,6,31457294,981796
1,20,20,6,31457294,981796
1,20,20,6,48234498,981796
1,20,20,6,31457294,981796
1,20,20,6,48234498,981796
1,20,20,6,48234498,981796
1,20,20,6,48234498,981796
1,18,18,7,121,981796
1,20,20,6,48234498,981796
1,20,20,6,48234498,981796
1,20,20,6,48234498,981796
1,20,20,6,48234498,981796
1,20,20,6,48234498,981796
1,20,20,6,48234498,981796
1,20,20,6,48234498,981796
1,20,20,6,48234498,981796
1,20,20,6,48234498,981797
1,20,20,6,48234498,981797
1,20,20,6,48234498,981797
1,20,20,6,48234498,981797
1,20,20,6,48234498,981797
1,20,20,6,48234498,981797
1,20,20,6,48234498,981797
1,20,20,6,48234498,981797
1,20,20,6,48234498,981797
1,20,20,6,48234498,981797
1,20,20,6,48234498,981797
1,20,20,6,48234498,981797
1,18,18,10,12582915,981807
1,18,18,18,12582915,981807
1,18,18,12,12582915,981807
1,18,18,12,12582915,981807
1,18,18,12,12582915,981807
1,18,18,12,12582915,981807
1,20,20,6,12582915,981807
1,20,20,6,12582915,981815
1,20,20,6,12582915,981815
1,20,20,6,12582915,981815
1,18,18,10,27263019,981816
1,18,18,10,29360205,981816
1,18,18,10,29368388,981816
1,18,18,10,31457294,981816
1,18,18,10,31460657,981816
1,18,18,10,33554524,981816
1,18,18,10,33557916,981817
1,18,18,10,48234498,981817
1,20,20,6,48234498,981828
1,20,20,6,121,981839
1,20,20,6,121,981839
1,20,20,6,121,981839
1,20,20,6,12582915,981839
1,20,20,6,12582915,981839
1,20,20,6,12582915,981839
1,20,20,6,12582915,981839
1,18,18,10,12582915,981840
1,18,18,18,12582915,981840
1,18,18,12,12582915,981840
1,18,18,12,12582915,981840
1,18,18,12,12582915,981840
1,18,18,12,12582915,981840
1,20,20,6,12582915,981840
1,20,20,6,12582915,981840
1,20,20,6,12582915,981841
1,20,20,6,12582915,981841
1,20,20,6,12582915,981925
1,20,20,6,12582915,981925
1,20,20,6,12582915,981925
1,20,20,6,12582915,981925
1,20,20,6,121,981973
1,18,18,17,121,983186
1,18,18,17,121,983186
1,20,20,6,121,983186
1,20,20,6,48234498,983186
1,20,20,6,48234498,983212
1,18,18,7,31457294,983213
1,18,18,17,121,983213
1,18,18,17,121,983213
1,18,18,8,121,983213
1,18,18,8,121,983214
1,18,18,17,121,983214
1,18,18,17,121,983214
1,18,18,8,121,983214
1,18,18,8,121,983214
1,20,20,6,31457294,983214
1,20,20,6,121,983215
1,20,20,6,48234498,983215
1,20,20,6,10531943,983215
1,20,20,6,121,983215
1,20,20,6,10531943,983215
1,20,20,6,10531943,983215
1,20,20,6,121,983215
1,20,20,6,48234498,983216
1,20,20,6,121,983216
1,20,20,6,10496463,983216
1,18,18,10,12582915,983216
1,18,18,18,12582915,983216
1,18,18,12,12582915,983216
1,18,18,12,12582915,983216
1,18,18,12,12582915,983216
1,18,18,12,12582915,983216
1,20,20,6,10496463,983217
1,20,20,6,31457294,983217
1,20,20,6,31457294,983217
1,20,20,6,31457294,983217
1,20,20,6,31457294,983217
1,20,20,6,48234498,983217
1,20,20,6,48234498,983217
1,20,20,6,48234498,983218
1,20,20,6,12582915,983318
1,20,20,6,12582915,983318
1,20,20,6,12582915,983318
1,20,20,6,12582915,983318
1,20,20,6,31457294,983318
1,20,20,6,12582915,983321
1,20,20,6,31457294,983321
1,18,18,7,121,983321
1,20,20,6,12582915,983321
1,20,20,6,31457294,983321
1,20,20,6,31457294,983321
1,20,20,6,12582915,983321
1,20,20,6,31457294,983321
1,20,20,6,31457294,983321
1,20,20,6,12582915,983321
1,20,20,6,31457294,983323
1,20,20,6,31457294,983323
1,20,20,6,31457294,983323
1,20,20,6,31457294,983323
1,18,18,7,121,984710
1,18,18,6,10485763,984751
1,18,18,16,121,984811
1,18,18,16,121,984811
1,19,19,3,48234498,984811
1,19,19,3,48234498,984811
1,18,18,8,48234498,984811
1,20,20,6,121,984818
1,20,20,6,121,984818
1,18,18,10,12582915,984825
1,18,18,18,12582915,984825
1,18,18,12,12582915,984825
1,18,18,12,12582915,984825
1,18,18,12,12582915,984825
1,18,18,12,12582915,984825
1,20,20,6,12582915,984826
1,20,20,6,12582915,984826
1,20,20,6,12582915,984826
1,20,20,6,12582915,984826
1,18,18,10,27263019,984826
1,18,18,10,29360205,984826
1,18,18,10,29368388,984826
1,18,18,10,31457294,984827
1,18,18,10,31460657,984827
1,18,18,10,33554524,984827
1,18,18,10,33557916,984827
1,20,20,6,12582915,984837
1,20,20,6,12582915,984837
1,20,20,6,12582915,984837
1,20,20,6,12582915,984837
1,18,18,17,31457339,984850
1,18,18,17,31457339,984850
1,18,18,17,31457339,984850
1,18,18,17,31457339,984850
1,18,18,16,121,985946
1,18,18,16,121,985946
1,20,20,6,121,985947
1,20,20,6,31457294,985947
1,20,20,6,31457294,985947
1,18,18,7,31460657,985947
1,20,20,6,121,985947
1,20,20,6,31457294,985947
1,18,18,16,121,985947
1,18,18,16,121,985947
1,20,20,6,10496463,985947
1,20,20,6,121,985948
1,20,20,6,10496463,985948
1,18,18,8,121,985948
1,18,18,8,121,985948
1,18,18,16,121,985948
1,18,18,16,121,985948
1,18,18,8,121,985948
1,18,18,8,121,985949
1,20,20,6,31460657,985949
1,20,20,6,10496463,985962
1,20,20,6,121,985963
1,20,20,6,31457294,985963
1,20,20,6,121,985963
1,20,20,6,10514266,985963
1,20,20,6,10514266,985963
1,20,20,6,121,985963
1,20,20,6,31460657,985963
1,20,20,6,121,985963
1,20,20,6,31460657,985963
1,18,18,10,12582915,985964
1,18,18,18,12582915,985964
1,18,18,12,12582915,985964
1,18,18,12,12582915,985964
1,18,18,12,12582915,985964
1,18,18,12,12582915,985964
1,20,20,6,12582915,985964
1,20,20,6,12582915,985964
1,20,20,6,12582915,985964
1,20,20,6,12582915,985964
1,20,20,6,31460657,985964
1,20,20,6,31460657,985964
1,20,20,6,31457294,985964
1,20,20,6,31457294,985964
1,20,20,6,31457294,985965
1,20,20,6,31460657,985965
1,20,20,6,31460657,985965
1,18,18,7,121,985966
1,20,20,6,31460657,986056
1,20,20,6,12582915,986058
1,20,20,6,31460657,986058
1,20,20,6,31460657,986058
1,20,20,6,12582915,986058
1,20,20,6,31460657,986059
1,20,20,6,31460657,986059
1,20,20,6,12582915,986059
1,20,20,6,31460657,986059
1,20,20,6,31460657,986059
1,20,20,6,12582915,986059
1,20,20,6,31460657,986059
1,18,18,7,31460657,986090
1,20,20,6,31460657,986090
sighandler SIGINT (2)
--
Jon Kristensen
More information about the xorg
mailing list