C Function to print window's pid

View: New views
3 Messages — Rating Filter:   Alert me  

C Function to print window's pid

by Teika Kazura :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

(to: janek cc: sawfish-list) Hi. Attached is the patch to print
window's pid.

void printWindowPID(int winId);
is declared extern, so you can call it from everywhere.

It works for live windows, but if you call it from error_handler() in
display.c, it segfaults at the call of Fget_x_property, leaving the
following message:

sawfish: xcb_xlib.c:41: xcb_xlib_lock: Assertion `!c->xlib.lock' failed.
rep: received fatal signal: Aborted
rep: received fatal signal: Segmentation fault

I can't solve this, since I don't know X.

Good luck!
Teika (Teika kazura)


a.patch.bz2 (2K) Download Attachment

Re: C Function to print window's pid

by Timo Korvola-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wednesday 04 November 2009 14:24:06 Teika Kazura wrote:
> It works for live windows, but if you call it from error_handler() in
> display.c, it segfaults at the call of Fget_x_property,

Error handlers basically aren't allowed to talk to the X server.  See
XSetErrorHandler(3).  That is why there is that mess with
emit_pending_destroys.

--
        Timo Korvola <URL:http://www.iki.fi/tkorvola>

Re: C Function to print window's pid

by Janek Kozicki :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Teika Kazura said:     (by the date of Wed, 04 Nov 2009 21:24:06 +0900 (JST))

> (to: janek cc: sawfish-list) Hi. Attached is the patch to print
> window's pid.
>
> void printWindowPID(int winId);
> is declared extern, so you can call it from everywhere.
>
> It works for live windows, but if you call it from error_handler() in
> display.c, it segfaults at the call of Fget_x_property, leaving the
> following message:
>
> sawfish: xcb_xlib.c:41: xcb_xlib_lock: Assertion `!c->xlib.lock' failed.
> rep: received fatal signal: Aborted
> rep: received fatal signal: Segmentation fault
>
> I can't solve this, since I don't know X.


Thanks a lot for your effort, it is invaluable - I'd never found this
out myself :)

I hope to do all that testing on Friday... but also I caught an
autumn cold this week, and my free time is better spent in bed than
with sawfish :/ But if not this week, then surely the next one ;)

thanks!
--
Janek Kozicki                                                         |