summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
3c7bf77)
client.c stacking.c: fixing looping transient case for group transient windows. now a window which is transient for a group is *not* transient for any other transient windows in the group (perviously the other window had to be transient for the group to be excluded, now it can be transient for anything).
client.c/h event.c render.c/h: adjustnig icon handling a bit. will be converting the legacy pixmap icons into rgba data so they can be handled the same as netwm icons.
#include "openbox.h"
#include "group.h"
#include "config.h"
#include "openbox.h"
#include "group.h"
#include "config.h"
+#include "render/render.h"
#include <glib.h>
#include <X11/Xutil.h>
#include <glib.h>
#include <X11/Xutil.h>
for (it = self->group->members; it; it = it->next)
if (it->data != self &&
for (it = self->group->members; it; it = it->next)
if (it->data != self &&
- ((Client*)it->data)->transient_for != TRAN_GROUP) {
+ !((Client*)it->data)->transient_for) {
if (!func(it->data, data)) return;
client_foreach_ancestor(it->data, func, data);
}
if (!func(it->data, data)) return;
client_foreach_ancestor(it->data, func, data);
}
client_update_class(self);
client_update_strut(self);
client_update_icons(self);
client_update_class(self);
client_update_strut(self);
client_update_icons(self);
- client_update_kwm_icon(self);
client_change_state(self);
}
client_change_state(self);
}
for (it = self->group->members; it; it = it->next)
if (it->data != self &&
for (it = self->group->members; it; it = it->next)
if (it->data != self &&
- ((Client*)it->data)->transient_for != TRAN_GROUP) {
+ !((Client*)it->data)->transient_for) {
self->desktop = ((Client*)it->data)->desktop;
trdesk = TRUE;
break;
self->desktop = ((Client*)it->data)->desktop;
trdesk = TRUE;
break;
/* remove from old parents */
for (it = self->group->members; it; it = it->next)
if (it->data != self &&
/* remove from old parents */
for (it = self->group->members; it; it = it->next)
if (it->data != self &&
- (((Client*)it->data)->transient_for != TRAN_GROUP))
+ !((Client*)it->data)->transient_for)
((Client*)it->data)->transients =
g_slist_remove(((Client*)it->data)->transients, self);
} else if (self->transient_for != NULL) { /* transient of window */
((Client*)it->data)->transients =
g_slist_remove(((Client*)it->data)->transients, self);
} else if (self->transient_for != NULL) { /* transient of window */
/* add to new parents */
for (it = self->group->members; it; it = it->next)
if (it->data != self &&
/* add to new parents */
for (it = self->group->members; it; it = it->next)
if (it->data != self &&
- (((Client*)it->data)->transient_for != TRAN_GROUP))
+ !((Client*)it->data)->transient_for)
((Client*)it->data)->transients =
g_slist_append(((Client*)it->data)->transients, self);
((Client*)it->data)->transients =
g_slist_append(((Client*)it->data)->transients, self);
if (self->group != NULL) {
/* remove transients of the group */
for (it = self->group->members; it; it = it->next)
if (self->group != NULL) {
/* remove transients of the group */
for (it = self->group->members; it; it = it->next)
- if (it->data != self &&
- ((Client*)it->data)->transient_for == TRAN_GROUP) {
- self->transients = g_slist_remove(self->transients,
- it->data);
- }
+ self->transients = g_slist_remove(self->transients,
+ it->data);
group_remove(self->group, self);
self->group = NULL;
}
group_remove(self->group, self);
self->group = NULL;
}
- if (hints->window_group != None) {
+ /* i can only have transients from the group if i am not transient
+ myself */
+ if (hints->window_group != None && !self->transient_for) {
self->group = group_add(hints->window_group, self);
/* add other transients of the group that are already
self->group = group_add(hints->window_group, self);
/* add other transients of the group that are already
client_update_transient_for(self);
}
client_update_transient_for(self);
}
- client_update_kwm_icon(self);
- /* try get the kwm icon first, this is a fallback only */
- if (self->pixmap_icon == None) {
- if (hints->flags & IconPixmapHint) {
- if (self->pixmap_icon == None) {
- self->pixmap_icon = hints->icon_pixmap;
- if (hints->flags & IconMaskHint)
- self->pixmap_icon_mask = hints->icon_mask;
- else
- self->pixmap_icon_mask = None;
-
- if (self->frame)
- frame_adjust_icon(self->frame);
- }
- }
- }
-
- }
-
- if (self->frame)
- frame_adjust_icon(self->frame);
-}
-
-void client_update_kwm_icon(Client *self)
-{
- guint num;
- guint32 *data;
-
- if (!PROP_GETA32(self->window, kwm_win_icon, kwm_win_icon, &data, &num)) {
- self->pixmap_icon = self->pixmap_icon_mask = None;
- } else {
+ } else if (PROP_GETA32(self->window, kwm_win_icon,
+ kwm_win_icon, &data, &num)) {
- self->pixmap_icon = data[0];
- self->pixmap_icon_mask = data[1];
- } else
- self->pixmap_icon = self->pixmap_icon_mask = None;
- g_free(data);
+ self->nicons++;
+ self->icons = g_new(Icon, self->nicons);
+ /* XXX WHAT IF THIS FAILS YOU TWIT!@!*()@ */
+ render_pixmap_to_rgba(data[0], data[1],
+ &self->icons[self->nicons-1].width,
+ &self->icons[self->nicons-1].height,
+ &self->icons[self->nicons-1].data);
+ }
+ g_free(data);
if (self->frame)
frame_adjust_icon(self->frame);
}
if (self->frame)
frame_adjust_icon(self->frame);
}
GSList *it;
for (it = self->group->members; it; it = it->next)
GSList *it;
for (it = self->group->members; it; it = it->next)
- if (((Client*)it->data)->transient_for != TRAN_GROUP) {
+ if (!((Client*)it->data)->transient_for) {
Client *c;
if ((c = client_search_focus_tree_full(it->data)))
return c;
Client *c;
if ((c = client_search_focus_tree_full(it->data)))
return c;
for (it = self->group->members; it; it = it->next)
if (it->data != self &&
for (it = self->group->members; it; it = it->next)
if (it->data != self &&
- ((Client*)it->data)->transient_for != TRAN_GROUP) {
+ !((Client*)it->data)->transient_for) {
self = it->data;
break;
}
self = it->data;
break;
}
- /* the check for TRAN_GROUP is to prevent an infinate loop with
- 2 transients of the same group at the head of the group's
- members list */
for (it = self->group->members; it; it = it->next) {
Client *c = it->data;
if (c != self && c->iconic != iconic &&
for (it = self->group->members; it; it = it->next) {
Client *c = it->data;
if (c != self && c->iconic != iconic &&
- c->transient_for != TRAN_GROUP) {
client_iconify(it->data, iconic, curdesk);
break;
}
client_iconify(it->data, iconic, curdesk);
break;
}
/*! Holds an icon in ARGB format */
typedef struct Icon {
/*! Holds an icon in ARGB format */
typedef struct Icon {
- unsigned long width, height;
- unsigned long *data;
+ int width, height;
+ gulong *data;
} Icon;
/*! The MWM Hints as retrieved from the window property
} Icon;
/*! The MWM Hints as retrieved from the window property
Icon *icons;
/*! The number of icons in icons */
int nicons;
Icon *icons;
/*! The number of icons in icons */
int nicons;
-
- /*! The icon for the client specified in the WMHints or the KWM hints */
- Pixmap pixmap_icon;
- /*! The mask for the pixmap_icon, or None if its not masked */
- Pixmap pixmap_icon_mask;
} Client;
extern GList *client_list;
} Client;
extern GList *client_list;
void client_update_strut(Client *self);
/*! Updates the window's icons */
void client_update_icons(Client *self);
void client_update_strut(Client *self);
/*! Updates the window's icons */
void client_update_icons(Client *self);
-/*! Updates the window's kwm icon */
-void client_update_kwm_icon(Client *self);
/*! Set up what decor should be shown on the window and what functions should
be allowed (Client::decorations and Client::functions).
/*! Set up what decor should be shown on the window and what functions should
be allowed (Client::decorations and Client::functions).
}
else if (msgtype == prop_atoms.net_wm_strut)
client_update_strut(client);
}
else if (msgtype == prop_atoms.net_wm_strut)
client_update_strut(client);
- else if (msgtype == prop_atoms.net_wm_icon)
+ else if (msgtype == prop_atoms.net_wm_icon ||
+ msgtype == prop_atoms.kwm_win_icon)
client_update_icons(client);
client_update_icons(client);
- else if (msgtype == prop_atoms.kwm_win_icon)
- client_update_kwm_icon(client);
- /* the check for TRAN_GROUP is to prevent an infinate loop with
- 2 transients of the same group at the head of the group's
- members list */
for (it = client->group->members; it; it = it->next) {
Client *c = it->data;
for (it = client->group->members; it; it = it->next) {
Client *c = it->data;
- if (c != client && c->transient_for != TRAN_GROUP)
+ /* checking transient_for prevents infinate loops! */
+ if (c != client && !c->transient_for)
stacking_raise(it->data);
}
if (it == NULL) return;
stacking_raise(it->data);
}
if (it == NULL) return;
- /* the check for TRAN_GROUP is to prevent an infinate loop with
- 2 transients of the same group at the head of the group's
- members list */
for (it = client->group->members; it; it = it->next) {
Client *c = it->data;
for (it = client->group->members; it; it = it->next) {
Client *c = it->data;
- if (c != client && c->transient_for != TRAN_GROUP)
+ /* checking transient_for prevents infinate loops! */
+ if (c != client && !c->transient_for)
stacking_lower(it->data);
}
if (it == NULL) return;
stacking_lower(it->data);
}
if (it == NULL) return;
- /* the check for TRAN_GROUP is to prevent an infinate loop with
- 2 transients of the same group at the head of the group's
- members list */
for (it = stacking_list; !parent && it; it = it->next) {
for (sit = client->group->members; !parent && sit;
sit = sit->next) {
Client *c = sit->data;
for (it = stacking_list; !parent && it; it = it->next) {
for (sit = client->group->members; !parent && sit;
sit = sit->next) {
Client *c = sit->data;
- if (sit->data == it->data &&
- c->transient_for != TRAN_GROUP)
+ /* checking transient_for prevents infinate loops! */
+ if (sit->data == it->data && !c->transient_for)
+
+void render_pixmap_to_rgba(Pixmap pmap, Pixmap mask,
+ int *w, int *h, gulong **data)
+{
+ *w = *h = 0;
+ *data = NULL;
+}
void appearance_minsize(Appearance *l, int *w, int *h);
void appearance_minsize(Appearance *l, int *w, int *h);
+void render_pixmap_to_rgba(Pixmap pmap, Pixmap mask,
+ int *w, int *h, gulong **data);
+