Merge branch 'backport' into work

Conflicts:

	openbox/screen.c
This commit is contained in:
Dana Jansens 2009-12-18 11:39:56 -05:00
commit 965ed8907a
5 changed files with 35 additions and 17 deletions

View file

@ -1948,9 +1948,6 @@ static gboolean focus_delay_func(gpointer data)
ObFocusDelayData *d = data; ObFocusDelayData *d = data;
Time old = event_curtime; Time old = event_curtime;
/* don't move focus and kill the menu or the move/resize */
if (menu_frame_visible || moveresize_in_progress) return FALSE;
event_curtime = d->time; event_curtime = d->time;
event_curserial = d->serial; event_curserial = d->serial;
if (client_focus(d->client) && config_focus_raise) if (client_focus(d->client) && config_focus_raise)

View file

@ -55,12 +55,8 @@ void focus_cycle_stop(ObClient *ifclient)
/* stop focus cycling if the given client is a valid focus target, /* stop focus cycling if the given client is a valid focus target,
and so the cycling is being disrupted */ and so the cycling is being disrupted */
if (focus_cycle_target && ifclient && if (focus_cycle_target && ifclient &&
focus_valid_target(ifclient, TRUE, (ifclient == focus_cycle_target ||
focus_cycle_iconic_windows, focus_cycle_popup_is_showing(ifclient)))
focus_cycle_all_desktops,
focus_cycle_dock_windows,
focus_cycle_desktop_windows,
FALSE))
{ {
focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,TRUE); focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,TRUE);
focus_directional_cycle(0, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); focus_directional_cycle(0, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE);

View file

@ -735,3 +735,17 @@ void focus_cycle_popup_single_hide(void)
{ {
icon_popup_hide(single_popup); icon_popup_hide(single_popup);
} }
gboolean focus_cycle_popup_is_showing(ObClient *client)
{
if (popup.mapped) {
GList *it;
for (it = popup.targets; it; it = g_list_next(it)) {
ObFocusCyclePopupTarget *t = it->data;
if (t->client == client)
return TRUE;
}
}
return FALSE;
}

View file

@ -46,4 +46,7 @@ void focus_cycle_popup_single_show(struct _ObClient *c,
gboolean desktop_windows); gboolean desktop_windows);
void focus_cycle_popup_single_hide(void); void focus_cycle_popup_single_hide(void);
/*! Returns TRUE if the popup is showing the client, otherwise FALSE. */
gboolean focus_cycle_popup_is_showing(struct _ObClient *client);
#endif #endif

View file

@ -30,6 +30,7 @@
#include "frame.h" #include "frame.h"
#include "event.h" #include "event.h"
#include "focus.h" #include "focus.h"
#include "focus_cycle.h"
#include "popup.h" #include "popup.h"
#include "render/render.h" #include "render/render.h"
#include "gettext.h" #include "gettext.h"
@ -703,17 +704,24 @@ void screen_set_desktop(guint num, gboolean dofocus)
for (it = g_list_last(stacking_list); it; it = g_list_previous(it)) { for (it = g_list_last(stacking_list); it; it = g_list_previous(it)) {
if (WINDOW_IS_CLIENT(it->data)) { if (WINDOW_IS_CLIENT(it->data)) {
ObClient *c = it->data; ObClient *c = it->data;
if (client_hide(c) && c == focus_client) { if (client_hide(c)) {
/* c was focused and we didn't do fallback clearly so make sure /* in the middle of cycling..? kill it. */
openbox doesnt still consider the window focused. focus_cycle_stop(c);
this happens when using NextWindow with allDesktops, since
it doesnt want to move focus on desktop change, but the if (c == focus_client) {
focus is not going to stay with the current window, which /* c was focused and we didn't do fallback clearly so make
has now disappeared */ sure openbox doesnt still consider the window focused.
this happens when using NextWindow with allDesktops,
since it doesnt want to move focus on desktop change,
but the focus is not going to stay with the current
window, which has now disappeared.
only do this if the client was actually hidden,
otherwise it can keep focus. */
focus_set_client(NULL); focus_set_client(NULL);
} }
} }
} }
}
event_end_ignore_all_enters(ignore_start); event_end_ignore_all_enters(ignore_start);