From 38bd7f47d929fab76b55ea4e6a479eda981d3603 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Thu, 15 Jul 2004 18:20:13 +0000 Subject: click on handle raises, and some other minor fixes --- src/Window.cc | 115 +++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 77 insertions(+), 38 deletions(-) diff --git a/src/Window.cc b/src/Window.cc index f5952dc..fc990c8 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.cc,v 1.292 2004/06/29 12:41:23 rathnor Exp $ +// $Id: Window.cc,v 1.293 2004/07/15 18:20:13 fluxgen Exp $ #include "Window.hh" @@ -153,7 +153,9 @@ WinClient *getRootTransientFor(WinClient *client) { void raiseFluxboxWindow(FluxboxWindow &win) { if (win.oplock) return; win.oplock = true; - +#ifdef DEBUG + cerr<<"raiseFluxboxWindow("<isTransient() && m_client->transientFor()->fbwindow() && m_client->transientFor()->fbwindow() != this) - layerItem().setLayer(m_client->transientFor()->fbwindow()->layerItem().getLayer()); + layerItem().setLayer(m_client->transientFor()->fbwindow()->layerItem().getLayer()); else // if no parent then set default layer moveToLayer(m_layernum); - +#ifdef DEBUG + cerr<<"FluxboxWindow::init("<transientFor()<transientFor() && m_client->transientFor()->fbwindow()) { + cerr<<"FluxboxWindow::init("<title(): "<< + m_client->transientFor()->fbwindow()->title()<raise(); +#ifdef DEBUG + cerr<<"FluxboxWindow::"<<__FUNCTION__<<": labelbutton[client] = "<< + m_labelbuttons[m_client]<setBorderWidth(0); updateTitleFromClient(*m_client); updateIconNameFromClient(*m_client); @@ -982,8 +999,6 @@ void FluxboxWindow::grabButtons() { void FluxboxWindow::reconfigure() { - upsize(); - applyDecorations(); setFocusFlag(focused); @@ -1118,8 +1133,7 @@ void FluxboxWindow::updateBlackboxHintsFromClient(const WinClient &client) { ATTRIB_MAXHORIZ) ? MAX_HORZ : MAX_NONE); if (hint->flags & ATTRIB_OMNIPRESENT) - stuck = (hint->attrib & - ATTRIB_OMNIPRESENT); + stuck = (hint->attrib & ATTRIB_OMNIPRESENT); if (hint->flags & ATTRIB_WORKSPACE) m_workspace_number = hint->workspace; @@ -1156,7 +1170,6 @@ void FluxboxWindow::moveResize(int new_x, int new_y, if ((((signed) frame().height()) + new_y) < 0) new_y = 0; - downsize(); if (!isResizable()) { new_width = width(); new_height = height(); @@ -1218,11 +1231,23 @@ bool FluxboxWindow::setInputFocus() { if (! m_client->validateClient()) return false; - +#ifdef DEBUG + cerr<<"FluxboxWindow::"<<__FUNCTION__<<" isModal() = "<isModal()<isModal()) return (*it)->fbwindow()->setCurrentClient(**it, true); } @@ -1373,6 +1398,9 @@ void FluxboxWindow::deiconify(bool reassoc, bool do_raise) { Set window in withdrawn state */ void FluxboxWindow::withdraw(bool interrupt_moving) { +#ifdef DEBUG + cerr<<"FluxboxWindow::"<<__FUNCTION__<<": this = "<grab(); if (! client->validateClient()) @@ -2222,7 +2268,6 @@ void FluxboxWindow::propertyNotifyEvent(WinClient &client, Atom atom) { int x = frame().x(), y = frame().y(); unsigned int w = frame().width(), h = frame().height(); - upsize(); // reconfigure if the old values changed if (x != frame().x() || y != frame().y() || @@ -2272,12 +2317,15 @@ void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent &cr) { if (cr.value_mask & CWBorderWidth) client->old_bw = cr.border_width; - if (cr.value_mask & CWX) { + if ((cr.value_mask & CWX) && + (cr.value_mask & CWY)) { + cx = cr.x; + cy = cr.y; + frame().gravityTranslate(cx, cy, client->gravity(), false); + } else if (cr.value_mask & CWX) { cx = cr.x; frame().gravityTranslate(cx, ignore, client->gravity(), false); - } - - if (cr.value_mask & CWY) { + } else if (cr.value_mask & CWY) { cy = cr.y; frame().gravityTranslate(ignore, cy, client->gravity(), false); } @@ -2289,19 +2337,15 @@ void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent &cr) { ch = cr.height; // whether we should send ConfigureNotify to netizens - bool send_notify = false; - // the request is for client window so we resize the frame to it first if (frame().width() != cw || frame().height() != ch) { if (frame().x() != cx || frame().y() != cy) frame().moveResizeForClient(cx, cy, cw, ch); else frame().resizeForClient(cw, ch); - send_notify = true; + } else if (frame().x() != cx || frame().y() != cy) { - move(cx, cy); - // since we already send a notify in move we don't need to do that again - send_notify = false; + frame().move(cx, cy); } if (cr.value_mask & CWStackMode) { @@ -2319,7 +2363,7 @@ void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent &cr) { } } - sendConfigureNotify(send_notify); + sendConfigureNotify(); } @@ -2338,11 +2382,16 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent &be) { if (frame().window().window() == be.window) { if (screen().clickRaises()) raise(); +#ifdef DEBUG + cerr<<"FluxboxWindow::buttonPressEvent: AllowEvent"<hideExtraMenus(screen()); screen().hideWindowMenus(this); @@ -3269,16 +3318,6 @@ void FluxboxWindow::changeBlackboxHints(const BlackboxHints &net) { } -void FluxboxWindow::upsize() { - -} - - -///TODO -void FluxboxWindow::downsize() { - -} - void FluxboxWindow::fixsize(int *user_w, int *user_h) { int titlebar_height = (decorations.titlebar ? -- cgit v0.11.2