Changed workspace area signal to use the new signal system
This commit is contained in:
parent
f2c8868724
commit
2fcc0fd9e7
7 changed files with 31 additions and 21 deletions
|
@ -1,7 +1,9 @@
|
|||
(Format: Year/Month/Day)
|
||||
Changes for 1.1.2
|
||||
*08/09/28:
|
||||
* Change focused window signal to use the new signal system (Henrik)
|
||||
* Changed workspace area signal to use the new signal system (Henrik)
|
||||
Window.hh/cc, Screen.hh/cc, fluxbox.hh/cc
|
||||
* Changed focused window signal to use the new signal system (Henrik)
|
||||
FbTk/Signal.hh, FocusControl.cc, FocusableList.hh/cc, Screen.hh/cc
|
||||
Window.hh/cc, fluxbox.hh/cc
|
||||
*08/09/25:
|
||||
|
|
|
@ -339,7 +339,6 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
|
|||
const string &screenname,
|
||||
const string &altscreenname,
|
||||
int scrn, int num_layers) :
|
||||
m_workspace_area_sig(*this), // workspace area signal
|
||||
m_reconfigure_sig(*this), // reconfigure signal
|
||||
m_resize_sig(*this),
|
||||
m_layermanager(num_layers),
|
||||
|
@ -1453,7 +1452,7 @@ void BScreen::updateAvailableWorkspaceArea() {
|
|||
}
|
||||
|
||||
if (updated)
|
||||
m_workspace_area_sig.notify();
|
||||
m_workspace_area_sig.emit(*this);
|
||||
}
|
||||
|
||||
void BScreen::addWorkspaceName(const char *name) {
|
||||
|
@ -1933,7 +1932,7 @@ void BScreen::updateSize() {
|
|||
|
||||
// send resize notify
|
||||
m_resize_sig.notify();
|
||||
m_workspace_area_sig.notify();
|
||||
m_workspace_area_sig.emit(*this);
|
||||
|
||||
// move windows out of inactive heads
|
||||
clearHeads();
|
||||
|
|
|
@ -219,7 +219,7 @@ public:
|
|||
/// workspace names signal
|
||||
ScreenSignal &workspaceNamesSig() { return m_workspacenames_sig; }
|
||||
/// workspace area signal
|
||||
FbTk::Subject &workspaceAreaSig() { return m_workspace_area_sig; }
|
||||
ScreenSignal &workspaceAreaSig() { return m_workspace_area_sig; }
|
||||
/// current workspace signal
|
||||
ScreenSignal ¤tWorkspaceSig() { return m_currentworkspace_sig; }
|
||||
/// focused window signal
|
||||
|
@ -494,11 +494,11 @@ private:
|
|||
const Strut* availableWorkspaceArea(int head) const;
|
||||
|
||||
ScreenSubject
|
||||
m_workspace_area_sig, ///< workspace area changed signal
|
||||
m_reconfigure_sig, ///< reconfigure signal
|
||||
m_resize_sig; ///< resize signal
|
||||
|
||||
FbTk::Signal<void, BScreen&, FluxboxWindow*, WinClient*> m_focusedwindow_sig; ///< focused window signal
|
||||
ScreenSignal m_workspace_area_sig; ///< workspace area changed signal
|
||||
ScreenSignal m_iconlist_sig; ///< notify if a window gets iconified/deiconified
|
||||
ScreenSignal m_clientlist_sig; ///< client signal
|
||||
ScreenSignal m_bg_change_sig; ///< background change signal
|
||||
|
|
|
@ -1488,9 +1488,10 @@ void FluxboxWindow::attachWorkAreaSig() {
|
|||
// notify when struts change, so we can resize accordingly
|
||||
// Subject checks for duplicates for us
|
||||
if (m_state.maximized || m_state.fullscreen)
|
||||
screen().workspaceAreaSig().attach(this);
|
||||
join(screen().workspaceAreaSig(),
|
||||
FbTk::MemFun(*this, &FluxboxWindow::workspaceAreaChanged));
|
||||
else
|
||||
screen().workspaceAreaSig().detach(this);
|
||||
leave(screen().workspaceAreaSig());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2729,14 +2730,16 @@ void FluxboxWindow::update(FbTk::Subject *subj) {
|
|||
} else if (subj == &m_theme.reconfigSig()) {
|
||||
frame().applyDecorations();
|
||||
sendConfigureNotify();
|
||||
} else if (subj == &screen().workspaceAreaSig()) {
|
||||
frame().applyState();
|
||||
} else if (m_initialized && subj == &m_frame.frameExtentSig()) {
|
||||
Fluxbox::instance()->updateFrameExtents(*this);
|
||||
sendConfigureNotify();
|
||||
}
|
||||
}
|
||||
|
||||
void FluxboxWindow::workspaceAreaChanged(BScreen &screen) {
|
||||
frame().applyState();
|
||||
}
|
||||
|
||||
// commit current decoration values to actual displayed things
|
||||
void FluxboxWindow::applyDecorations() {
|
||||
frame().setDecorationMask(decorationMask());
|
||||
|
|
|
@ -526,6 +526,9 @@ private:
|
|||
void associateClient(WinClient &client);
|
||||
/// Called when focused changed, and is attached when it is not in fullscreen mode
|
||||
void focusedWindowChanged(BScreen &screen, FluxboxWindow *focused_win, WinClient* client);
|
||||
/// Called when workspace area on screen changed.
|
||||
void workspaceAreaChanged(BScreen &screen);
|
||||
|
||||
|
||||
// state and hint signals
|
||||
WinSubject m_hintsig,
|
||||
|
|
|
@ -453,7 +453,9 @@ void Fluxbox::initScreen(BScreen *screen) {
|
|||
screen->initWindows();
|
||||
|
||||
// attach screen signals to this
|
||||
screen->workspaceAreaSig().attach(this);
|
||||
|
||||
join(screen->workspaceAreaSig(),
|
||||
FbTk::MemFun(*this, &Fluxbox::workspaceAreaChanged));
|
||||
|
||||
join(screen->focusedWindowSig(),
|
||||
FbTk::MemFun(*this, &Fluxbox::focusedWindowChanged));
|
||||
|
@ -1104,16 +1106,6 @@ void Fluxbox::update(FbTk::Subject *changedsub) {
|
|||
}
|
||||
|
||||
screen.removeClient(*client);
|
||||
} else if (typeid(*changedsub) == typeid(BScreen::ScreenSubject)) {
|
||||
BScreen::ScreenSubject *subj = dynamic_cast<BScreen::ScreenSubject *>(changedsub);
|
||||
BScreen &screen = subj->screen();
|
||||
if ((&(screen.workspaceAreaSig())) == changedsub) {
|
||||
for (AtomHandlerContainerIt it= m_atomhandler.begin();
|
||||
it != m_atomhandler.end(); ++it) {
|
||||
if ((*it).first->update())
|
||||
(*it).first->updateWorkarea(screen);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1540,3 +1532,11 @@ void Fluxbox::focusedWindowChanged(BScreen &screen,
|
|||
(*it).first->updateFocusedWindow(screen, client ? client->window() : 0 );
|
||||
}
|
||||
}
|
||||
|
||||
void Fluxbox::workspaceAreaChanged(BScreen &screen) {
|
||||
for (AtomHandlerContainerIt it= m_atomhandler.begin();
|
||||
it != m_atomhandler.end(); ++it) {
|
||||
if ((*it).first->update())
|
||||
(*it).first->updateWorkarea(screen);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -214,6 +214,9 @@ private:
|
|||
FluxboxWindow* win,
|
||||
WinClient* client);
|
||||
|
||||
/// Called when the workspace area changed.
|
||||
void workspaceAreaChanged(BScreen &screen);
|
||||
|
||||
std::auto_ptr<FbAtoms> m_fbatoms;
|
||||
|
||||
FbTk::ResourceManager m_resourcemanager, &m_screen_rm;
|
||||
|
|
Loading…
Reference in a new issue