[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: KWin::info.pid
From:       Nathan Gray <n8gray () caltech ! edu>
Date:       2003-06-24 22:52:17
[Download RAW message or body]

Roger Larsson wrote:

> On tisdagen den 24 juni 2003 07.15, Nathan Gray wrote:
> 
>> Can anybody tell me why the pid would be zero in KWin::Info but calling
>> proc->processIdentifier() gives the right value?
> 
> A bug in KWin::info constructor?
> 
> 
>>         KWin::Info inf = KWin::info( *it );
> 
> Step/read through it to see what happens with the pid field...

I don't have a debug version of KDE installed so stepping through would be
difficult.  I tracked down the place it must be failing though.  It's in
kdelibs-3.1/kdecore/netwm.cpp at the end of NETWinInfo::update.  This is
the code:

        p->pid = 0;
        if (XGetWindowProperty(p->display, p->window, net_wm_pid, 0l, 1l,
                               False, XA_CARDINAL, &type_ret, &format_ret,
                               &nitems_ret, &unused, &data_ret) == Success) {
            if (type_ret == XA_CARDINAL && format_ret == 32 && 
                        nitems_ret == 1) {
                p->pid = *((long *) data_ret);
            }
            if ( data_ret )
                XFree(data_ret);
        }

One of the first two if's must be failing but I'm not sure why.

Ah, now I'm noticing something interesting.  *All* nedit windows return pid
0 in the loop.  It must be something about NEdit not setting the window
property.  If anybody knows what a client needs to do to make the code
above work please let me know.  In the meantime I'll try to figure it out
for myself.

Thanks,
-n8

-- 
>>>-- Nathaniel Gray -- Caltech Computer Science ------>
>>>-- Mojave Project -- http://mojave.cs.caltech.edu -->

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic