Make sure we set WM_CLIENT_MACHINE, WM_LOCALE_NAME and _NET_WM_PID on

X11 windows as window manager need these to map windows to processes
and we might lose functionality without them.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10710 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Pierre Ossman 2015-04-20 12:02:10 +00:00
parent 07c9526085
commit e0894bf0e1

View File

@ -355,6 +355,7 @@ static Atom fl_XaTextUriList;
static Atom fl_XaImageBmp;
static Atom fl_XaImagePNG;
static Atom fl_INCR;
static Atom fl_NET_WM_PID;
static Atom fl_NET_WM_NAME; // utf8 aware window label
static Atom fl_NET_WM_ICON_NAME; // utf8 aware window icon name
static Atom fl_NET_SUPPORTING_WM_CHECK;
@ -719,6 +720,7 @@ void fl_open_display(Display* d) {
fl_XaImageBmp = XInternAtom(d, "image/bmp", 0);
fl_XaImagePNG = XInternAtom(d, "image/png", 0);
fl_INCR = XInternAtom(d, "INCR", 0);
fl_NET_WM_PID = XInternAtom(d, "_NET_WM_PID", 0);
fl_NET_WM_NAME = XInternAtom(d, "_NET_WM_NAME", 0);
fl_NET_WM_ICON_NAME = XInternAtom(d, "_NET_WM_ICON_NAME", 0);
fl_NET_SUPPORTING_WM_CHECK = XInternAtom(d, "_NET_SUPPORTING_WM_CHECK", 0);
@ -2473,6 +2475,15 @@ void Fl_X::make_xid(Fl_Window* win, XVisualInfo *visual, Colormap colormap)
mask, &attr));
int showit = 1;
// Set WM_CLIENT_MACHINE and WM_LOCALE_NAME
XSetWMProperties(fl_display, xp->xid, NULL, NULL, NULL, 0, NULL, NULL, NULL);
// Set _NET_WM_PID
long pid;
pid = getpid();
XChangeProperty(fl_display, xp->xid, fl_NET_WM_PID,
XA_CARDINAL, 32, 0, (unsigned char *)&pid, 1);
if (!win->parent() && !attr.override_redirect) {
// Communicate all kinds 'o junk to the X Window Manager: