client_search_focus_tree_full(self)) &&
/* this checks for focus=false for the window */
(!settings || settings->focus != 0) &&
- /* note the check against Type_Normal/Dialog, not client_normal(self),
- which would also include other types. in this case we want more
- strict rules for focus */
+ /* note the check against type Normal/Dialog/Utility,
+ not client_normal(self), which would also include other types.
+ in this case we want more strict rules for focus */
(self->type == OB_CLIENT_TYPE_NORMAL ||
+ self->type == OB_CLIENT_TYPE_UTILITY ||
self->type == OB_CLIENT_TYPE_DIALOG))
{
activate = TRUE;
}
+ /* remove the client's border */
+ XSetWindowBorderWidth(ob_display, self->window, 0);
+
/* adjust the frame to the client's size before showing or placing
the window */
frame_adjust_area(self->frame, FALSE, TRUE, FALSE);
"program + user specified" :
"BADNESS !?")))), placew, placeh);
+ /* splash screens are also returned as TRUE for transient,
+ and so will be forced on screen below */
transient = place_client(self, &placex, &placey, settings);
/* make sure the window is visible. */
place.c or by the user are allowed partially
off-screen and on xinerama divides (ie,
it is up to the placement routines to avoid
- the xinerama divides) */
+ the xinerama divides)
+
+ splash screens get "transient" set to TRUE by
+ the place_client call
+ */
transient ||
(!(self->positioned & USPosition) &&
client_normal(self) &&
the visible screen area on its monitor. Use basically the same rules
for forcing the window on screen in the client_find_onscreen call.
- do this after place_client, it chooses the monitor! */
+ do this after place_client, it chooses the monitor!
+
+ splash screens get "transient" set to TRUE by
+ the place_client call
+ */
if (transient ||
(!(self->sized & USSize) &&
client_normal(self) &&
/* fit the window inside the area */
if (placew > a.width || self->area.height > a.height) {
- placew = MAX(MIN(MIN(self->area.width, a.width),
- self->max_size.width),
- self->min_size.width);
- placeh = MAX(MIN(MIN(self->area.height, a.height),
- self->max_size.height),
- self->min_size.height);
+ placew = MIN(self->area.width, a.width);
+ placeh = MIN(self->area.height, a.height);
ob_debug("setting window size to %dx%d\n",
self->area.width, self->area.height);
g_free(settings);
ob_debug("Managed window 0x%lx plate 0x%x (%s)\n",
- window, self->frame->plate, self->class);
+ window, self->frame->window, self->class);
return;
}
GSList *it;
ob_debug("Unmanaging window: 0x%x plate 0x%x (%s) (%s)\n",
- self->window, self->frame->plate,
+ self->window, self->frame->window,
self->class, self->title ? self->title : "");
g_assert(self != NULL);
self->functions = OB_CLIENT_FUNC_MOVE | OB_CLIENT_FUNC_RESIZE;
self->decorations = 0; /* unmanaged windows have no decor */
+ /* give the client its border back */
+ XSetWindowBorderWidth(ob_display, self->window, self->border_width);
+
client_move_resize(self, a.x, a.y, a.width, a.height);
}
{
client_configure(self, self->area.x, self->area.y,
self->area.width, self->area.height,
- self->border_width, FALSE, TRUE);
+ FALSE, TRUE);
}
void client_update_wmhints(ObClient *self)
do this before applying the states so they have the correct
pre-max/pre-fullscreen values
*/
- client_configure(self, x, y, w, h, self->border_width, FALSE, TRUE);
+ client_configure(self, x, y, w, h, FALSE, TRUE);
ob_debug("placed window 0x%x at %d, %d with size %d x %d\n",
self->window, self->area.x, self->area.y,
self->area.width, self->area.height);
}
-void client_configure(ObClient *self, gint x, gint y, gint w, gint h, gint b,
+void client_configure(ObClient *self, gint x, gint y, gint w, gint h,
gboolean user, gboolean final)
{
gint oldw, oldh;
SIZE_SET(self->logical_size, logicalw, logicalh);
/* figure out if we moved or resized or what */
- moved = x != self->area.x || y != self->area.y;
- resized = w != self->area.width || h != self->area.height ||
- b != self->border_width;
+ moved = (x != self->area.x || y != self->area.y);
+ resized = (w != self->area.width || h != self->area.height);
oldw = self->area.width;
oldh = self->area.height;
RECT_SET(self->area, x, y, w, h);
- self->border_width = b;
/* for app-requested resizes, always resize if 'resized' is true.
for user-requested ones, only resize if final is true, or when
/* if the client is enlarging, then resize the client before the frame */
if (send_resize_client && (w > oldw || h > oldh)) {
- XWindowChanges changes;
- changes.x = -self->border_width;
- changes.y = -self->border_width;
- changes.width = MAX(w, oldw);
- changes.height = MAX(h, oldh);
- changes.border_width = self->border_width;
- XConfigureWindow(ob_display, self->window,
- CWX|CWY|CWWidth|CWHeight|CWBorderWidth,
- &changes);
- /* resize the plate to show the client padding color underneath */
+ XResizeWindow(ob_display, self->window, MAX(w, oldw), MAX(h, oldh));
frame_adjust_client_area(self->frame);
}
FALSE, StructureNotifyMask, &event);
}
- /* if the client is shrinking, then resize the frame before the client */
- if (send_resize_client && (w <= oldw && h <= oldh)) {
- /* resize the plate to show the client padding color underneath */
- frame_adjust_client_area(self->frame);
+ /* if the client is shrinking, then resize the frame before the client.
- if (send_resize_client) {
- XWindowChanges changes;
- changes.x = -self->border_width;
- changes.y = -self->border_width;
- changes.width = w;
- changes.height = h;
- changes.border_width = self->border_width;
- XConfigureWindow(ob_display, self->window,
- CWX|CWY|CWWidth|CWHeight|CWBorderWidth,
- &changes);
- }
+ both of these resize sections may run, because the top one only resizes
+ in the direction that is growing
+ */
+ if (send_resize_client && (w <= oldw || h <= oldh)) {
+ frame_adjust_client_area(self->frame);
+ XResizeWindow(ob_display, self->window, w, h);
}
XFlush(ob_display);
static void client_bring_windows_recursive(ObClient *self,
guint desktop,
gboolean helpers,
- gboolean modals)
+ gboolean modals,
+ gboolean iconic)
{
GSList *it;
for (it = self->transients; it; it = g_slist_next(it))
- client_bring_windows_recursive(it->data, desktop, helpers, modals);
+ client_bring_windows_recursive(it->data, desktop,
+ helpers, modals, iconic);
if (((helpers && client_helper(self)) ||
- (modals && self->modal))&&
- self->desktop != desktop && self->desktop != DESKTOP_ALL)
+ (modals && self->modal)) &&
+ ((self->desktop != desktop && self->desktop != DESKTOP_ALL) ||
+ (iconic && self->iconic)))
{
- client_set_desktop(self, desktop, FALSE);
+ if (iconic && self->iconic)
+ client_iconify(self, FALSE, TRUE, FALSE);
+ else
+ client_set_desktop(self, desktop, FALSE);
}
}
void client_bring_helper_windows(ObClient *self)
{
- client_bring_windows_recursive(self, self->desktop, TRUE, FALSE);
+ client_bring_windows_recursive(self, self->desktop, TRUE, FALSE, FALSE);
}
void client_bring_modal_windows(ObClient *self)
{
- client_bring_windows_recursive(self, self->desktop, FALSE, TRUE);
+ client_bring_windows_recursive(self, self->desktop, FALSE, TRUE, TRUE);
}
gboolean client_focused(ObClient *self)