示例#1
0
        public void maximize(Client client, bool full_screen)
        {
            if (full_screen)
              client.move_resize (0, 0, display.default_screen.width (),
            display.default_screen.height ());

            else
              client.move_resize (space);
        }
示例#2
0
        public bool grant_preference(Client client)
        {
            if (client.class_hint == null) return false;

            String id = client.class_hint.res + ":";

            // no focus
            if (pref.no_focus (id)) client.state = InternalState.NO_FOCUS;

            // register
            int keysym = '0' + pref.register (id);
            if (keysym >= '0') {
              int keycode = display.input.keysym_to_keycode (keysym);
              client.register = keycode - display.input.min_keycode;
              registers [client.register] = client;
            }

            int max_width = display.default_screen.width ();
            int max_height = display.default_screen.height ();

            // position
            Rectangle r = pref.position (id);
            if (r != null) {
              // similar to geometry parameter processing in X toolkit
              r.x = (r.x + max_width) % max_width;
              r.y = (r.y + max_height) % max_height;
              client.move_resize (r);
              return true;		// user-specified position
            }

            return false;
        }
示例#3
0
        public void manage(Client client)
        {
            if (!clients.Contains (client)) clients.Add (client);

            // ready for move and resize
            client.geometry ();

            // ready for next focus and preference
            client.class_hint = client.wm_class_hint ();

            // ready for minimize
            client.size_hints = client.wm_normal_hints ();

            // ready for info
            client.name = client.wm_name ();

            client.change_save_set (false);

            if (!grant_preference (client))
              // no position preference, do bounding box
              client.move_resize (client.rectangle ().within (space));
        }