From c5fd69cc9de2ed08176d655c1e46e9305c5543df Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Mon, 29 Sep 2014 09:24:42 +0200 Subject: treat windows having WM_CLASS == "DockApp" like DockApps this commit implements feature-request #317: "Add support for GTK dockapps.": "Back in 2010, WindowMaker implemented a system where windows with WM_CLASS res_class = DockApp would be treated as if they had initial_state = WithdrawnState, since GTK refuses to allow this." --- src/Screen.cc | 13 +++++++++---- src/Window.cc | 5 ++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/Screen.cc b/src/Screen.cc index f1cee02..29ab548 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -1236,14 +1236,14 @@ bool BScreen::addKdeDockapp(Window client) { FluxboxWindow *BScreen::createWindow(Window client) { FbTk::App::instance()->sync(false); - if (isKdeDockapp(client) && addKdeDockapp(client)) { return 0; // dont create a FluxboxWindow for this one } WinClient *winclient = new WinClient(client, *this); - if (winclient->initial_state == WithdrawnState) { + if (winclient->initial_state == WithdrawnState || + winclient->getWMClassClass() == "DockApp") { delete winclient; #ifdef USE_SLIT if (slit() && !isKdeDockapp(client)) @@ -1306,8 +1306,13 @@ FluxboxWindow *BScreen::createWindow(WinClient &client) { FluxboxWindow *win = new FluxboxWindow(client); #ifdef SLIT - if (win->initialState() == WithdrawnState && slit() != 0) { - slit()->addClient(client.window()); + if (slit() != 0) { + + if (win->initialState() == WithdrawnState) { + slit()->addClient(client.window()); + } else if (client->getWMClassClass() == "DockApp") { + slit()->addClient(client.window()); + } } #endif // SLIT diff --git a/src/Window.cc b/src/Window.cc index b44fd1d..2b997a7 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -389,8 +389,10 @@ void FluxboxWindow::init() { if (! m_client->getAttrib(wattrib) || !wattrib.screen || // no screen? ?? wattrib.override_redirect || // override redirect - m_client->initial_state == WithdrawnState) // Slit client + m_client->initial_state == WithdrawnState || + m_client->getWMClassClass() == "DockApp") { // Slit client return; + } if (m_client->initial_state == IconicState) m_state.iconic = true; @@ -399,6 +401,7 @@ void FluxboxWindow::init() { m_client->setGroupLeftWindow(None); // nothing to the left. if (Fluxbox::instance()->haveShape()) + Shape::setShapeNotify(winClient()); //!! TODO init of client should be better -- cgit v0.11.2