summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Window.cc64
1 files changed, 32 insertions, 32 deletions
diff --git a/src/Window.cc b/src/Window.cc
index d5ba53c..8ec14e3 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Window.cc,v 1.84 2002/09/10 16:46:15 fluxgen Exp $ 25// $Id: Window.cc,v 1.85 2002/09/11 15:12:40 fluxgen Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -376,10 +376,12 @@ FluxboxWindow::~FluxboxWindow() {
376 if (client.transient_for == this) { 376 if (client.transient_for == this) {
377 client.transient_for = 0; 377 client.transient_for = 0;
378 } 378 }
379 379
380 fluxbox->setFocusedWindow(client.transient_for); 380 fluxbox->setFocusedWindow(client.transient_for);
381
381 if (client.transient_for) { 382 if (client.transient_for) {
382 client.transient_for->client.transients.remove(this); 383 client.transient_for->client.transients.remove(this);
384 client.transient_for->setInputFocus();
383 client.transient_for = 0; 385 client.transient_for = 0;
384 } 386 }
385 } 387 }
@@ -1491,7 +1493,7 @@ void FluxboxWindow::configure(int dx, int dy,
1491 1493
1492bool FluxboxWindow::setInputFocus() { 1494bool FluxboxWindow::setInputFocus() {
1493 //TODO hint skip focus 1495 //TODO hint skip focus
1494 1496
1495 if (((signed) (frame.x + frame.width)) < 0) { 1497 if (((signed) (frame.x + frame.width)) < 0) {
1496 if (((signed) (frame.y + frame.y_border)) < 0) 1498 if (((signed) (frame.y + frame.y_border)) < 0)
1497 configure(screen->getBorderWidth(), screen->getBorderWidth(), 1499 configure(screen->getBorderWidth(), screen->getBorderWidth(),
@@ -1527,37 +1529,35 @@ bool FluxboxWindow::setInputFocus() {
1527 return (*it)->setInputFocus(); 1529 return (*it)->setInputFocus();
1528 } 1530 }
1529 } else { 1531 } else {
1530 if (! focused) { 1532 if (focus_mode == F_LOCALLYACTIVE || focus_mode == F_PASSIVE) {
1531 if (focus_mode == F_LOCALLYACTIVE || focus_mode == F_PASSIVE) { 1533 XSetInputFocus(display, client.window,
1532 XSetInputFocus(display, client.window, 1534 RevertToPointerRoot, CurrentTime);
1533 RevertToPointerRoot, CurrentTime); 1535 } else {
1534 } else { 1536 return false;
1535 return false; 1537 }
1536 } 1538 Fluxbox *fb = Fluxbox::instance();
1537 Fluxbox *fb = Fluxbox::instance(); 1539 fb->setFocusedWindow(this);
1538 fb->setFocusedWindow(this);
1539 1540
1540 if (send_focus_message) { 1541 if (send_focus_message) {
1541 XEvent ce; 1542 XEvent ce;
1542 ce.xclient.type = ClientMessage; 1543 ce.xclient.type = ClientMessage;
1543 ce.xclient.message_type = fb->getWMProtocolsAtom(); 1544 ce.xclient.message_type = fb->getWMProtocolsAtom();
1544 ce.xclient.display = display; 1545 ce.xclient.display = display;
1545 ce.xclient.window = client.window; 1546 ce.xclient.window = client.window;
1546 ce.xclient.format = 32; 1547 ce.xclient.format = 32;
1547 ce.xclient.data.l[0] = fb->getWMTakeFocusAtom(); 1548 ce.xclient.data.l[0] = fb->getWMTakeFocusAtom();
1548 ce.xclient.data.l[1] = fb->getLastTime(); 1549 ce.xclient.data.l[1] = fb->getLastTime();
1549 ce.xclient.data.l[2] = 0l; 1550 ce.xclient.data.l[2] = 0l;
1550 ce.xclient.data.l[3] = 0l; 1551 ce.xclient.data.l[3] = 0l;
1551 ce.xclient.data.l[4] = 0l; 1552 ce.xclient.data.l[4] = 0l;
1552 XSendEvent(display, client.window, false, NoEventMask, &ce); 1553 XSendEvent(display, client.window, false, NoEventMask, &ce);
1553 } 1554 }
1554 1555
1555 if ((screen->isSloppyFocus() || screen->isSemiSloppyFocus()) 1556 if ((screen->isSloppyFocus() || screen->isSemiSloppyFocus())
1556 && screen->doAutoRaise()) 1557 && screen->doAutoRaise())
1557 timer.start(); 1558 timer.start();
1558 1559
1559 ret = true; 1560 ret = true;
1560 }
1561 } 1561 }
1562 1562
1563 return ret; 1563 return ret;