fix some initialisation, especially relating to placement and decoration/handler hints
simonb simonb
5 files changed,
30 insertions(+),
25 deletions(-)
M
ChangeLog
→
ChangeLog
@@ -1,5 +1,9 @@
(Format: Year/Month/Day) Changes for 0.9.12 +*05/01/04: + * Fix some initialisation states, especially window placement with no + decorations through apps (e.g. aterm) + Window.hh/cc Screen.cc Ewmh.cc *05/01/02: * Fix for #996298, Windows dont respect toolbar.border.width (Mathias) Toolbar.cc
M
src/Ewmh.cc
→
src/Ewmh.cc
@@ -238,13 +238,10 @@ unsigned int desktop = static_cast<unsigned int>(*data);
if (desktop == 0xFFFFFFFF && !win.isStuck()) win.stick(); else - win.screen().sendToWorkspace(desktop, &win, false); + win.setWorkspace(desktop, false); XFree(data); } - - updateWorkspace(win); - }
M
src/Screen.cc
→
src/Screen.cc
@@ -1220,9 +1220,9 @@ focused_list.push_front(&win->winClient());
else focused_list.push_back(&win->winClient()); - if (new_win) { - Fluxbox::instance()->attachSignals(*win); - } +// if (new_win) { +// Fluxbox::instance()->attachSignals(*win); +// } // we also need to check if another window expects this window to the left // and if so, then join it.@@ -1240,27 +1240,28 @@ }
FluxboxWindow *BScreen::createWindow(WinClient &client) { + + if (isKdeDockapp(client.window()) && addKdeDockapp(client.window())) { + // we need to save old handler and readd it later +// I think rearranging the logic negates the need for this - sb 04jan2005 +// FbTk::EventManager *evm = FbTk::EventManager::instance(); +// FbTk::EventHandler *evh = evm->find(client.window()); +// evm->add(*evh, client.window()); + return 0; + } + FluxboxWindow *win = new FluxboxWindow(client, winFrameTheme(), *layerManager().getLayer(Fluxbox::instance()->getNormalLayer())); - if (isKdeDockapp(client.window())) { - if (addKdeDockapp(client.window())) { - // we need to save old handler and readd it later - FbTk::EventManager *evm = FbTk::EventManager::instance(); - FbTk::EventHandler *evh = evm->find(client.window()); - delete win; - evm->add(*evh, client.window()); - return 0; - } - } else { - +// Why not KDE? - sb 04jan2005 +// if (!isKdeDockapp(client.window())) { #ifdef SLIT if (win->initialState() == WithdrawnState && slit() != 0) { slit()->addClient(win->clientWindow()); } #endif // SLIT - } +// } if (!win->isManaged()) {@@ -1270,7 +1271,7 @@ }
// don't add to focused_list, as it should already be in there (since the // WinClient already exists). - Fluxbox::instance()->attachSignals(*win); +// Fluxbox::instance()->attachSignals(*win); m_clientlist_sig.notify();
M
src/Window.cc
→
src/Window.cc
@@ -485,6 +485,7 @@ &FluxboxWindow::raise));
m_timer.setCommand(raise_cmd); m_timer.fireOnce(true); + // Slit client? if (m_client->initial_state == WithdrawnState) { return; }@@ -492,6 +493,7 @@
m_managed = true; //this window is managed Fluxbox::instance()->saveWindowSearchGroup(frame().window().window(), this); + Fluxbox::instance()->attachSignals(*this); // update transient infomation m_client->updateTransientInfo();@@ -518,10 +520,10 @@ associateClientWindow(true, wattrib.x, wattrib.y, wattrib.width, wattrib.height);
grabButtons(); + restoreAttributes(); + if (m_workspace_number < 0 || m_workspace_number >= screen().getCount()) m_workspace_number = screen().currentWorkspaceID(); - - restoreAttributes(); bool place_window = true; if (fluxbox.isStartup() || m_client->isTransient() ||@@ -569,6 +571,7 @@ moveResize(frame().x(), frame().y(), frame().width(), frame().height());
screen().getWorkspace(m_workspace_number)->addWindow(*this, place_window); + setWorkspace(m_workspace_number, true); if (shaded) { // start shaded shaded = false;@@ -1745,7 +1748,7 @@ maximize(MAX_FULL);
} -void FluxboxWindow::setWorkspace(int n) { +void FluxboxWindow::setWorkspace(int n, bool notify) { unsigned int old_wkspc = m_workspace_number; m_workspace_number = n;@@ -1754,7 +1757,7 @@ m_blackbox_attrib.flags |= ATTRIB_WORKSPACE;
m_blackbox_attrib.workspace = m_workspace_number; // notify workspace change - if (!stuck && old_wkspc != m_workspace_number) { + if (notify && !stuck && old_wkspc != m_workspace_number) { #ifdef DEBUG cerr<<this<<" notify workspace signal"<<endl; #endif // DEBUG
M
src/Window.hh
→
src/Window.hh
@@ -234,7 +234,7 @@ void resize(unsigned int width, unsigned int height);
/// move and resize frame to pox x,y and size width, height void moveResize(int x, int y, unsigned int width, unsigned int height, int gravity = ForgetGravity); - void setWorkspace(int n); + void setWorkspace(int n, bool notify = true); void changeBlackboxHints(const BlackboxHints &bh); void updateFunctions(); void restoreAttributes();