gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Support _NET_WM_DESKTOP


From: Yen-Ju Chen
Subject: Re: Support _NET_WM_DESKTOP
Date: Tue, 21 Aug 2007 07:45:27 -0700

On 8/21/07, Fred Kiefer <address@hidden> wrote:
> 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?

  This is the situation I try to solve:
  A user opens a new document of Ink.app in desktop 1
  and decide to move that document to desktop 2
  with window manager or any other X program.
  Then he realizes the menu and app icon of Ink.app still stay in desktop 1
  and he has to move them to desktop 2 one-by-one.
  If it is the case of Gorm, then he has a lot of windows to move.

  So the ideal case is that if one of the windows belonging to the
same application
  is moved to another desktop, menu, app icon and floating panel should follow.

  The patch is not completed.
  It is just to show how to know when client window changes
  desktop by other X program.

  Yen-Ju

>
> 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
> >
> >
>
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]