updated on Thu Jan 26 12:02:26 UTC 2012
[aur-mirror.git] / tvtime_patched / tvtime-setpid.patch
blob755655cd8426e0570330deba307ed946f0f9d514
1 --- a/src/xcommon.c 2005-08-14 19:36:52.000000000 +0200
2 +++ b/src/xcommon.c 2010-03-07 17:55:52.669570209 +0100
3 @@ -25,6 +25,7 @@
4 #include <stdio.h>
5 #include <stdlib.h>
6 #include <string.h>
7 +#include <unistd.h>
9 #if defined(__FreeBSD__)
10 #include <machine/param.h>
11 @@ -106,6 +107,7 @@
12 static Atom wm_delete_window;
13 static Atom xawtv_station;
14 static Atom xawtv_remote;
15 +static Atom net_wm_pid;
17 #ifdef HAVE_XTESTEXTENSION
18 static KeyCode kc_shift_l; /* Fake key to send. */
19 @@ -150,11 +152,12 @@
20 "WM_PROTOCOLS",
21 "WM_DELETE_WINDOW",
22 "_XAWTV_STATION",
23 - "_XAWTV_REMOTE"
24 + "_XAWTV_REMOTE",
25 + "_NET_WM_PID"
27 - Atom atoms_return[ 17 ];
28 + Atom atoms_return[ 18 ];
30 - XInternAtoms( display, atom_names, 17, False, atoms_return );
31 + XInternAtoms( display, atom_names, 18, False, atoms_return );
32 net_supporting_wm_check = atoms_return[ 0 ];
33 net_supported = atoms_return[ 1 ];
34 net_wm_name = atoms_return[ 2 ];
35 @@ -172,6 +175,7 @@
36 wm_delete_window = atoms_return[ 14 ];
37 xawtv_station = atoms_return[ 15 ];
38 xawtv_remote = atoms_return[ 16 ];
39 + net_wm_pid = atoms_return[ 17 ];
42 static uint32_t icon_colours[256];
43 @@ -1017,6 +1021,16 @@
44 free( data );
48 + /* Set _NET_WM_PID */
49 + {
50 + if( xcommon_verbose ) {
51 + fprintf( stderr, "xcommon: try to set _NET_WM_PID" );
52 + }
53 + pid_t mypid = getpid();
54 + XChangeProperty(display, wm_window, net_wm_pid, cardinal, 32,
55 + PropModeReplace, (const unsigned char*) &mypid, 1);
56 + }
58 if( check_for_EWMH_wm( display, &wmname ) ) {
59 if( xcommon_verbose ) {