Re: changing active window

Matthew Allum <[email protected]>
Newsgroups gmane.comp.handhelds.matchbox
Message-ID <20031103201604.GA5834@debian>
Hi;

To change the active window, you want to send a message to the root
window rather than change any properties. For example, something like
the following should do it;

void
activate_window(Display *dpy, Window root, Window win_to_activate)
{
  XEvent ev;
  Atom atom_net_active
    = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False);

  memset(&ev, 0, sizeof ev);
  ev.xclient.type = ClientMessage;
  ev.xclient.window = win_to_active;
  ev.xclient.message_type = atom_net_active;
  ev.xclient.format = 32;

  ev.xclient.data.l[0] = 0;

  XSendEvent(dpy, root, False, SubstructureRedirectMask, &ev);
}


Also see code of desktop/modules/tasks.c 

Good Luck!

  -- Matthew
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.