View | Details | Raw Unified | Return to bug 48951
Collapse All | Expand All

(-)a/libwnck/application.c (-1 / +1 lines)
Lines 524-530 _wnck_application_create (Window xwindow, Link Here
524
  if (application->priv->name)
524
  if (application->priv->name)
525
    application->priv->name_from_leader = TRUE;
525
    application->priv->name_from_leader = TRUE;
526
526
527
  application->priv->pid = _wnck_get_pid (xscreen,
527
  application->priv->pid = _wnck_get_pid (screen,
528
                                          application->priv->xwindow);
528
                                          application->priv->xwindow);
529
529
530
  application->priv->startup_id = _wnck_get_utf8_property (xscreen,
530
  application->priv->startup_id = _wnck_get_utf8_property (xscreen,
(-)a/libwnck/window.c (-1 / +1 lines)
Lines 510-516 _wnck_window_create (Window xwindow, Link Here
510
    _wnck_get_session_id (xscreen, window->priv->xwindow);
510
    _wnck_get_session_id (xscreen, window->priv->xwindow);
511
511
512
  window->priv->pid =
512
  window->priv->pid =
513
    _wnck_get_pid (xscreen, window->priv->xwindow);
513
    _wnck_get_pid (screen, window->priv->xwindow);
514
514
515
  window->priv->x = 0;
515
  window->priv->x = 0;
516
  window->priv->y = 0;
516
  window->priv->y = 0;
(-)a/libwnck/wnck-resource-usage.c (-13 / +13 lines)
Lines 126-150 wnck_gulong_equal (gconstpointer a, Link Here
126
}
126
}
127
127
128
static gulong
128
static gulong
129
wnck_check_window_for_pid (Screen *screen,
129
wnck_check_window_for_pid (WnckScreen *screen,
130
                           Window  win,
130
                           Window      win,
131
                           XID     match_xid,
131
                           XID         match_xid,
132
                           XID     mask)
132
                           XID         mask)
133
{
133
{
134
  if ((win & ~mask) == match_xid)
134
  if ((win & ~mask) == match_xid)
135
    return _wnck_get_pid (screen, win);
135
    return _wnck_get_pid (screen, win);
136
136
137
  return 0;
137
  return 0;
138
}
138
}
139
139
140
static void
140
static void
141
wnck_find_pid_for_resource_r (Display *xdisplay,
141
wnck_find_pid_for_resource_r (Display    *xdisplay,
142
                              Screen  *screen,
142
                              WnckScreen *screen,
143
                              Window   win_top,
143
                              Window      win_top,
144
                              XID      match_xid,
144
                              XID         match_xid,
145
                              XID      mask,
145
                              XID         mask,
146
                              gulong  *xid,
146
                              gulong     *xid,
147
                              gulong  *pid)
147
                              gulong     *pid)
148
{
148
{
149
  Status   qtres;
149
  Status   qtres;
150
  int      err;
150
  int      err;
Lines 250-259 wnck_pid_read_resource_usage_fill_cache (struct xresclient_state *state) Link Here
250
250
251
  for (i = 0; i < ScreenCount (state->xdisplay); i++)
251
  for (i = 0; i < ScreenCount (state->xdisplay); i++)
252
    {
252
    {
253
      Screen *screen;
253
      WnckScreen *screen;
254
      Window  root;
254
      Window  root;
255
255
256
      screen = ScreenOfDisplay (state->xdisplay, i);
256
      screen = wnck_handle_get_screen (_wnck_get_handle (), i);
257
      root = RootWindow (state->xdisplay, i);
257
      root = RootWindow (state->xdisplay, i);
258
258
259
      if (root == None)
259
      if (root == None)
(-)a/libwnck/xutils.c (-6 / +10 lines)
Lines 1147-1196 _wnck_get_session_id (Screen *screen, Link Here
1147
1147
1148
#ifdef HAVE_XRES
1148
#ifdef HAVE_XRES
1149
static int
1149
static int
1150
xres_get_pid (Screen *screen,
1150
xres_get_pid (WnckScreen *screen,
1151
              Window  xwindow)
1151
              Window      xwindow)
1152
{
1152
{
1153
  int pid = -1;
1153
  int pid = -1;
1154
  Screen *xscreen;
1154
  XResClientIdSpec client_spec;
1155
  XResClientIdSpec client_spec;
1155
  long client_id_count = 0;
1156
  long client_id_count = 0;
1156
  XResClientIdValue *client_ids = NULL;
1157
  XResClientIdValue *client_ids = NULL;
1157
1158
1159
  xscreen = _wnck_screen_get_xscreen (screen);
1160
1158
  client_spec.client = xwindow;
1161
  client_spec.client = xwindow;
1159
  client_spec.mask = XRES_CLIENT_ID_PID_MASK;
1162
  client_spec.mask = XRES_CLIENT_ID_PID_MASK;
1160
1163
1161
  if (XResQueryClientIds (DisplayOfScreen (screen), 1, &client_spec,
1164
  if (XResQueryClientIds (DisplayOfScreen (xscreen), 1, &client_spec,
1162
                          &client_id_count, &client_ids) == Success)
1165
                          &client_id_count, &client_ids) == Success)
1163
    {
1166
    {
1164
      long i;
1167
      long i;
1165
1168
1166
      for (i = 0; i < client_id_count; i++)
1169
      for (i = 0; i < client_id_count; i++)
1167
        {
1170
        {
1168
          pid = XResGetClientPid (&client_ids[i]);
1171
          pid = XResGetClientPid (&client_ids[i]);
1169
          if (pid != -1)
1172
          if (pid != -1)
1170
            break;
1173
            break;
1171
        }
1174
        }
1172
1175
1173
      XResClientIdsDestroy (client_id_count, client_ids);
1176
      XResClientIdsDestroy (client_id_count, client_ids);
1174
    }
1177
    }
1175
1178
1176
  return pid;
1179
  return pid;
1177
}
1180
}
1178
#endif
1181
#endif
1179
1182
1180
int
1183
int
1181
_wnck_get_pid (Screen *screen,
1184
_wnck_get_pid (WnckScreen *screen,
1182
               Window  xwindow)
1185
               Window      xwindow)
1183
{
1186
{
1184
  int pid = -1;
1187
  int pid = -1;
1185
1188
1186
#ifdef HAVE_XRES
1189
#ifdef HAVE_XRES
1187
  pid = xres_get_pid (screen, xwindow);
1190
  pid = xres_get_pid (screen, xwindow);
1188
1191
1189
  if (pid != -1)
1192
  if (pid != -1)
1190
    return pid;
1193
    return pid;
1191
#endif
1194
#endif
1192
1195
1193
  if (!_wnck_get_cardinal (screen, xwindow,
1196
  if (!_wnck_get_cardinal (_wnck_screen_get_xscreen (screen),
1197
                           xwindow,
1194
                           _wnck_atom_get ("_NET_WM_PID"),
1198
                           _wnck_atom_get ("_NET_WM_PID"),
1195
                           &pid))
1199
                           &pid))
1196
    return 0;
1200
    return 0;
(-)a/libwnck/xutils.h (-2 / +2 lines)
Lines 123-130 void _wnck_change_viewport (Screen *screen, Link Here
123
123
124
char*  _wnck_get_session_id     (Screen *screen,
124
char*  _wnck_get_session_id     (Screen *screen,
125
                                 Window xwindow);
125
                                 Window xwindow);
126
int    _wnck_get_pid            (Screen *screen,
126
int    _wnck_get_pid            (WnckScreen *screen,
127
                                 Window  xwindow);
127
                                 Window      xwindow);
128
char*  _wnck_get_name           (Screen *screen,
128
char*  _wnck_get_name           (Screen *screen,
129
                                 Window  xwindow);
129
                                 Window  xwindow);
130
char*  _wnck_get_icon_name      (Screen *screen,
130
char*  _wnck_get_icon_name      (Screen *screen,

Return to bug 48951