diff options
author | fluxgen <fluxgen> | 2004-01-19 18:29:43 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2004-01-19 18:29:43 (GMT) |
commit | 2e0fba32533f505e5121e7506de8987ac12c2cdc (patch) | |
tree | 4f465fa6a89ec43ea03c8c19f15280550e53c705 | |
parent | df5d6f30e27eb058c71cf4f3b80e358f35260a2d (diff) | |
download | fluxbox_pavel-2e0fba32533f505e5121e7506de8987ac12c2cdc.zip fluxbox_pavel-2e0fba32533f505e5121e7506de8987ac12c2cdc.tar.bz2 |
workspace area signal
-rw-r--r-- | src/Screen.cc | 28 | ||||
-rw-r--r-- | src/Screen.hh | 7 |
2 files changed, 24 insertions, 11 deletions
diff --git a/src/Screen.cc b/src/Screen.cc index a81ee9e..57dead2 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: Screen.cc,v 1.261 2004/01/16 11:47:07 fluxgen Exp $ | 25 | // $Id: Screen.cc,v 1.262 2004/01/19 18:29:43 fluxgen Exp $ |
26 | 26 | ||
27 | 27 | ||
28 | #include "Screen.hh" | 28 | #include "Screen.hh" |
@@ -386,6 +386,7 @@ BScreen::BScreen(FbTk::ResourceManager &rm, | |||
386 | m_iconlist_sig(*this), // icon list signal | 386 | m_iconlist_sig(*this), // icon list signal |
387 | m_workspacecount_sig(*this), // workspace count signal | 387 | m_workspacecount_sig(*this), // workspace count signal |
388 | m_workspacenames_sig(*this), // workspace names signal | 388 | m_workspacenames_sig(*this), // workspace names signal |
389 | m_workspace_area_sig(*this), // workspace area signal | ||
389 | m_currentworkspace_sig(*this), // current workspace signal | 390 | m_currentworkspace_sig(*this), // current workspace signal |
390 | m_reconfigure_sig(*this), // reconfigure signal | 391 | m_reconfigure_sig(*this), // reconfigure signal |
391 | m_resize_sig(*this), | 392 | m_resize_sig(*this), |
@@ -1078,10 +1079,10 @@ void BScreen::changeWorkspaceID(unsigned int id) { | |||
1078 | // This is a little tricks to reduce flicker | 1079 | // This is a little tricks to reduce flicker |
1079 | // this way we can set focus pixmap on frame before we show it | 1080 | // this way we can set focus pixmap on frame before we show it |
1080 | // and using ExposeEvent to redraw without flicker | 1081 | // and using ExposeEvent to redraw without flicker |
1081 | /* | 1082 | /* |
1082 | WinClient *win = getLastFocusedWindow(currentWorkspaceID()); | 1083 | WinClient *win = getLastFocusedWindow(currentWorkspaceID()); |
1083 | if (win && win->fbwindow()) | 1084 | if (win && win->fbwindow()) |
1084 | win->fbwindow()->setFocusFlag(true); | 1085 | win->fbwindow()->setFocusFlag(true); |
1085 | */ | 1086 | */ |
1086 | 1087 | ||
1087 | currentWorkspace()->showAll(); | 1088 | currentWorkspace()->showAll(); |
@@ -1095,6 +1096,7 @@ void BScreen::changeWorkspaceID(unsigned int id) { | |||
1095 | focused->resumeMoving(); | 1096 | focused->resumeMoving(); |
1096 | 1097 | ||
1097 | updateNetizenCurrentWorkspace(); | 1098 | updateNetizenCurrentWorkspace(); |
1099 | FbTk::App::instance()->sync(false); | ||
1098 | 1100 | ||
1099 | } | 1101 | } |
1100 | 1102 | ||
@@ -1210,8 +1212,6 @@ void BScreen::updateNetizenWindowAdd(Window w, unsigned long p) { | |||
1210 | for (; it != it_end; ++it) { | 1212 | for (; it != it_end; ++it) { |
1211 | (*it)->sendWindowAdd(w, p); | 1213 | (*it)->sendWindowAdd(w, p); |
1212 | } | 1214 | } |
1213 | |||
1214 | m_clientlist_sig.notify(); | ||
1215 | 1215 | ||
1216 | } | 1216 | } |
1217 | 1217 | ||
@@ -1355,6 +1355,8 @@ FluxboxWindow *BScreen::createWindow(Window client) { | |||
1355 | win->show(); | 1355 | win->show(); |
1356 | } | 1356 | } |
1357 | 1357 | ||
1358 | m_clientlist_sig.notify(); | ||
1359 | |||
1358 | FbTk::App::instance()->sync(false); | 1360 | FbTk::App::instance()->sync(false); |
1359 | return win; | 1361 | return win; |
1360 | } | 1362 | } |
@@ -1379,6 +1381,8 @@ FluxboxWindow *BScreen::createWindow(WinClient &client) { | |||
1379 | if (win->workspaceNumber() == currentWorkspaceID() || win->isStuck()) | 1381 | if (win->workspaceNumber() == currentWorkspaceID() || win->isStuck()) |
1380 | win->show(); | 1382 | win->show(); |
1381 | 1383 | ||
1384 | m_clientlist_sig.notify(); | ||
1385 | |||
1382 | return win; | 1386 | return win; |
1383 | } | 1387 | } |
1384 | 1388 | ||
@@ -1418,18 +1422,23 @@ private: | |||
1418 | Strut &m_max_area; | 1422 | Strut &m_max_area; |
1419 | }; | 1423 | }; |
1420 | 1424 | ||
1421 | }; // end anonymous namespace | 1425 | } // end anonymous namespace |
1422 | 1426 | ||
1423 | void BScreen::updateAvailableWorkspaceArea() { | 1427 | void BScreen::updateAvailableWorkspaceArea() { |
1424 | // find max of left, right, top and bottom and set avaible workspace area | 1428 | // find max of left, right, top and bottom and set avaible workspace area |
1425 | 1429 | ||
1426 | // clear old area | 1430 | // clear old area |
1431 | Strut oldarea = *(m_available_workspace_area.get()); | ||
1427 | m_available_workspace_area.reset(new Strut(0, 0, 0, 0)); | 1432 | m_available_workspace_area.reset(new Strut(0, 0, 0, 0)); |
1428 | 1433 | ||
1429 | // calculate max area | 1434 | // calculate max area |
1430 | for_each(m_strutlist.begin(), | 1435 | for_each(m_strutlist.begin(), |
1431 | m_strutlist.end(), | 1436 | m_strutlist.end(), |
1432 | MaxArea(*m_available_workspace_area.get())); | 1437 | MaxArea(*m_available_workspace_area.get())); |
1438 | |||
1439 | // only notify if the area changed | ||
1440 | if (oldarea == *(m_available_workspace_area.get())) | ||
1441 | m_workspace_area_sig.notify(); | ||
1433 | } | 1442 | } |
1434 | 1443 | ||
1435 | void BScreen::addWorkspaceName(const char *name) { | 1444 | void BScreen::addWorkspaceName(const char *name) { |
@@ -2390,7 +2399,8 @@ bool BScreen::doSkipWindow(const WinClient &winclient, int opts) { | |||
2390 | (opts & CYCLESKIPSTUCK) != 0 && win->isStuck() || // skip if stuck | 2399 | (opts & CYCLESKIPSTUCK) != 0 && win->isStuck() || // skip if stuck |
2391 | // skip if not active client (i.e. only visit each fbwin once) | 2400 | // skip if not active client (i.e. only visit each fbwin once) |
2392 | (opts & CYCLEGROUPS) != 0 && win->winClient().window() != winclient.window() || | 2401 | (opts & CYCLEGROUPS) != 0 && win->winClient().window() != winclient.window() || |
2393 | (opts & CYCLESKIPSHADED) != 0 && win->isShaded() // skip if shaded | 2402 | (opts & CYCLESKIPSHADED) != 0 && win->isShaded() || // skip if shaded |
2403 | win->isHidden() | ||
2394 | ); | 2404 | ); |
2395 | } | 2405 | } |
2396 | 2406 | ||
diff --git a/src/Screen.hh b/src/Screen.hh index 8f5951e..ced6f66 100644 --- a/src/Screen.hh +++ b/src/Screen.hh | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: Screen.hh,v 1.133 2004/01/16 11:58:45 fluxgen Exp $ | 25 | // $Id: Screen.hh,v 1.134 2004/01/19 18:28:58 fluxgen Exp $ |
26 | 26 | ||
27 | #ifndef SCREEN_HH | 27 | #ifndef SCREEN_HH |
28 | #define SCREEN_HH | 28 | #define SCREEN_HH |
@@ -136,7 +136,7 @@ public: | |||
136 | 136 | ||
137 | inline unsigned int width() const { return rootWindow().width(); } | 137 | inline unsigned int width() const { return rootWindow().width(); } |
138 | inline unsigned int height() const { return rootWindow().height(); } | 138 | inline unsigned int height() const { return rootWindow().height(); } |
139 | inline unsigned int screenNumber() const { return rootWindow().screenNumber(); } | 139 | inline int screenNumber() const { return rootWindow().screenNumber(); } |
140 | 140 | ||
141 | /// @return number of workspaces | 141 | /// @return number of workspaces |
142 | inline unsigned int getCount() const { return m_workspaces_list.size(); } | 142 | inline unsigned int getCount() const { return m_workspaces_list.size(); } |
@@ -162,6 +162,8 @@ public: | |||
162 | FbTk::Subject &workspaceCountSig() { return m_workspacecount_sig; } | 162 | FbTk::Subject &workspaceCountSig() { return m_workspacecount_sig; } |
163 | /// workspace names signal | 163 | /// workspace names signal |
164 | FbTk::Subject &workspaceNamesSig() { return m_workspacenames_sig; } | 164 | FbTk::Subject &workspaceNamesSig() { return m_workspacenames_sig; } |
165 | /// workspace area signal | ||
166 | FbTk::Subject &workspaceAreaSig() { return m_workspace_area_sig; } | ||
165 | /// current workspace signal | 167 | /// current workspace signal |
166 | FbTk::Subject ¤tWorkspaceSig() { return m_currentworkspace_sig; } | 168 | FbTk::Subject ¤tWorkspaceSig() { return m_currentworkspace_sig; } |
167 | /// reconfigure signal | 169 | /// reconfigure signal |
@@ -360,6 +362,7 @@ private: | |||
360 | m_iconlist_sig, ///< notify if a window gets iconified/deiconified | 362 | m_iconlist_sig, ///< notify if a window gets iconified/deiconified |
361 | m_workspacecount_sig, ///< workspace count signal | 363 | m_workspacecount_sig, ///< workspace count signal |
362 | m_workspacenames_sig, ///< workspace names signal | 364 | m_workspacenames_sig, ///< workspace names signal |
365 | m_workspace_area_sig, ///< workspace area changed signal | ||
363 | m_currentworkspace_sig, ///< current workspace signal | 366 | m_currentworkspace_sig, ///< current workspace signal |
364 | m_reconfigure_sig, ///< reconfigure signal | 367 | m_reconfigure_sig, ///< reconfigure signal |
365 | m_resize_sig; ///< resize signal | 368 | m_resize_sig; ///< resize signal |