}
}
XFree(children);
-
- if (config_focus_new)
- focus_fallback(OB_FOCUS_FALLBACK_NOFOCUS);
}
void client_manage(Window window)
(resized && config_redraw_resize))));
/* if the client is enlarging, the resize the client before the frame */
- if (!user || (send_resize_client && (w > oldw || h > oldh)))
+ if (send_resize_client && user && (w > oldw || h > oldh))
XResizeWindow(ob_display, self->window, MAX(w, oldw), MAX(h, oldh));
/* move/resize the frame to match the request */
}
/* if the client is shrinking, then resize the frame before the client */
- if (user && (send_resize_client && (w <= oldw || h <= oldh)))
+ if (send_resize_client && (!user || (w <= oldw || h <= oldh)))
XResizeWindow(ob_display, self->window, w, h);
XFlush(ob_display);
if (iconic) {
if (self->functions & OB_CLIENT_FUNC_ICONIFY) {
+ long old;
+
+ old = self->wmstate;
self->wmstate = IconicState;
+ if (old != self->wmstate)
+ PROP_MSG(self->window, kde_wm_change_state,
+ self->wmstate, 1, 0, 0);
+
self->ignore_unmaps++;
/* we unmap the client itself so that we can get MapRequest
events, and because the ICCCM tells us to! */
changed = TRUE;
}
} else {
+ long old;
+
if (curdesk)
client_set_desktop(self, screen_desktop, FALSE);
+
+ old = self->wmstate;
self->wmstate = self->shaded ? IconicState : NormalState;
+ if (old != self->wmstate)
+ PROP_MSG(self->window, kde_wm_change_state,
+ self->wmstate, 1, 0, 0);
+
XMapWindow(ob_display, self->window);
/* this puts it after the current focused window */
self->shaded == shade) return; /* already done */
/* when we're iconic, don't change the wmstate */
- if (!self->iconic)
- self->wmstate = shade ? IconicState : NormalState;
+ if (!self->iconic) {
+ long old;
+
+ old = self->wmstate;
+ self->wmstate = shade ? IconicState : NormalState;
+ if (old != self->wmstate)
+ PROP_MSG(self->window, kde_wm_change_state,
+ self->wmstate, 1, 0, 0);
+ }
+
self->shaded = shade;
client_change_state(self);
/* resize the frame to just the titlebar */
void client_unfocus(ObClient *self)
{
- g_assert(focus_client == self);
+ if (focus_client == self) {
#ifdef DEBUG_FOCUS
- ob_debug("client_unfocus for %lx\n", self->window);
+ ob_debug("client_unfocus for %lx\n", self->window);
#endif
- focus_fallback(OB_FOCUS_FALLBACK_UNFOCUSING);
+ focus_fallback(OB_FOCUS_FALLBACK_UNFOCUSING);
+ }
}
void client_activate(ObClient *self, gboolean here)
}
return dest;
}
+
+ObClient* client_under_pointer()
+{
+ int x, y;
+ GList *it;
+ ObClient *ret = NULL;
+
+ if (screen_pointer_pos(&x, &y)) {
+ for (it = stacking_list; it != NULL; it = it->next) {
+ if (WINDOW_IS_CLIENT(it->data)) {
+ ObClient *c = WINDOW_AS_CLIENT(it->data);
+ if (c->desktop == screen_desktop &&
+ RECT_CONTAINS(c->frame->area, x, y)) {
+ ret = c;
+ break;
+ }
+ }
+ }
+ }
+ return ret;
+}