return;
}
- /* This is a plain unmap, so withdraw the window. */
- withdraw(c);
+ if (c->parent != c->screen->root) {
+ XUnmapWindow(dpy, c->parent);
+ XReparentWindow(dpy, c->parent, c->screen->root, c->size.x, c->size.y);
+ }
+
+ XRemoveFromSaveSet(dpy, c->window);
+ Client_SetState(c, WithdrawnState);
+
+ /*
+ * Flush and ignore any errors. X11 sends us an UnmapNotify before it
+ * sends us a DestroyNotify. That means we can get here without knowing
+ * whether the relevant window still exists.
+ */
+ ignore_badwindow = 1;
+ XSync(dpy, False);
+ ignore_badwindow = 0;
c->internal_state = INormal;
}
getWindowName(c);
Client_SetActive(c, c == current, 0L);
} else if (e->atom == XA_WM_TRANSIENT_FOR) {
- getTransientFor(c);
+ c->trans = None;
+ XGetTransientForHint(dpy, c->window, &(c->trans));
} else if (e->atom == XA_WM_NORMAL_HINTS) {
getNormalHints(c);
}
/* --- End of administrator-configurable defaults. --- */
-/*
- * Window manager mode. wm is in one of five modes: it's either getting
- * user input to move/reshape a window, getting user input to make a
- * selection from the menu, waiting for user input to confirm a window close
- * (by releasing a mouse button after prssing it in a window's box),
- * waiting for user input to confirm a window hide (by releasing a mouse
- * button after prssing it in a window's frame),
- * or it's `idle' --- responding to events arriving
- * from the server, but not directly interacting with the user.
- * OK, so I lied: there's a sixth mode so that we can tell when wm's still
- * initialising.
- */
+/* Set of states the window manager can be in. */
typedef enum {
wm_initialising,
wm_idle,
unsigned long black; /* Black pixel value. */
unsigned long white; /* White pixel value. */
unsigned long gray; /* Gray pixel value. */
-
Cursor root_cursor;
Cursor box_cursor;
Cursor cursor_map[E_LAST];
};
typedef struct Client {
- strcut Client* next; /* Next window in client list. */
+ struct Client* next; /* Next window in client list. */
Window window; /* Client's window. */
Window parent; /* Window manager frame. */
Window trans; /* Window that client is a transient for. */
extern void getWindowName(Client *);
extern void getNormalHints(Client *);
extern void manage(Client *, int);
-extern void withdraw(Client *);
-extern void getTransientFor(Client *);
/* mouse.c */
extern void getMousePosition(int *, int *);
}
/* Get the WM_TRANSIENT_FOR property (see ICCCM section 4.1.2.6). */
- getTransientFor(c);
+ c->trans = None;
+ XGetTransientForHint(dpy, c->window, &(c->trans));
/* Work out details for the Client structure from the hints. */
if (hints && (hints->flags & InputHint))
}
}
-void
-getTransientFor(Client *c) {
- Window trans = None;
-
- XGetTransientForHint(dpy, c->window, &trans);
- c->trans = trans;
-}
-
-void
-withdraw(Client *c) {
- if (c->parent != c->screen->root) {
- XUnmapWindow(dpy, c->parent);
- XReparentWindow(dpy, c->parent, c->screen->root, c->size.x, c->size.y);
- }
-
- XRemoveFromSaveSet(dpy, c->window);
- Client_SetState(c, WithdrawnState);
-
- /*
- * Flush and ignore any errors. X11 sends us an UnmapNotify before it
- * sends us a DestroyNotify. That means we can get here without knowing
- * whether the relevant window still exists.
- */
- ignore_badwindow = 1;
- XSync(dpy, False);
- ignore_badwindow = 0;
-}
-
static int
getProperty(Window w, Atom a, Atom type, long len, unsigned char **p) {
Atom real_type;