static void client_ping_event(ObClient *self, gboolean dead);
static void client_prompt_kill(ObClient *self);
-
void client_startup(gboolean reconfig)
{
if ((client_default_icon = RrImageCacheFind(ob_rr_icons,
activate ? "yes" : "no");
if (activate) {
gboolean raise = FALSE;
- gboolean relative_focused = FALSE;
+ gboolean relative_focused;
+ gboolean parent_focused;
+ parent_focused = (focus_client != NULL &&
+ client_search_focus_parent(self));
relative_focused = (focus_client != NULL &&
- client_search_focus_tree_full(self) != NULL &&
- client_search_focus_group_full(self) != NULL);
-
+ (client_search_focus_tree_full(self) != NULL ||
+ client_search_focus_group_full(self) != NULL));
/* This is focus stealing prevention */
ob_debug_type(OB_DEBUG_FOCUS,
"launched at %u (last user interaction time %u)",
self->window, map_time, launch_time,
event_last_user_time);
+ ob_debug_type(OB_DEBUG_FOCUS,
+ "Current focus_client: %s",
+ (focus_client ? focus_client->title : "(none)"));
+ ob_debug_type(OB_DEBUG_FOCUS,
+ "parent focuesed: %d relative focused: %d",
+ parent_focused, relative_focused);
if (menu_frame_visible || moveresize_in_progress) {
activate = FALSE;
else if (focus_client) {
/* If the user is working in another window right now, then don't
steal focus */
- if (event_last_user_time && launch_time &&
+ if (!parent_focused &&
+ event_last_user_time && launch_time &&
event_time_after(event_last_user_time, launch_time) &&
event_last_user_time != launch_time &&
event_time_after(event_last_user_time,
activate = FALSE;
ob_debug_type(OB_DEBUG_FOCUS,
"Not focusing the window because the user is "
- "working in another window");
+ "working in another window that is not "
+ "its parent");
}
/* If the new window is a transient (and its relatives aren't
focused) */
hooks_queue(OB_HOOK_WIN_NEW, self);
}
-
ObClient *client_fake_manage(Window window)
{
ObClient *self;
transient windows as their children.
* * */
-
/* No change has occured */
if (oldgroup == newgroup &&
oldgtran == newgtran &&
(gint*)&w, (gint*)&h, &data);
obt_display_ignore_errors(FALSE);
-
if (xicon) {
if (w > 0 && h > 0) {
/* is this icon in the cache yet? */
self->type != OB_CLIENT_TYPE_DESKTOP);
}
-
static void client_apply_startup_state(ObClient *self,
gint x, gint y, gint w, gint h)
{
g_assert(*h > 0);
}
-
void client_configure(ObClient *self, gint x, gint y, gint w, gint h,
gboolean user, gboolean final, gboolean force_reply)
{
return NULL;
}
+ObClient *client_search_focus_parent_full(ObClient *self)
+{
+ GSList *it;
+ ObClient *ret = NULL;
+
+ for (it = self->parents; it; it = g_slist_next(it)) {
+ if (client_focused(it->data))
+ ret = it->data;
+ else
+ ret = client_search_focus_parent_full(it->data);
+ if (ret) break;
+ }
+ return ret;
+}
+
ObClient *client_search_parent(ObClient *self, ObClient *search)
{
GSList *it;