Results 1 to 6 of 6
I am writing a media player that uses one process to play the media and another as the frontend. I am using XReparentWindow to reparent the media player window into ...
- 11-03-2008 #1Just Joined!
- Join Date
- Nov 2008
- Posts
- 3
XReparentWindow complications
I am writing a media player that uses one process to play the media and another as the frontend. I am using XReparentWindow to reparent the media player window into the frontend window.
This works fine until I try to reparent the window again, for example to go fullscreen. When I call XReparentWindow a second time I get BadDrawable errors from the media player.
Is there something I can do to prevent getting errors when calling XReparentWindow, such as handling some event? Are there any complications from reparenting a window from one process into another rather than using it in a single process?
- 11-03-2008 #2
First, there are events associated with reparenting a window. Google this:
for details.Code:man xreparentwindow
But it's more likely that the problem is that more than one process is involved. My first guess is that you're somehow communicating the window ID from one process to another. If that's the case, don't do it. If more than one process is cooperating in using the same windows, each should maintain its own list of window ID's. The X Window system runs on a thin wire model; it makes no assumption that clients are on the same host as the X Window server, or on the same host as other clients.
This might not be what's causing your problem, but it's the best I can offer.--
Bill
Old age and treachery will overcome youth and skill.
- 11-03-2008 #3Just Joined!
- Join Date
- Nov 2008
- Posts
- 3
You are correct, I am communicating the window ID from one process to another. If I can not pass the parent window ID from my frontend to the media player for use in XReparentWindow how do I obtain a usable window ID? Is there a function for retrieving a window ID for a window created by another process?
- 11-03-2008 #4I'll answer this only hesitantly. The reason I hesitate is that I suspect that this is not really the problem. I can't put a finger on it, but I suspect that there's a subtle bug elsewhere.Is there a function for retrieving a window ID for a window created by another process?
But.
What you can do is pass from one process to another the geometry (location and width and height) of the window in question. There's a good chance that there's only one such window. If there's more than one, then chances are that one is a parent of the other, and you can also pass whether you want the parent window or the child window. Then the receiving process can use XQueryTree() to find the window that corresponds to the geometry.
That's not rocket science, but it's not the sort of thing you bang out in five minutes, either. So please please please keep looking for some alternative explanation, something related to a bug somewhere.
I wish I could be more helpful.--
Bill
Old age and treachery will overcome youth and skill.
- 11-04-2008 #5Just Joined!
- Join Date
- Nov 2008
- Posts
- 3
That is certainly a possibility, but the errors only occur after calling XReparentWindow so I figured that was a good place to start looking for coding bugs. I think your suggestions have at least pointed me in the right direction. Thanks for the help.
I would still appreciate other suggestions anyone might have.
- 11-04-2008 #6Me too. Anyone else out there with ideas?I would still appreciate other suggestions anyone might have.--
Bill
Old age and treachery will overcome youth and skill.


Reply With Quote
