Thank you for this patch. I am not that sure if we really should apply it. There are two reasons against it. First accepting all the property changed notifications is an extra burden for the program, currently we don't need to know about them (Except for my new code to avoid the style test windows). Second I don't really know what to do when we know that the desktop has been changed. Your code currently just looks this event and you suggest that we should then move all the windows to the new desktop. But is this what the user expects? When I move one window to another desktop, I want just that window there. When I want all of them to move, I apply functionality of my pager to do so. Are you using this differently?
Fred Yen-Ju Chen wrote: > This is an unfinished patch for _NET_WM_DESKTOP as a demonstration. > The idea is that when one of the window of an application is moved to > another virtual desktop, > the menu, app icon, floating panel, etc. should also be moved to the > same desktop. > WindowMaker current do that, I think, but it should be done by GNUstep > so that users of all desktop environment can benefit. > > This patch only shows how to receive event for _NET_WM_DESKTOP > and retrieve the new desktop. > But I don't know how to get all windows belonging to the same application. > To change desktop of window, just send a client message: > http://standards.freedesktop.org/wm-spec/wm-spec-1.4.html#id2511177 > > Yen-Ju > > > ------------------------------------------------------------------------ > > Index: Source/x11/XGServerWindow.m > =================================================================== > --- Source/x11/XGServerWindow.m (revision 25397) > +++ Source/x11/XGServerWindow.m (working copy) > @@ -1897,7 +1897,7 @@ > | EnterWindowMask > | LeaveWindowMask > | FocusChangeMask > -// | PropertyChangeMask > + | PropertyChangeMask > // | ColormapChangeMask > | KeymapStateMask > | VisibilityChangeMask > Index: Source/x11/XGServerEvent.m > =================================================================== > --- Source/x11/XGServerEvent.m (revision 25397) > +++ Source/x11/XGServerEvent.m (working copy) > @@ -1311,6 +1311,36 @@ > NSDebugLLog(@"NSEvent", @"%d PropertyNotify - '%s'\n", > xEvent.xproperty.window, > XGetAtomName(dpy, xEvent.xproperty.atom)); > + { > + Atom XG_NET_WM_DESKTOP = XInternAtom(dpy, "_NET_WM_DESKTOP", > False); > + if (xEvent.xproperty.atom == XG_NET_WM_DESKTOP) > + { > +// NSLog(@"Change desktop"); > + unsigned long *data = NULL; > + Atom prop = XInternAtom(dpy, "_NET_WM_DESKTOP", False); > + Atom type_ret; > + int format_ret; > + unsigned long after_ret, count; > + int result = XGetWindowProperty(dpy, > xEvent.xproperty.window, prop, > + 0, 0x7FFFFFFF, False, XA_CARDINAL, > + &type_ret, &format_ret, &count, > + &after_ret, (unsigned char **)&data); > + if ((result != Success)) > + { > + NSLog(@"Error: cannot get _NET_WM_DESKTOP of > client"); > + if (data) > + { > + XFree(data); > + data = NULL; > + } > + break; > + } > + int desktop = (int)*data; > + XFree(data); > + data = NULL; > + NSLog(@"New desktop %d", desktop); > + } > + } > break; > > // a client successfully reparents a window > > _______________________________________________ Gnustep-dev mailing list [email protected] http://lists.gnu.org/mailman/listinfo/gnustep-dev
