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))