Exemple #1
0
        void addClient(XWindow w)
        {
            XWindowAttributes attr;
              XWMHints hints;

              client_window_list.Add (w);

              Client c = new Client ();
              client_list.Add (c);
              dpy.GrabServer ();

              initializeClient (c);

              c.window = w;

              queryClientName (c);

              c.trans = w.GetTransientForHint ();

              attr = c.window.GetAttributes ();

              c.x = attr.x;
              c.y = attr.y;
              c.width = attr.width;
              c.height = attr.height;
              c.border_width = attr.border_width;
              c.size = w.GetNormalHints ();

              c.old_x = c.x;
              c.old_y = c.y;
              c.old_width = c.width;
              c.old_height = c.height;

              if (attr.map_state == XMapState.IsViewable) {
            c.ignore_unmap++;

            initClientPosition (c);

            hints = w.GetWMHints ();

            if ((hints.flags & XWMHintFlags.StateHint) == XWMHintFlags.StateHint)
              setWMState (c.window, hints.initial_state);
            else
              setWMState (c.window, XWindowState.NormalState);
              }

              gravitateClient (c, GRAVITY.APPLY_GRAVITY);

              reparentClient (c);

              unhideClient (c);

              if (focus_model == FOCUS.FOCUS_CLICK)
            c.window.SetInputFocus (XInputFocus.RevertToNone);

              dpy.Sync (false);
              dpy.UngrabServer ();
        }