Forum: wxRuby question concerning missing window id's after linux upgrade

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
21fd983a229ec237916b188932301169?d=identicon&s=25 tom (Guest)
on 2011-08-23 20:52
(Received via mailing list)
Hi all,

A while ago I wrote a mediacenter-app, which basically acts as a
frontend to play mythtv-recordings, my entire dvd-library, and also does
some other stuff, none of which really important.  The playout-stuff is
handled by mplayer, which connects to a Wx::Panel using the window-id
(mplayer -wid <window id> etc).  The window-id was hard to find -
get_handle didn't appear to give me the right id (even though I've heard
a wx-python guy say it works for him), so I just executed 'xwininfo
-tree -name Media', ran some regexps on that, and found the id I was
looking for.  Everything worked!

Skip to 2 days ago, when I finally upgraded my ubuntu from 8.04 to 10.04
(not because I want to stay on LTS, but I had issues getting wxruby to
work on later versions).  After some tweaks everything seems to work
perfectly - except the tiny detail that I don't see anything being
played by mplayer.  I get sound, so mplayer is doing its best, but all I
see is a red screen (red being the background-color for the panel
mplayer should attach to, so it's not *that* abnormal).
After some testing, I stumbled upon the following.  On my old ubuntu
(it's dual boot until everything works), running xwininfo gives me
something like this:

$ xwininfo -tree -name TestCase

xwininfo: Window id: 0x32000a5 "TestCase"

   Root window id: 0x255 (the root window) (has no name)

   Parent window id: 0xc0011c (has no name)

      2 children:

      0x32000a8 (has no name): ()  600x400+0+0  +3+797

         1 child:

         0x32000a9 (has no name): ()  600x400+0+0  +3+797

            1 child:

            0x32000aa (has no name): ()  600x400+0+0  +3+797

               1 child:

               0x32000ab (has no name): ()  600x400+0+0  +3+797

                  1 child:

                  0x32000ac (has no name): ()  600x400+0+0  +3+797

                     1 child:

                     0x32000ad (has no name): ()  600x400+0+0  +3+797

                        1 child:

                        0x32000b5 (has no name): ()  400x200+-1+-1

                           1 child:

                           0x32000b6 (has no name): ()  400x200+0+0

      0x32000a6 (has no name): ()  1x1+-1+-1  +2+796

However, when I run the same command on the new ubuntu, with the exact
same TestCase-app running, I get:

$ xwininfo -tree -name TestCase

xwininfo: Window id: 0x40000a8 "TestCase"

   Root window id: 0x102 (the root window) (has no name)

   Parent window id: 0x2a3bc3c (has no name)

      1 child:

      0x40000a9 (has no name): ()  1x1+-1+-1  +0+50

The 'TestCase' application is a Wx::App in which a Wx::Frame is created,
a Panel (p1) is created with said frame as parent, and another panel
(p2) is created with p1 as parent.  In the first xwininfo, I can attach
mplayer to p2 using 0x32000b6, to p1 using 0x32000ad, and to the frame,
using 0x32000a5.  Why those and what all the other children etc. are?  I
have absolutely no idea.  But it works.

Using the second xwininfo, I only have 2 'viable' id's, the first one
being of the frame (which works - I can attach mplayer to the frame and
it will work, but that's not what I want to do), and the second one
being the id my app tries to use, with aforementioned results.

Long story short: something has changed in either wx or
X/gnome/whatever, and I'm wondering whether there's another way to let
mplayer connect with a Wx::Panel, or whether I should drop the
upgrade-plan altogether and stick to 8.04?

thanks in advance!

This topic is locked and can not be replied to.