summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-04-26 05:42:36 (GMT)
committerrathnor <rathnor>2003-04-26 05:42:36 (GMT)
commit68ffc78978a3e2aef2b47e4831e7851f3ca51918 (patch)
tree73f4e7ad5996c984f4643e6eb06e991795185632 /src
parent564ad8d06ddfddbc363e434485fa30dbc4120917 (diff)
downloadfluxbox_lack-68ffc78978a3e2aef2b47e4831e7851f3ca51918.zip
fluxbox_lack-68ffc78978a3e2aef2b47e4831e7851f3ca51918.tar.bz2
Add code for remember functionality (Simon)
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am4
-rw-r--r--src/Screen.cc4
-rw-r--r--src/Window.cc43
-rw-r--r--src/Window.hh20
-rw-r--r--src/fluxbox.cc53
5 files changed, 82 insertions, 42 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 8dd4684..38d5b48 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -69,6 +69,8 @@ fluxbox_SOURCES = AtomHandler.hh ArrowButton.hh ArrowButton.cc \
69 WinButton.hh WinButton.cc Window.cc Window.hh \ 69 WinButton.hh WinButton.cc Window.cc Window.hh \
70 Workspace.cc Workspace.hh \ 70 Workspace.cc Workspace.hh \
71 XrmDatabaseHelper.hh FbCommands.hh FbCommands.cc LayerMenu.hh \ 71 XrmDatabaseHelper.hh FbCommands.hh FbCommands.cc LayerMenu.hh \
72 IntResMenuItem.hh IntResMenuItem.cc FbMenu.hh WinClient.hh WinClient.cc 72 IntResMenuItem.hh IntResMenuItem.cc FbMenu.hh \
73 WinClient.hh WinClient.cc \
74 Remember.hh Remember.cc
73 75
74LDADD=FbTk/libFbTk.a 76LDADD=FbTk/libFbTk.a
diff --git a/src/Screen.cc b/src/Screen.cc
index de5e655..226c352 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.135 2003/04/25 17:39:00 fluxgen Exp $ 25// $Id: Screen.cc,v 1.136 2003/04/26 05:42:35 rathnor Exp $
26 26
27 27
28#include "Screen.hh" 28#include "Screen.hh"
@@ -1260,8 +1260,8 @@ FluxboxWindow *BScreen::createWindow(Window client) {
1260 1260
1261 //TODO: is next line needed? 1261 //TODO: is next line needed?
1262 Fluxbox::instance()->saveWindowSearch(client, win); 1262 Fluxbox::instance()->saveWindowSearch(client, win);
1263 Fluxbox::instance()->attachSignals(*win);
1264 setupWindowActions(*win); 1263 setupWindowActions(*win);
1264 Fluxbox::instance()->attachSignals(*win);
1265 } 1265 }
1266 if (win->getWorkspaceNumber() == getCurrentWorkspaceID() || win->isStuck()) { 1266 if (win->getWorkspaceNumber() == getCurrentWorkspaceID() || win->isStuck()) {
1267 win->show(); 1267 win->show();
diff --git a/src/Window.cc b/src/Window.cc
index 10db141..b6e29c7 100644
--- a/src/Window.cc
+++ b/src/Window.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: Window.cc,v 1.148 2003/04/25 16:11:00 fluxgen Exp $ 25// $Id: Window.cc,v 1.149 2003/04/26 05:42:35 rathnor Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -2556,6 +2556,47 @@ void FluxboxWindow::toggleDecoration() {
2556 } 2556 }
2557} 2557}
2558 2558
2559unsigned int FluxboxWindow::getDecorationMask() const {
2560 unsigned int ret = 0;
2561 if (decorations.titlebar)
2562 ret |= DECORM_TITLEBAR;
2563 if (decorations.handle)
2564 ret |= DECORM_HANDLE;
2565 if (decorations.border)
2566 ret |= DECORM_BORDER;
2567 if (decorations.iconify)
2568 ret |= DECORM_ICONIFY;
2569 if (decorations.maximize)
2570 ret |= DECORM_MAXIMIZE;
2571 if (decorations.close)
2572 ret |= DECORM_CLOSE;
2573 if (decorations.menu)
2574 ret |= DECORM_MENU;
2575 if (decorations.sticky)
2576 ret |= DECORM_STICKY;
2577 if (decorations.shade)
2578 ret |= DECORM_SHADE;
2579 if (decorations.tab)
2580 ret |= DECORM_TAB;
2581 if (decorations.enabled)
2582 ret |= DECORM_ENABLED;
2583 return ret;
2584}
2585
2586void FluxboxWindow::setDecorationMask(unsigned int mask) {
2587 decorations.titlebar = mask & DECORM_TITLEBAR;
2588 decorations.handle = mask & DECORM_HANDLE;
2589 decorations.border = mask & DECORM_BORDER;
2590 decorations.iconify = mask & DECORM_ICONIFY;
2591 decorations.maximize = mask & DECORM_MAXIMIZE;
2592 decorations.close = mask & DECORM_CLOSE;
2593 decorations.menu = mask & DECORM_MENU;
2594 decorations.sticky = mask & DECORM_STICKY;
2595 decorations.shade = mask & DECORM_SHADE;
2596 decorations.tab = mask & DECORM_TAB;
2597 decorations.enabled = mask & DECORM_ENABLED;
2598}
2599
2559bool FluxboxWindow::validateClient() { 2600bool FluxboxWindow::validateClient() {
2560 XSync(display, false); 2601 XSync(display, false);
2561 2602
diff --git a/src/Window.hh b/src/Window.hh
index 16e606d..4884a1e 100644
--- a/src/Window.hh
+++ b/src/Window.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: Window.hh,v 1.61 2003/04/25 11:27:13 rathnor Exp $ 25// $Id: Window.hh,v 1.62 2003/04/26 05:42:36 rathnor Exp $
26 26
27#ifndef WINDOW_HH 27#ifndef WINDOW_HH
28#define WINDOW_HH 28#define WINDOW_HH
@@ -204,6 +204,24 @@ public:
204 void setDecoration(Decoration decoration); 204 void setDecoration(Decoration decoration);
205 void toggleDecoration(); 205 void toggleDecoration();
206 206
207 enum DecorationMask {
208 DECORM_TITLEBAR = (1<<0),
209 DECORM_HANDLE = (1<<1),
210 DECORM_BORDER = (1<<2),
211 DECORM_ICONIFY = (1<<3),
212 DECORM_MAXIMIZE = (1<<4),
213 DECORM_CLOSE = (1<<5),
214 DECORM_MENU = (1<<6),
215 DECORM_STICKY = (1<<7),
216 DECORM_SHADE = (1<<8),
217 DECORM_TAB = (1<<9),
218 DECORM_ENABLED = (1<<10),
219 DECORM_LAST = (1<<11) // useful for getting "All"
220 };
221
222 unsigned int getDecorationMask() const;
223 void setDecorationMask(unsigned int mask);
224
207#ifdef SHAPE 225#ifdef SHAPE
208 void shapeEvent(XShapeEvent *event); 226 void shapeEvent(XShapeEvent *event);
209#endif // SHAPE 227#endif // SHAPE
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index 68e098b..5512af3 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.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: fluxbox.cc,v 1.118 2003/04/25 16:00:03 fluxgen Exp $ 25// $Id: fluxbox.cc,v 1.119 2003/04/26 05:42:36 rathnor Exp $
26 26
27#include "fluxbox.hh" 27#include "fluxbox.hh"
28 28
@@ -59,7 +59,10 @@
59#endif // USE_GNOME 59#endif // USE_GNOME
60#ifdef USE_NEWWMSPEC 60#ifdef USE_NEWWMSPEC
61#include "Ewmh.hh" 61#include "Ewmh.hh"
62#endif //USE_NEWWMSPEC 62#endif // USE_NEWWMSPEC
63#ifdef REMEMBER
64#include "Remember.hh"
65#endif // REMEMBER
63 66
64// X headers 67// X headers
65#include <X11/Xlib.h> 68#include <X11/Xlib.h>
@@ -421,6 +424,9 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
421#ifdef USE_NEWWMSPEC 424#ifdef USE_NEWWMSPEC
422 addAtomHandler(new Ewmh()); // for Extended window manager atom support 425 addAtomHandler(new Ewmh()); // for Extended window manager atom support
423#endif // USE_NEWWMSPEC 426#endif // USE_NEWWMSPEC
427#ifdef REMEMBER
428 m_atomhandler.push_back(new Remember()); // for remembering window attribs
429#endif // REMEMBER
424 430
425 grab(); 431 grab();
426 432
@@ -1514,7 +1520,7 @@ void Fluxbox::update(FbTk::Subject *changedsub) {
1514 //!! TODO 1520 //!! TODO
1515#ifdef DEBUG 1521#ifdef DEBUG
1516 cerr<<__FILE__<<"("<<__FUNCTION__<<") TODO: signal stuff for client death!!"<<endl; 1522 cerr<<__FILE__<<"("<<__FUNCTION__<<") TODO: signal stuff for client death!!"<<endl;
1517#endif // DEBUG 1523#endif // DEBUG
1518 } 1524 }
1519} 1525}
1520 1526
@@ -1660,43 +1666,16 @@ void Fluxbox::save_rc() {
1660 for (; it != it_end; ++it) { 1666 for (; it != it_end; ++it) {
1661 BScreen *screen = *it; 1667 BScreen *screen = *it;
1662 int screen_number = screen->getScreenNumber(); 1668 int screen_number = screen->getScreenNumber();
1663 1669
1664/* 1670 /*
1665#ifdef SLIT 1671#ifdef SLIT
1666 string slit_placement; 1672 #ifdef XINERAMA
1667 1673 sprintf(rc_string, "session.screen%d.slit.onHead: %d", screen_number,
1668 switch (screen->getSlitPlacement()) { 1674 screen->getSlitOnHead());
1669 case Slit::TOPLEFT: slit_placement = "TopLeft"; break;
1670 case Slit::CENTERLEFT: slit_placement = "CenterLeft"; break;
1671 case Slit::BOTTOMLEFT: slit_placement = "BottomLeft"; break;
1672 case Slit::TOPCENTER: slit_placement = "TopCenter"; break;
1673 case Slit::BOTTOMCENTER: slit_placement = "BottomCenter"; break;
1674 case Slit::TOPRIGHT: slit_placement = "TopRight"; break;
1675 case Slit::BOTTOMRIGHT: slit_placement = "BottomRight"; break;
1676 case Slit::CENTERRIGHT: default: slit_placement = "CenterRight"; break;
1677 }
1678
1679 sprintf(rc_string, "session.screen%d.slit.placement: %s", screen_number,
1680 slit_placement.c_str());
1681 XrmPutLineResource(&new_blackboxrc, rc_string);
1682
1683 sprintf(rc_string, "session.screen%d.slit.direction: %s", screen_number,
1684 ((screen->getSlitDirection() == Slit::HORIZONTAL) ? "Horizontal" :
1685 "Vertical"));
1686 XrmPutLineResource(&new_blackboxrc, rc_string); 1675 XrmPutLineResource(&new_blackboxrc, rc_string);
1687 1676 #endif // XINERAMA
1688 sprintf(rc_string, "session.screen%d.slit.autoHide: %s", screen_number,
1689 ((screen->getSlit()->doAutoHide()) ? "True" : "False"));
1690 XrmPutLineResource(&new_blackboxrc, rc_string);
1691 /*
1692 #ifdef XINERAMA
1693 sprintf(rc_string, "session.screen%d.slit.onHead: %d", screen_number,
1694 screen->getSlitOnHead());
1695 XrmPutLineResource(&new_blackboxrc, rc_string);
1696 #endif // XINERAMA
1697*//*
1698#endif // SLIT 1677#endif // SLIT
1699 */ 1678 */
1700 sprintf(rc_string, "session.screen%d.rowPlacementDirection: %s", screen_number, 1679 sprintf(rc_string, "session.screen%d.rowPlacementDirection: %s", screen_number,
1701 ((screen->getRowPlacementDirection() == BScreen::LEFTRIGHT) ? 1680 ((screen->getRowPlacementDirection() == BScreen::LEFTRIGHT) ?
1702 "LeftToRight" : "RightToLeft")); 1681 "LeftToRight" : "RightToLeft"));