X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FWindow.cc;h=8899ff1646c73ee7f70091a097b3fecae4a6a600;hb=843f9726ab6fd99fe3a2f285e6c85bd2880a275f;hp=a336eaeb4e9a1511c207aa4c825a49904fb7f67f;hpb=2dde696a1335ef61bb368c55f4ee52e1dd8610a1;p=chaz%2Fopenbox diff --git a/src/Window.cc b/src/Window.cc index a336eaeb..8899ff16 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -44,6 +44,7 @@ extern "C" { #include "i18n.hh" #include "blackbox.hh" +#include "Clientmenu.hh" #include "Font.hh" #include "GCCache.hh" #include "Iconmenu.hh" @@ -152,10 +153,17 @@ BlackboxWindow::BlackboxWindow(Blackbox *b, Window w, BScreen *s) { client.rect.setRect(wattrib.x, wattrib.y, wattrib.width, wattrib.height); client.old_bw = wattrib.border_width; - timer = 0; windowmenu = 0; lastButtonPressTime = 0; + timer = new BTimer(blackbox, this); + timer->setTimeout(blackbox->getAutoRaiseDelay()); + + if (! getBlackboxHints()) { + getMWMHints(); + getNetWMHints(); + } + // get size, aspect, minimum/maximum size and other hints set by the // client getWMProtocols(); @@ -168,14 +176,6 @@ BlackboxWindow::BlackboxWindow(Blackbox *b, Window w, BScreen *s) { return; } - timer = new BTimer(blackbox, this); - timer->setTimeout(blackbox->getAutoRaiseDelay()); - - if (! getBlackboxHints()) { - getMWMHints(); - getNetWMHints(); - } - frame.window = createToplevelWindow(); frame.plate = createChildWindow(frame.window); associateClientWindow(); @@ -2039,6 +2039,9 @@ void BlackboxWindow::setFocusFlag(bool focus) { if (isFocused()) blackbox->setFocusedWindow(this); + + Clientmenu *menu = screen->getWorkspace(blackbox_attrib.workspace)->getMenu(); + menu->setItemSelected(window_number, isFocused()); } @@ -2510,7 +2513,8 @@ void BlackboxWindow::mapRequestEvent(const XMapRequestEvent *re) { if (isNormal()) { if (! blackbox->isStartup()) { XSync(blackbox->getXDisplay(), False); // make sure the frame is mapped - if (isTransient() || screen->doFocusNew()) { + if (screen->doFocusNew()|| (isTransient() && getTransientFor() && + getTransientFor()->isFocused())) { setInputFocus(); } if (screen->getPlacementPolicy() == BScreen::ClickMousePlacement) {