#include "client.h"
#include "dock.h"
+#include "xerror.h"
#include "startup.h"
#include "screen.h"
#include "moveresize.h"
if (num == 2) {
self->nicons++;
self->icons = g_new(Icon, self->nicons);
+ xerror_set_ignore(TRUE);
if (!render_pixmap_to_rgba(data[0], data[1],
&self->icons[self->nicons-1].width,
&self->icons[self->nicons-1].height,
g_free(&self->icons[self->nicons-1]);
self->nicons--;
}
+ xerror_set_ignore(FALSE);
}
g_free(data);
} else {
if (hints->flags & IconPixmapHint) {
self->nicons++;
self->icons = g_new(Icon, self->nicons);
+ xerror_set_ignore(TRUE);
if (!render_pixmap_to_rgba(hints->icon_pixmap,
(hints->flags & IconMaskHint ?
hints->icon_mask : None),
g_free(&self->icons[self->nicons-1]);
self->nicons--;
}
+ xerror_set_ignore(FALSE);
}
XFree(hints);
}
return self;
}
+gboolean client_can_focus(Client *self)
+{
+ /* same code as in client_focus */
+
+ /* choose the correct target */
+ self = client_focus_target(self);
+
+ if (!self->frame->visible)
+ return FALSE;
+
+ if (!((self->can_focus || self->focus_notify) &&
+ (self->desktop == screen_desktop ||
+ self->desktop == DESKTOP_ALL) &&
+ !self->iconic))
+ return FALSE;
+ return TRUE;
+}
+
gboolean client_focus(Client *self)
{
XEvent ev;
+ /* same code as in client_can_focus */
+
/* choose the correct target */
self = client_focus_target(self);