all repos — fluxbox @ f6ee704a1d3429c6dedb03d84b4d70103cf8db15

custom fork of the fluxbox windowmanager

remove 'friend' declaration in Window.hh
Mark Tiefenbruck mark@fluxbox.org
commit

f6ee704a1d3429c6dedb03d84b4d70103cf8db15

parent

a10b308b4eb962fcb703b0806e0b5d77c7057ade

4 files changed, 28 insertions(+), 25 deletions(-)

jump to
M src/WinClient.ccsrc/WinClient.cc

@@ -356,24 +356,19 @@ return;

m_title = string(Xutil::getWMName(window()), 0, 512); titleSig().notify(); - if (fbwindow()) - fbwindow()->updateTitleFromClient(*this); } void WinClient::setTitle(FbTk::FbString &title) { m_title = title; m_title_override = true; titleSig().notify(); - if (fbwindow()) - fbwindow()->updateTitleFromClient(*this); } -void WinClient::saveBlackboxAttribs(FluxboxWindow::BlackboxAttributes &blackbox_attribs) { +void WinClient::saveBlackboxAttribs(FluxboxWindow::BlackboxAttributes &blackbox_attribs, int nelements) { changeProperty(FbAtoms::instance()->getFluxboxAttributesAtom(), XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&blackbox_attribs, - FluxboxWindow::PropBlackboxAttributesElements - ); + nelements); } void WinClient::setFluxboxWindow(FluxboxWindow *win) {
M src/WinClient.hhsrc/WinClient.hh

@@ -94,7 +94,7 @@ bool checkSizeHints(unsigned int width, unsigned int height);

void setGroupLeftWindow(Window win); - void saveBlackboxAttribs(FluxboxWindow::BlackboxAttributes &blackbox_attribs); + void saveBlackboxAttribs(FluxboxWindow::BlackboxAttributes &blackbox_attribs, int nelements); void setFluxboxWindow(FluxboxWindow *win); // does this client have a pending unmap or destroy event?
M src/Window.ccsrc/Window.cc

@@ -628,7 +628,8 @@ //null if we want the new button at the end of the list

if (x >= 0 && button_insert_pos) frame().moveLabelButtonLeftOf(*m_labelbuttons[*client_it], *button_insert_pos); - (*client_it)->saveBlackboxAttribs(m_blackbox_attrib); + (*client_it)->saveBlackboxAttribs(m_blackbox_attrib, + PropBlackboxAttributesElements); } // add client and move over all attached clients

@@ -657,7 +658,8 @@ if (focus_new && !is_startup)

m_focused = true; focused_win = (focus_new || is_startup) ? &client : m_client; - client.saveBlackboxAttribs(m_blackbox_attrib); + client.saveBlackboxAttribs(m_blackbox_attrib, + PropBlackboxAttributesElements); m_clientlist.push_back(&client); }

@@ -1087,14 +1089,6 @@ it_end = m_labelbuttons.end();

for (; it != it_end; ++it) it->second->setPixmap(screen().getTabsUsePixmap()); -} - -/// update current client title and title in our frame -void FluxboxWindow::updateTitleFromClient(WinClient &client) { - if (&client == m_client) { - frame().setFocusTitle(client.title()); - titleSig().notify(); - } } void FluxboxWindow::updateMWMHintsFromClient(WinClient &client) {

@@ -2917,6 +2911,20 @@ //if (ev.window == frame().window())

//installColormap(false); } +void FluxboxWindow::update(FbTk::Subject *subj) { + if (subj && typeid(*subj) == typeid(Focusable::FocusSubject)) { + Focusable::FocusSubject &fsubj = + static_cast<Focusable::FocusSubject &>(*subj); + Focusable &win = fsubj.win(); + + if (&fsubj == &win.titleSig() && &win == m_client) { + frame().setFocusTitle(win.title()); + titleSig().notify(); + } + + } +} + // commit current decoration values to actual displayed things void FluxboxWindow::applyDecorations(bool initial) { frame().clientArea().setBorderWidth(0); // client area bordered by other things

@@ -4043,6 +4051,7 @@

evm.add(*this, btn->window()); // we take care of button events for this evm.add(*this, client.window()); client.setFluxboxWindow(this); + client.titleSig().attach(this); } int FluxboxWindow::getDecoMaskFromString(const string &str_label) {
M src/Window.hhsrc/Window.hh

@@ -29,6 +29,7 @@ #define WINDOW_HH

#include "FbTk/Timer.hh" #include "FbTk/Subject.hh" +#include "FbTk/Observer.hh" #include "FbTk/EventHandler.hh" #include "FbTk/XLayerItem.hh" #include "FbWinFrame.hh"

@@ -58,7 +59,8 @@ class Menu;

} /// Creates the window frame and handles any window event for it -class FluxboxWindow: public Focusable, public FbTk::EventHandler { +class FluxboxWindow: public Focusable, public FbTk::Observer, + public FbTk::EventHandler { public: /// Motif wm Hints enum {

@@ -366,6 +368,9 @@ void enterNotifyEvent(XCrossingEvent &ev);

void leaveNotifyEvent(XCrossingEvent &ev); //@} + /// handle Subject notifications + void update(FbTk::Subject *subj); + void applyDecorations(bool initial = false); void toggleDecoration();

@@ -536,9 +541,6 @@ /// try to attach current attaching client to a window at pos x, y

void attachTo(int x, int y, bool interrupted = false); bool getState(); - /// gets title string from client window and updates frame's title - void updateTitleFromClient(WinClient &client); - /// gets icon name from client window void updateMWMHintsFromClient(WinClient &client); void updateRememberStateFromClient(WinClient &client); void saveBlackboxAttribs();

@@ -612,9 +614,6 @@ ClientList m_clientlist;

WinClient *m_client; ///< current client typedef std::map<WinClient *, IconButton *> Client2ButtonMap; Client2ButtonMap m_labelbuttons; - - // just temporary solution - friend class WinClient; struct _decorations { bool titlebar, handle, border, iconify,