X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fclient.c;h=0389d768025e7fe5a45eff9e95e81fa9b4a8782f;hb=140c5313cfe38aada8bd15892f74fc0d21d374c1;hp=88eecf1443db161f79d076aca4ddcd6262fe7bce;hpb=d3d4aa29871111737a4f6985da695c8688a05270;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index 88eecf14..0389d768 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -312,7 +312,7 @@ void client_manage(Window window) 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); @@ -371,8 +371,9 @@ void client_manage(Window window) /* 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 */ @@ -475,7 +476,8 @@ void client_manage(Window window) g_hash_table_insert(window_map, &self->window, self); /* this has to happen after we're in the client_list */ - screen_update_areas(); + if (STRUT_EXISTS(self->strut)) + screen_update_areas(); /* update the list hints */ client_set_list(); @@ -522,7 +524,8 @@ void client_unmanage(ObClient *self) /* once the client is out of the list, update the struts to remove it's influence */ - screen_update_areas(); + if (STRUT_EXISTS(self->strut)) + screen_update_areas(); for (it = client_destructors; it; it = g_slist_next(it)) { Destructor *d = it->data; @@ -810,20 +813,22 @@ static void client_toggle_border(ObClient *self, gboolean show) 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); { @@ -1303,6 +1308,7 @@ void client_setup_decor_and_functions(ObClient *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 */ @@ -1310,6 +1316,7 @@ void client_setup_decor_and_functions(ObClient *self) self->decorations = OB_FRAME_DECOR_BORDER; else self->decorations = 0; + } } } @@ -2349,7 +2356,8 @@ static void client_iconify_recursive(ObClient *self, if (changed) { client_change_state(self); client_showhide(self); - screen_update_areas(); + if (STRUT_EXISTS(self->strut)) + screen_update_areas(); } /* iconify all transients */ @@ -2497,7 +2505,7 @@ void client_close(ObClient *self) 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; @@ -2535,7 +2543,8 @@ void client_set_desktop_recursive(ObClient *self, /* raise if it was not already on the desktop */ if (old != DESKTOP_ALL) client_raise(self); - screen_update_areas(); + if (STRUT_EXISTS(self->strut)) + screen_update_areas(); /* add to the new desktop(s) */ if (config_focus_new) @@ -2818,7 +2827,7 @@ gboolean client_focus(ObClient *self) #799. So now it is RevertToNone again. */ XSetInputFocus(ob_display, self->window, RevertToNone, - event_lasttime); + event_curtime); } if (self->focus_notify) { @@ -2829,7 +2838,7 @@ gboolean client_focus(ObClient *self) 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; @@ -2839,7 +2848,7 @@ gboolean client_focus(ObClient *self) #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, @@ -2861,8 +2870,11 @@ void client_unfocus(ObClient *self) } } -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) @@ -2997,8 +3009,8 @@ ObClient *client_find_directional(ObClient *c, ObDirection dir) 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