fix autoraise to be saved as separate init option
@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// 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 @@ show_window_pos(rm, true, scrname+".showwindowposition", altscrname+".ShowWindowPosition"),
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 @@ focus_menu->insert(new BoolMenuItem(i18n->getMessage(
ConfigmenuSet, ConfigmenuAutoRaise, "Auto Raise"), - resource.auto_raise, + *resource.auto_raise, save_and_reconfigure)); focus_menu->update();
@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// 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 @@ inline bool isTabRotateVertical() const { return *resource.tab_rotate_vertical; }
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 @@ max_over_slit, tab_rotate_vertical,
sloppy_window_grouping, workspace_warping, desktop_wheeling, show_window_pos, focus_last, focus_new, - antialias; + antialias, auto_raise; Resource<std::string> rootcommand; Resource<Fluxbox::FocusModel> focus_model; - bool auto_raise, ordered_dither; + bool ordered_dither; Resource<int> workspaces, toolbar_width_percent, edge_snap_threshold, tab_width, tab_height; Resource<Fluxbox::Layer> slit_layernum, toolbar_layernum;
@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// 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 @@
template<> void Resource<Fluxbox::FocusModel>:: 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 @@ sprintf(rc_string, "session.screen%d.windowPlacement: %s", screen_number,
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 @@
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,