X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FWindow.cc;h=56487e0bd99c2674394bdae38f26993810b4d86a;hb=5067369f76f1f0db140a0e4c2c9af43982290183;hp=031b396e867a34088810b8361f51942d4e5d7199;hpb=44e3582d5e08556c7b1136cfd9a49546cf5fcae0;p=chaz%2Fopenbox diff --git a/src/Window.cc b/src/Window.cc index 031b396e..56487e0b 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -33,9 +33,9 @@ #include #include -#ifdef STDC_HEADERS +#ifdef HAVE_STRING_H # include -#endif // STDC_HEADERS +#endif // HAVE_STRING_H #ifdef DEBUG # ifdef HAVE_STDIO_H @@ -168,9 +168,8 @@ OpenboxWindow::OpenboxWindow(Openbox &o, Window w, BScreen *s) : openbox(o) { #ifdef SLIT if (client.initial_state == WithdrawnState) { screen->getSlit()->addClient(client.window); - delete this; - openbox.ungrab(); + delete this; return; } #endif // SLIT @@ -259,7 +258,7 @@ OpenboxWindow::OpenboxWindow(Openbox &o, Window w, BScreen *s) : openbox(o) { associateClientWindow(); - if (! screen->isSloppyFocus()) + if (! screen->sloppyFocus()) openbox.grabButton(Button1, 0, frame.plate, True, ButtonPressMask, GrabModeSync, GrabModeSync, None, None); @@ -847,7 +846,7 @@ void OpenboxWindow::reconfigure(void) { configure(frame.x, frame.y, frame.width, frame.height); - if (! screen->isSloppyFocus()) + if (! screen->sloppyFocus()) openbox.grabButton(Button1, 0, frame.plate, True, ButtonPressMask, GrabModeSync, GrabModeSync, None, None); else @@ -1407,7 +1406,7 @@ Bool OpenboxWindow::setInputFocus(void) { XSendEvent(display, client.window, False, NoEventMask, &ce); } - if (screen->isSloppyFocus() && screen->doAutoRaise()) + if (screen->sloppyFocus() && screen->autoRaise()) timer->start(); ret = True; @@ -1465,7 +1464,7 @@ void OpenboxWindow::deiconify(Bool reassoc, Bool raise) { XMapSubwindows(display, frame.window); XMapWindow(display, frame.window); - if (flags.iconic && screen->doFocusNew()) setInputFocus(); + if (flags.iconic && screen->focusNew()) setInputFocus(); flags.visible = True; flags.iconic = False; @@ -1553,7 +1552,7 @@ void OpenboxWindow::maximize(unsigned int button) { dh -= client.base_height; dh -= frame.y_border; - if (! screen->doFullMax()) + if (! screen->fullMax()) dh -= screen->getToolbar()->getExposedHeight() + frame.border_w; if (dw < client.min_width) dw = client.min_width; @@ -1573,13 +1572,13 @@ void OpenboxWindow::maximize(unsigned int button) { dx += ((screen->size().w() - dw) / 2) - frame.border_w; - if (screen->doFullMax()) { + if (screen->fullMax()) { dy += ((screen->size().h() - dh) / 2) - frame.border_w; } else { dy += (((screen->size().h() - screen->getToolbar()->getExposedHeight()) - dh) / 2) - frame.border_w; - switch (screen->getToolbarPlacement()) { + switch (screen->getToolbar()->placement()) { case Toolbar::TopLeft: case Toolbar::TopCenter: case Toolbar::TopRight: @@ -1740,7 +1739,7 @@ void OpenboxWindow::setFocusFlag(Bool focus) { XSetWindowBorder(display, frame.plate, frame.uborder_pixel); } - if (screen->isSloppyFocus() && screen->doAutoRaise() && timer->isTiming()) + if (screen->sloppyFocus() && screen->autoRaise() && timer->isTiming()) timer->stop(); } @@ -2258,7 +2257,7 @@ void OpenboxWindow::mapNotifyEvent(XMapEvent *ne) { redrawAllButtons(); - if (flags.transient || screen->doFocusNew()) + if (flags.transient || screen->focusNew()) setInputFocus(); else setFocusFlag(False); @@ -2641,7 +2640,7 @@ void OpenboxWindow::buttonPressEvent(XButtonEvent *be) { shade(); } - if (! (flags.focused || screen->isSloppyFocus()) ) { + if (! (flags.focused || screen->sloppyFocus()) ) { setInputFocus(); // any click focus' the window in 'click to focus' } if (stack_change < 0) { @@ -2722,7 +2721,7 @@ void OpenboxWindow::buttonReleaseEvent(XButtonEvent *re) { flags.moving = False; openbox.maskWindowEvents(0, (OpenboxWindow *) 0); - if (!screen->doOpaqueMove()) { + if (!screen->opaqueMove()) { XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(), frame.move_x, frame.move_y, frame.resize_w - 1, frame.resize_h - 1); @@ -2781,7 +2780,7 @@ void OpenboxWindow::motionNotifyEvent(XMotionEvent *me) { openbox.maskWindowEvents(client.window, this); - if (! screen->doOpaqueMove()) { + if (! screen->opaqueMove()) { openbox.grab(); frame.move_x = frame.x; @@ -2802,7 +2801,7 @@ void OpenboxWindow::motionNotifyEvent(XMotionEvent *me) { dx -= frame.border_w; dy -= frame.border_w; - int snap_distance = screen->getEdgeSnapThreshold(); + int snap_distance = screen->edgeSnapThreshold(); // width/height of the snapping window unsigned int snap_w = frame.width + (frame.border_w * 2); unsigned int snap_h = size().h() + (frame.border_w * 2); @@ -2817,7 +2816,7 @@ void OpenboxWindow::motionNotifyEvent(XMotionEvent *me) { dx = screen->size().w() - snap_w; int dtty, dbby, dty, dby; - switch (screen->getToolbarPlacement()) { + switch (screen->getToolbar()->placement()) { case Toolbar::TopLeft: case Toolbar::TopCenter: case Toolbar::TopRight: @@ -2843,7 +2842,7 @@ void OpenboxWindow::motionNotifyEvent(XMotionEvent *me) { dy = dbby - snap_h; } - if (screen->doOpaqueMove()) { + if (screen->opaqueMove()) { configure(dx, dy, frame.width, frame.height); } else { XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(),