From b1cb6bcf66c00b555711e0fcdf35277667fb4a13 Mon Sep 17 00:00:00 2001 From: rathnor Date: Sat, 22 Feb 2003 16:09:44 +0000 Subject: fix autoraise to be saved as separate init option --- src/Screen.cc | 5 +++-- src/Screen.hh | 8 +++---- src/fluxbox.cc | 66 +++++++--------------------------------------------------- 3 files changed, 15 insertions(+), 64 deletions(-) diff --git a/src/Screen.cc b/src/Screen.cc index 9ca7859..b9a3b21 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.cc,v 1.113 2003/02/22 15:10:43 rathnor Exp $ +// $Id: Screen.cc,v 1.114 2003/02/22 16:09:44 rathnor Exp $ #include "Screen.hh" @@ -361,6 +361,7 @@ BScreen::ScreenResource::ScreenResource(ResourceManager &rm, focus_last(rm, true, scrname+".focusLastWindow", altscrname+".FocusLastWindow"), focus_new(rm, true, scrname+".focusNewWindows", altscrname+".FocusNewWindows"), antialias(rm, false, scrname+".antialias", altscrname+".Antialias"), + auto_raise(rm, false, scrname+".autoRaise", altscrname+".AutoRaise"), rootcommand(rm, "", scrname+".rootCommand", altscrname+".RootCommand"), focus_model(rm, Fluxbox::CLICKTOFOCUS, scrname+".focusModel", altscrname+".FocusModel"), workspaces(rm, 1, scrname+".workspaces", altscrname+".Workspaces"), @@ -1758,7 +1759,7 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { ConfigmenuSet, ConfigmenuAutoRaise, "Auto Raise"), - resource.auto_raise, + *resource.auto_raise, save_and_reconfigure)); focus_menu->update(); diff --git a/src/Screen.hh b/src/Screen.hh index a30ca40..9488f3c 100644 --- a/src/Screen.hh +++ b/src/Screen.hh @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.hh,v 1.70 2003/02/22 15:10:43 rathnor Exp $ +// $Id: Screen.hh,v 1.71 2003/02/22 16:09:44 rathnor Exp $ #ifndef SCREEN_HH #define SCREEN_HH @@ -87,7 +87,7 @@ public: inline bool isSloppyWindowGrouping() const { return *resource.sloppy_window_grouping; } inline bool isWorkspaceWarping() const { return *resource.workspace_warping; } inline bool isDesktopWheeling() const { return *resource.desktop_wheeling; } - inline bool doAutoRaise() const { return resource.auto_raise; } + inline bool doAutoRaise() const { return *resource.auto_raise; } inline bool doImageDither() const { return *resource.image_dither; } inline bool doMaxOverSlit() const { return *resource.max_over_slit; } inline bool doOpaqueMove() const { return *resource.opaque_move; } @@ -382,10 +382,10 @@ private: sloppy_window_grouping, workspace_warping, desktop_wheeling, show_window_pos, focus_last, focus_new, - antialias; + antialias, auto_raise; Resource rootcommand; Resource focus_model; - bool auto_raise, ordered_dither; + bool ordered_dither; Resource workspaces, toolbar_width_percent, edge_snap_threshold, tab_width, tab_height; Resource slit_layernum, toolbar_layernum; 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 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.cc,v 1.98 2003/02/22 15:10:43 rathnor Exp $ +// $Id: fluxbox.cc,v 1.99 2003/02/22 16:09:44 rathnor Exp $ #include "fluxbox.hh" @@ -172,9 +172,14 @@ setFromString(char const *strval) { template<> void Resource:: setFromString(char const *strval) { - if (strcasecmp(strval, "SloppyFocus") == 0) + // auto raise options here for backwards read compatibility + // they are not supported for saving purposes. Nor does the "AutoRaise" + // part actually do anything + if (strcasecmp(strval, "SloppyFocus") == 0 + || strcasecmp(strval, "AutoRaiseSloppyFocus") == 0) m_value = Fluxbox::SLOPPYFOCUS; - else if (strcasecmp(strval, "SemiSloppyFocus") == 0) + else if (strcasecmp(strval, "SemiSloppyFocus") == 0 + || strcasecmp(strval, "AutoRaiseSemiSloppyFocus") == 0) m_value = Fluxbox::SEMISLOPPYFOCUS; else if (strcasecmp(strval, "ClickToFocus") == 0) m_value = Fluxbox::CLICKTOFOCUS; @@ -1744,24 +1749,6 @@ void Fluxbox::save_rc() { placement.c_str()); XrmPutLineResource(&new_blackboxrc, rc_string); - //TODO -/* - std::string focus_mode; - if (screen->isSloppyFocus() && screen->doAutoRaise()) - focus_mode = "AutoRaiseSloppyFocus"; - else if (screen->isSloppyFocus()) - focus_mode = "SloppyFocus"; - else if (screen->isSemiSloppyFocus() && screen->doAutoRaise()) - focus_mode = "AutoRaiseSemiSloppyFocus"; - else if (screen->isSemiSloppyFocus()) - focus_mode = "SemiSloppyFocus"; - else - focus_mode = "ClickToFocus"; - - sprintf(rc_string, "session.screen%d.focusModel: %s", screen_number, - focus_mode.c_str()); - XrmPutLineResource(&new_blackboxrc, rc_string); -*/ // load_rc(screen); // these are static, but may not be saved in the users resource file, // writing these resources will allow the user to edit them at a later @@ -1988,43 +1975,6 @@ void Fluxbox::load_rc(BScreen *screen) { delete [] search; } -//TODO (use Fluxbox::FocusModel enum) - /* - sprintf(name_lookup, "session.screen%d.focusModel", screen_number); - sprintf(class_lookup, "Session.Screen%d.FocusModel", screen_number); - if (XrmGetResource(*database, name_lookup, class_lookup, &value_type, - &value)) { - if (! strncasecmp(value.addr, "clicktofocus", value.size)) { - screen->saveAutoRaise(false); - screen->saveSloppyFocus(false); - screen->saveSemiSloppyFocus(false); - - } else if (! strncasecmp(value.addr, "autoraisesloppyfocus", value.size)) { - screen->saveSemiSloppyFocus(false); - screen->saveSloppyFocus(true); - screen->saveAutoRaise(true); - } else if (! strncasecmp(value.addr, "autoraisesemisloppyfocus", value.size)) { - screen->saveSloppyFocus(false); - screen->saveSemiSloppyFocus(true); - screen->saveAutoRaise(true); - - } else if (! strncasecmp(value.addr, "semisloppyfocus", value.size)) { - screen->saveSloppyFocus(false); - screen->saveSemiSloppyFocus(true); - screen->saveAutoRaise(false); - - } else { - - screen->saveSemiSloppyFocus(false); - screen->saveSloppyFocus(true); - screen->saveAutoRaise(false); - } - } else { - screen->saveSemiSloppyFocus(false); - screen->saveSloppyFocus(true); - screen->saveAutoRaise(false); - } - */ sprintf(name_lookup, "session.screen%d.windowPlacement", screen_number); sprintf(class_lookup, "Session.Screen%d.WindowPlacement", screen_number); if (XrmGetResource(*database, name_lookup, class_lookup, &value_type, -- cgit v0.11.2