From dc88eeb6468e343c335c320f0ed663d5d365807d Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Wed, 6 Aug 2008 22:57:37 +0000 Subject: [PATCH] handle bizarre focus properties. ie take_focus - but a window that never actually takes focus... SVN revision: 35365 --- src/bin/e_border.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/bin/e_border.c b/src/bin/e_border.c index 7c6fd9389..d59016e54 100644 --- a/src/bin/e_border.c +++ b/src/bin/e_border.c @@ -1410,7 +1410,6 @@ e_border_focus_set(E_Border *bd, int focus, int set) (!bd->client.icccm.take_focus)) return; /* dont focus an iconified window. that's silly! */ if ((focus) && (bd->iconic)) return; - if ((bd->modal) && (bd->modal != bd)) { e_border_focus_set(bd->modal, focus, set); @@ -1421,6 +1420,37 @@ e_border_focus_set(E_Border *bd, int focus, int set) e_border_focus_set(bd->leader->modal, focus, set); return; } + + if ((focus) && (set) && (!bd->focused)) + { + if ((bd->client.icccm.accepts_focus) && + (bd->client.icccm.take_focus)) + { + if ((bd->visible) && (bd->changes.visible)) + { + e_border_focus_latest_set(bd); + bd->want_focus = 1; + bd->changed = 1; + return; + } + e_grabinput_focus(bd->client.win, E_FOCUS_METHOD_LOCALLY_ACTIVE); + return; + } + else if ((!bd->client.icccm.accepts_focus) && + (bd->client.icccm.take_focus)) + { + if ((bd->visible) && (bd->changes.visible)) + { + e_border_focus_latest_set(bd); + bd->want_focus = 1; + bd->changed = 1; + return; + } + e_grabinput_focus(bd->client.win, E_FOCUS_METHOD_GLOBALLY_ACTIVE); + return; + } + } + if ((bd->visible) && (bd->changes.visible)) { if ((bd->want_focus) && (set) && (!focus))