&& !strcmp(app->name, client->name))
) {
ob_debug("Window matching: %s\n", app->name);
- /* Match if no role was specified in the per app setting, or if the string
- * matches the beginning of the role, since apps like to set the role to
- * things like browser-window-23c4b2f */
- if (!app->role || !strncmp(app->role, client->role, strlen(app->role)))
+ /* Match if no role was specified in the per app setting, or if the
+ * string matches the beginning of the role, since apps like to set
+ * the role to things like browser-window-23c4b2f */
+ if (!app->role
+ || !strncmp(app->role, client->role, strlen(app->role)))
return app;
}
XChangeSaveSet(ob_display, window, SetModeInsert);
/* create the decoration frame for the client window */
- self->frame = frame_new();
+ self->frame = frame_new(self);
frame_grab_client(self->frame, self);
/* focus the new window? */
if (ob_state() != OB_STATE_STARTING &&
- (config_focus_new || client_search_focus_parent(self)) ||
- (settings && settings->focus == TRUE) &&
+ ((settings && settings->focus == TRUE) ||
+ (!settings && (config_focus_new ||
+ client_search_focus_parent(self)))) &&
/* 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 */
static void client_get_all(ObClient *self)
{
client_get_area(self);
- client_update_transient_for(self);
- client_update_wmhints(self);
- client_get_startup_id(self);
- client_get_desktop(self);
- client_get_shaped(self);
-
client_get_mwm_hints(self);
- client_get_type(self);/* this can change the mwmhints for special cases */
/* The transient hint is used to pick a type, but the type can also affect
- transiency (dialogs are always made transients). This is Havoc's idea,
- but it is needed to make some apps work right (eg tsclient). */
+ transiency (dialogs are always made transients of their group if they
+ have one). This is Havoc's idea, but it is needed to make some apps
+ work right (eg tsclient). */
+ client_update_transient_for(self);
+ client_get_type(self);/* this can change the mwmhints for special cases */
client_update_transient_for(self);
+ client_update_wmhints(self);
+ client_get_startup_id(self);
+ client_get_desktop(self);/* uses transient data/group/startup id if a
+ desktop is not specified */
+ client_get_shaped(self);
+
client_get_state(self);
{
if (! (self->mwmhints.decorations & OB_MWM_DECOR_ALL)) {
if (! ((self->mwmhints.decorations & OB_MWM_DECOR_HANDLE) ||
(self->mwmhints.decorations & OB_MWM_DECOR_TITLE)))
+ {
/* if the mwm hints request no handle or title, then all
decorations are disabled, but keep the border if that's
specified */
self->decorations = OB_FRAME_DECOR_BORDER;
else
self->decorations = 0;
+ }
}
}
ce.xclient.window = self->window;
ce.xclient.format = 32;
ce.xclient.data.l[0] = prop_atoms.wm_delete_window;
- ce.xclient.data.l[1] = event_lasttime;
+ ce.xclient.data.l[1] = event_curtime;
ce.xclient.data.l[2] = 0l;
ce.xclient.data.l[3] = 0l;
ce.xclient.data.l[4] = 0l;
#799. So now it is RevertToNone again.
*/
XSetInputFocus(ob_display, self->window, RevertToNone,
- event_lasttime);
+ event_curtime);
}
if (self->focus_notify) {
ce.xclient.window = self->window;
ce.xclient.format = 32;
ce.xclient.data.l[0] = prop_atoms.wm_take_focus;
- ce.xclient.data.l[1] = event_lasttime;
+ ce.xclient.data.l[1] = event_curtime;
ce.xclient.data.l[2] = 0l;
ce.xclient.data.l[3] = 0l;
ce.xclient.data.l[4] = 0l;
#ifdef DEBUG_FOCUS
ob_debug("%sively focusing %lx at %d\n",
(self->can_focus ? "act" : "pass"),
- self->window, (gint) event_lasttime);
+ self->window, (gint) event_curtime);
#endif
/* Cause the FocusIn to come back to us. Important for desktop switches,
}
}
-void client_activate(ObClient *self, gboolean here)
+void client_activate(ObClient *self, gboolean here, gboolean user)
{
+ /* XXX do some stuff here if user is false to determine if we really want
+ to activate it or not (a parent or group member is currently active) */
+
if (client_normal(self) && screen_showing_desktop)
screen_show_desktop(FALSE);
if (self->iconic)
continue;
if(cur->iconic)
continue;
- if(client_focus_target(cur) == cur &&
- !(cur->can_focus || cur->focus_notify))
+ if(!(client_focus_target(cur) == cur &&
+ client_can_focus(cur)))
continue;
/* find the centre coords of this window, from the
#define WANT_EDGE(cur, c) \
if(cur == c) \
continue; \
- if(!client_normal_or_dock(cur)) \
+ if(!client_normal(cur)) \
continue; \
if(screen_desktop != cur->desktop && cur->desktop != DESKTOP_ALL) \
continue; \
his_edge_start = cur->frame->area.x;
his_edge_end = cur->frame->area.x + cur->frame->area.width;
- his_offset = cur->frame->area.y + (hang ? 0 : cur->frame->area.height);
+ his_offset = cur->frame->area.y +
+ (hang ? 0 : cur->frame->area.height);
if(his_offset + 1 > my_offset)
continue;
/* default: bottom of screen */
dest = a->y + a->height - (hang ? c->frame->area.height : 0);
- monitor_dest = monitor->y + monitor->height - (hang ? c->frame->area.height : 0);
+ monitor_dest = monitor->y + monitor->height -
+ (hang ? c->frame->area.height : 0);
/* if the monitor edge comes before the screen edge, */
/* use that as the destination instead. (For xinerama) */
if (monitor_dest != dest && my_offset < monitor_dest)
his_edge_start = cur->frame->area.x;
his_edge_end = cur->frame->area.x + cur->frame->area.width;
- his_offset = cur->frame->area.y + (hang ? cur->frame->area.height : 0);
+ his_offset = cur->frame->area.y +
+ (hang ? cur->frame->area.height : 0);
if(his_offset - 1 < my_offset)
his_edge_start = cur->frame->area.y;
his_edge_end = cur->frame->area.y + cur->frame->area.height;
- his_offset = cur->frame->area.x + (hang ? 0 : cur->frame->area.width);
+ his_offset = cur->frame->area.x +
+ (hang ? 0 : cur->frame->area.width);
if(his_offset + 1 > my_offset)
continue;
/* default: rightmost edge of screen */
dest = a->x + a->width - (hang ? c->frame->area.width : 0);
- monitor_dest = monitor->x + monitor->width - (hang ? c->frame->area.width : 0);
+ monitor_dest = monitor->x + monitor->width -
+ (hang ? c->frame->area.width : 0);
/* if the monitor edge comes before the screen edge, */
/* use that as the destination instead. (For xinerama) */
if (monitor_dest != dest && my_offset < monitor_dest)
his_edge_start = cur->frame->area.y;
his_edge_end = cur->frame->area.y + cur->frame->area.height;
- his_offset = cur->frame->area.x + (hang ? cur->frame->area.width : 0);
+ his_offset = cur->frame->area.x +
+ (hang ? cur->frame->area.width : 0);
if(his_offset - 1 < my_offset)
continue;