only limiting the application.
*/
if (client_normal(self)) {
- if (!self->strut.right && *x + fw/10 >= a->x + a->width - 1)
- *x = a->x + a->width - fw/10;
- if (!self->strut.bottom && *y + fh/10 >= a->y + a->height - 1)
- *y = a->y + a->height - fh/10;
- if (!self->strut.left && *x + fw*9/10 - 1 < a->x)
- *x = a->x - fw*9/10;
- if (!self->strut.top && *y + fh*9/10 - 1 < a->y)
- *y = a->y - fh*9/10;
+ if (!self->strut.right && *x + fw/100 >= a->x + a->width - 1)
+ *x = a->x + a->width - fw/100;
+ if (!self->strut.bottom && *y + fh/100 >= a->y + a->height - 1)
+ *y = a->y + a->height - fh/100;
+ if (!self->strut.left && *x + fw*99/100 - 1 < a->x)
+ *x = a->x - fw*99/100;
+ if (!self->strut.top && *y + fh*99/100 - 1 < a->y)
+ *y = a->y - fh*99/100;
}
/* This here doesn't let windows even a pixel outside the
gchar *data = NULL;
gchar *visible = NULL;
- g_free(self->title);
g_free(self->original_title);
/* try netwm */
http://developer.gnome.org/projects/gup/hig/draft_hig_new/windows-alert.html
*/
data = g_strdup("");
- } else
- data = g_strdup(_("Unnamed Window"));
+ } else {
+ if (self->class && *self->class)
+ data = g_strdup(self->class);
+ else if (self->name && *self->name)
+ data = g_strdup(self->name);
+ else
+ data = g_strdup(_("Unnamed Window"));
+ }
}
}
self->original_title = g_strdup(data);
g_free(data);
}
- OBT_PROP_SETS(self->window, NET_WM_VISIBLE_NAME, visible);
- self->title = visible;
+ if (!self->title || strcmp(self->title, visible)) {
+ OBT_PROP_SETS(self->window, NET_WM_VISIBLE_NAME, visible);
+ g_free(self->title);
+ self->title = visible;
+ } else
+ g_free(visible);
if (self->frame)
frame_adjust_title(self->frame);
/* update the icon title */
data = NULL;
- g_free(self->icon_title);
/* try netwm */
if (!OBT_PROP_GETS_UTF8(self->window, NET_WM_ICON_NAME, &data))
g_free(data);
}
- OBT_PROP_SETS(self->window, NET_WM_VISIBLE_ICON_NAME, visible);
- self->icon_title = visible;
+ if (!self->icon_title || strcmp(self->icon_title, visible)) {
+ OBT_PROP_SETS(self->window, NET_WM_VISIBLE_ICON_NAME, visible);
+ g_free(self->icon_title);
+ self->icon_title = visible;
+ } else
+ g_free(visible);
}
void client_update_strut(ObClient *self)
if (!self->icon_set && !self->parents) {
RrPixel32 *icon = ob_rr_theme->def_win_icon;
gulong *ldata; /* use a long here to satisfy OBT_PROP_SETA32 */
+ gint32 r,g,b;
+ r = g_random_int_range(0,255);
+ g = g_random_int_range(0,255);
+ b = g_random_int_range(0,255);
w = ob_rr_theme->def_win_icon_w;
h = ob_rr_theme->def_win_icon_h;
ldata[1] = h;
for (i = 0; i < w*h; ++i)
ldata[i+2] = (((icon[i] >> RrDefaultAlphaOffset) & 0xff) << 24) +
- (((icon[i] >> RrDefaultRedOffset) & 0xff) << 16) +
- (((icon[i] >> RrDefaultGreenOffset) & 0xff) << 8) +
- (((icon[i] >> RrDefaultBlueOffset) & 0xff) << 0);
+ ((((icon[i] >> RrDefaultRedOffset) & 0xff)*r/255) << 16) +
+ ((((icon[i] >> RrDefaultGreenOffset) & 0xff)*g/255) << 8) +
+ ((((icon[i] >> RrDefaultBlueOffset) & 0xff)*b/255) << 0);
OBT_PROP_SETA32(self->window, NET_WM_ICON, CARDINAL, ldata, w*h+2);
g_free(ldata);
} else if (self->frame)
gboolean client_mouse_focusable(ObClient *self)
{
- return !(self->type == OB_CLIENT_TYPE_MENU ||
+ return !(/*self->type == OB_CLIENT_TYPE_MENU ||*/
self->type == OB_CLIENT_TYPE_TOOLBAR ||
self->type == OB_CLIENT_TYPE_SPLASH ||
self->type == OB_CLIENT_TYPE_DOCK);
frame_adjust_area(self->frame, FALSE, TRUE, TRUE);
/* cap any X windows at the size of an unsigned short */
+ /* actually make that a bit less, X shits itself on windows this large too */
*w = MIN(*w,
- (gint)G_MAXUSHORT
+ (gint)4096
- self->frame->size.left - self->frame->size.right);
*h = MIN(*h,
- (gint)G_MAXUSHORT
+ (gint)4096
- self->frame->size.top - self->frame->size.bottom);
/* gets the frame's position */
maxratio = self->fullscreen || (self->max_horz && self->max_vert) ?
0 : self->max_ratio;
+ /* XXX TODO FIXME these two fallbacks don't check that the fallback
+ * value itself is specified before using it */
/* base size is substituted with min size if not specified */
if (self->base_size.width >= 0 || self->base_size.height >= 0) {
basew = self->base_size.width;
/* adjust the height to match the width for the aspect ratios.
for this, min size is not substituted for base size ever. */
- *w -= self->base_size.width;
- *h -= self->base_size.height;
+ if (self->base_size.width >= 0 && self->base_size.height >= 0) {
+ *w -= self->base_size.width;
+ *h -= self->base_size.height;
+ }
if (minratio)
if (*h * minratio > *w) {
}
}
- *w += self->base_size.width;
- *h += self->base_size.height;
+ if (self->base_size.width >= 0 && self->base_size.height >= 0) {
+ *w += self->base_size.width;
+ *h += self->base_size.height;
+ }
}
/* these override the above states! if you cant move you can't move! */
{
if (!client_validate(self)) return FALSE;
+ {
+ XkbStateRec state;
+ XkbGetState(obt_display, XkbUseCoreKbd, &state);
+ if (state.locked_mods & 128)
+ return FALSE;
+ }
+
/* we might not focus this window, so if we have modal children which would
be focused instead, bring them to this desktop */
client_bring_modal_windows(self);
{
self = client_focus_target(self);
+ if (self->iconic && self->locked)
+ return;
+
if (client_can_steal_focus(self, desktop, user, event_time(), CurrentTime))
client_present(self, here, raise, unshade);
else