fallback to transient parents properly

This commit is contained in:
Dana Jansens 2007-03-11 17:05:07 +00:00
parent 62a39c4c70
commit fe31716486
3 changed files with 6 additions and 7 deletions

View file

@ -244,14 +244,11 @@ static ObClient* focus_fallback_transient(ObClient *top, ObClient *old)
return NULL; return NULL;
} }
ObClient* focus_fallback_target(ObFocusFallbackType type) ObClient* focus_fallback_target(ObFocusFallbackType type, ObClient *old)
{ {
GList *it; GList *it;
ObClient *old = NULL;
ObClient *target = NULL; ObClient *target = NULL;
old = focus_client;
if ((type == OB_FOCUS_FALLBACK_UNFOCUSING if ((type == OB_FOCUS_FALLBACK_UNFOCUSING
|| type == OB_FOCUS_FALLBACK_CLOSED) && old) { || type == OB_FOCUS_FALLBACK_CLOSED) && old) {
if (old->transient_for) { if (old->transient_for) {
@ -336,6 +333,7 @@ ObClient* focus_fallback_target(ObFocusFallbackType type)
void focus_fallback(ObFocusFallbackType type) void focus_fallback(ObFocusFallbackType type)
{ {
ObClient *new; ObClient *new;
ObClient *old = focus_client;
/* unfocus any focused clients.. they can be focused by Pointer events /* unfocus any focused clients.. they can be focused by Pointer events
and such, and then when I try focus them, I won't get a FocusIn event and such, and then when I try focus them, I won't get a FocusIn event
@ -343,7 +341,7 @@ void focus_fallback(ObFocusFallbackType type)
*/ */
focus_set_client(NULL); focus_set_client(NULL);
if ((new = focus_fallback_target(type))) if ((new = focus_fallback_target(type, old)))
client_focus(new); client_focus(new);
} }

View file

@ -53,7 +53,8 @@ typedef enum {
OB_FOCUS_FALLBACK_NOFOCUS /*!< nothing has focus for some reason */ OB_FOCUS_FALLBACK_NOFOCUS /*!< nothing has focus for some reason */
} ObFocusFallbackType; } ObFocusFallbackType;
struct _ObClient* focus_fallback_target(ObFocusFallbackType type); struct _ObClient* focus_fallback_target(ObFocusFallbackType type,
struct _ObClient *old);
/*! Call this when you need to focus something! */ /*! Call this when you need to focus something! */
void focus_fallback(ObFocusFallbackType type); void focus_fallback(ObFocusFallbackType type);

View file

@ -465,7 +465,7 @@ void screen_set_desktop(guint num)
event_ignore_queued_enters(); event_ignore_queued_enters();
focus_hilite = focus_fallback_target(OB_FOCUS_FALLBACK_NOFOCUS); focus_hilite = focus_fallback_target(OB_FOCUS_FALLBACK_NOFOCUS, NULL);
if (focus_hilite) { if (focus_hilite) {
frame_adjust_focus(focus_hilite->frame, TRUE); frame_adjust_focus(focus_hilite->frame, TRUE);