aboutsummaryrefslogtreecommitdiff
path: root/src/fluxbox.cc
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-02-22 16:09:44 (GMT)
committerrathnor <rathnor>2003-02-22 16:09:44 (GMT)
commitb1cb6bcf66c00b555711e0fcdf35277667fb4a13 (patch)
tree6c7ad1844ae8f33ad4e0c1349751c130599906e6 /src/fluxbox.cc
parentcc2f023a22db212b4097d7756379bb6b9e866b11 (diff)
downloadfluxbox-b1cb6bcf66c00b555711e0fcdf35277667fb4a13.zip
fluxbox-b1cb6bcf66c00b555711e0fcdf35277667fb4a13.tar.bz2
fix autoraise to be saved as separate init option
Diffstat (limited to 'src/fluxbox.cc')
-rw-r--r--src/fluxbox.cc66
1 files changed, 8 insertions, 58 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index 1cb66a9..4caf6f0 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.98 2003/02/22 15:10:43 rathnor Exp $ 25// $Id: fluxbox.cc,v 1.99 2003/02/22 16:09:44 rathnor Exp $
26 26
27 27
28#include "fluxbox.hh" 28#include "fluxbox.hh"
@@ -172,9 +172,14 @@ setFromString(char const *strval) {
172template<> 172template<>
173void Resource<Fluxbox::FocusModel>:: 173void Resource<Fluxbox::FocusModel>::
174setFromString(char const *strval) { 174setFromString(char const *strval) {
175 if (strcasecmp(strval, "SloppyFocus") == 0) 175 // auto raise options here for backwards read compatibility
176 // they are not supported for saving purposes. Nor does the "AutoRaise"
177 // part actually do anything
178 if (strcasecmp(strval, "SloppyFocus") == 0
179 || strcasecmp(strval, "AutoRaiseSloppyFocus") == 0)
176 m_value = Fluxbox::SLOPPYFOCUS; 180 m_value = Fluxbox::SLOPPYFOCUS;
177 else if (strcasecmp(strval, "SemiSloppyFocus") == 0) 181 else if (strcasecmp(strval, "SemiSloppyFocus") == 0
182 || strcasecmp(strval, "AutoRaiseSemiSloppyFocus") == 0)
178 m_value = Fluxbox::SEMISLOPPYFOCUS; 183 m_value = Fluxbox::SEMISLOPPYFOCUS;
179 else if (strcasecmp(strval, "ClickToFocus") == 0) 184 else if (strcasecmp(strval, "ClickToFocus") == 0)
180 m_value = Fluxbox::CLICKTOFOCUS; 185 m_value = Fluxbox::CLICKTOFOCUS;
@@ -1744,24 +1749,6 @@ void Fluxbox::save_rc() {
1744 placement.c_str()); 1749 placement.c_str());
1745 XrmPutLineResource(&new_blackboxrc, rc_string); 1750 XrmPutLineResource(&new_blackboxrc, rc_string);
1746 1751
1747 //TODO
1748/*
1749 std::string focus_mode;
1750 if (screen->isSloppyFocus() && screen->doAutoRaise())
1751 focus_mode = "AutoRaiseSloppyFocus";
1752 else if (screen->isSloppyFocus())
1753 focus_mode = "SloppyFocus";
1754 else if (screen->isSemiSloppyFocus() && screen->doAutoRaise())
1755 focus_mode = "AutoRaiseSemiSloppyFocus";
1756 else if (screen->isSemiSloppyFocus())
1757 focus_mode = "SemiSloppyFocus";
1758 else
1759 focus_mode = "ClickToFocus";
1760
1761 sprintf(rc_string, "session.screen%d.focusModel: %s", screen_number,
1762 focus_mode.c_str());
1763 XrmPutLineResource(&new_blackboxrc, rc_string);
1764*/
1765 // load_rc(screen); 1752 // load_rc(screen);
1766 // these are static, but may not be saved in the users resource file, 1753 // these are static, but may not be saved in the users resource file,
1767 // writing these resources will allow the user to edit them at a later 1754 // writing these resources will allow the user to edit them at a later
@@ -1988,43 +1975,6 @@ void Fluxbox::load_rc(BScreen *screen) {
1988 delete [] search; 1975 delete [] search;
1989 } 1976 }
1990 1977
1991//TODO (use Fluxbox::FocusModel enum)
1992 /*
1993 sprintf(name_lookup, "session.screen%d.focusModel", screen_number);
1994 sprintf(class_lookup, "Session.Screen%d.FocusModel", screen_number);
1995 if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
1996 &value)) {
1997 if (! strncasecmp(value.addr, "clicktofocus", value.size)) {
1998 screen->saveAutoRaise(false);
1999 screen->saveSloppyFocus(false);
2000 screen->saveSemiSloppyFocus(false);
2001
2002 } else if (! strncasecmp(value.addr, "autoraisesloppyfocus", value.size)) {
2003 screen->saveSemiSloppyFocus(false);
2004 screen->saveSloppyFocus(true);
2005 screen->saveAutoRaise(true);
2006 } else if (! strncasecmp(value.addr, "autoraisesemisloppyfocus", value.size)) {
2007 screen->saveSloppyFocus(false);
2008 screen->saveSemiSloppyFocus(true);
2009 screen->saveAutoRaise(true);
2010
2011 } else if (! strncasecmp(value.addr, "semisloppyfocus", value.size)) {
2012 screen->saveSloppyFocus(false);
2013 screen->saveSemiSloppyFocus(true);
2014 screen->saveAutoRaise(false);
2015
2016 } else {
2017
2018 screen->saveSemiSloppyFocus(false);
2019 screen->saveSloppyFocus(true);
2020 screen->saveAutoRaise(false);
2021 }
2022 } else {
2023 screen->saveSemiSloppyFocus(false);
2024 screen->saveSloppyFocus(true);
2025 screen->saveAutoRaise(false);
2026 }
2027 */
2028 sprintf(name_lookup, "session.screen%d.windowPlacement", screen_number); 1978 sprintf(name_lookup, "session.screen%d.windowPlacement", screen_number);
2029 sprintf(class_lookup, "Session.Screen%d.WindowPlacement", screen_number); 1979 sprintf(class_lookup, "Session.Screen%d.WindowPlacement", screen_number);
2030 if (XrmGetResource(*database, name_lookup, class_lookup, &value_type, 1980 if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,