X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FWindow.cc;h=85144ffdae54da8bb00c00e1acd12bf4c82c2082;hb=c293fd65caff1879a4d27fcc177966fda97ddfe5;hp=4c7a31d76d9536751908b498a34af527875a1a84;hpb=ec5ea27e53fb638052e5f13b63afcb476a6eef38;p=chaz%2Fopenbox diff --git a/src/Window.cc b/src/Window.cc index 4c7a31d7..85144ffd 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -153,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(); @@ -169,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(); @@ -820,24 +819,27 @@ void BlackboxWindow::reconfigure(void) { void BlackboxWindow::grabButtons(void) { - if ((! screen->isSloppyFocus()) || screen->doClickRaise()) + if (! screen->isSloppyFocus() || screen->doClickRaise()) // grab button 1 for changing focus/raising blackbox->grabButton(Button1, 0, frame.plate, True, ButtonPressMask, - GrabModeSync, GrabModeSync, frame.plate, None); - + GrabModeSync, GrabModeSync, frame.plate, None, + screen->allowScrollLock()); + if (functions & Func_Move) blackbox->grabButton(Button1, Mod1Mask, frame.window, True, ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, - GrabModeAsync, frame.window, - blackbox->getMoveCursor()); + GrabModeAsync, frame.window, None, + screen->allowScrollLock()); if (functions & Func_Resize) blackbox->grabButton(Button3, Mod1Mask, frame.window, True, ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, - GrabModeAsync, frame.window, None); + GrabModeAsync, frame.window, None, + screen->allowScrollLock()); // alt+middle lowers the window blackbox->grabButton(Button2, Mod1Mask, frame.window, True, ButtonReleaseMask, GrabModeAsync, GrabModeAsync, - frame.window, None); + frame.window, None, + screen->allowScrollLock()); } @@ -1790,8 +1792,21 @@ void BlackboxWindow::maximize(unsigned int button) { blackbox_attrib.premax_h = client.rect.height() + frame.margin.top + frame.margin.bottom; - const Rect &screen_area = screen->availableArea(); - frame.changing = screen_area; +#ifdef XINERAMA + if (screen->isXineramaActive() && blackbox->doXineramaMaximizing()) { + // find the area to use + RectList availableAreas = screen->allAvailableAreas(); + RectList::iterator it, end = availableAreas.end(); + + for (it = availableAreas.begin(); it != end; ++it) + if (it->intersects(frame.rect)) break; + if (it == end) // the window isn't inside an area + it = availableAreas.begin(); // so just default to the first one + + frame.changing = *it; + } else +#endif + frame.changing = screen->availableArea(); switch(button) { case 1: @@ -2514,7 +2529,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) {