all repos — fluxbox @ c516aa13a134ff311a1ce56976c030ba016bcfda

custom fork of the fluxbox windowmanager

fix reading of auto raise delay
rathnor rathnor
commit

c516aa13a134ff311a1ce56976c030ba016bcfda

parent

fa4328d8620959dce8a53b40c743fba691cfe471

6 files changed, 29 insertions(+), 29 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,6 +1,8 @@

(Format: Year/Month/Day) Changes for 0.9.6: *03/10/05: + * Fix reading of auto raise delay (Simon) + fluxbox.hh/cc Screen.cc Timer.hh/cc * Make focusLast work for sloppy focus when changing workspace or closing a window (Simon) - also generalises event redirects (e.g. for window moving)
M src/FbTk/Timer.ccsrc/FbTk/Timer.cc

@@ -60,7 +60,7 @@ if (isTiming()) stop();

} -void Timer::setTimeout(long t) { +void Timer::setTimeout(time_t t) { m_timeout.tv_sec = t / 1000; m_timeout.tv_usec = t; m_timeout.tv_usec -= (m_timeout.tv_sec * 1000);
M src/FbTk/Timer.hhsrc/FbTk/Timer.hh

@@ -59,7 +59,7 @@ virtual ~Timer();

inline void fireOnce(bool once) { m_once = once; } /// set timeout - void setTimeout(long val); + void setTimeout(time_t val); /// set timeout void setTimeout(timeval val); void setCommand(RefCount<Command> &cmd);
M src/Screen.ccsrc/Screen.cc

@@ -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.237 2003/10/05 02:31:22 rathnor Exp $ +// $Id: Screen.cc,v 1.238 2003/10/05 06:28:47 rathnor Exp $ #include "Screen.hh"

@@ -870,10 +870,10 @@ workspacemenu->setItemSelected(currentWorkspace()->workspaceID() + 2, true);

// This is a little tricks to reduce flicker // this way we can set focus pixmap on frame before we show it // and using ExposeEvent to redraw without flicker - WinClient *win = getLastFocusedWindow(currentWorkspaceID()); - if (win && win->fbwindow()) { - win->fbwindow()->setFocusFlag(true); - } + //WinClient *win = getLastFocusedWindow(currentWorkspaceID()); + //if (win && win->fbwindow()) { + // win->fbwindow()->setFocusFlag(true); + //} currentWorkspace()->showAll();
M src/fluxbox.ccsrc/fluxbox.cc

@@ -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.194 2003/10/05 02:31:23 rathnor Exp $ +// $Id: fluxbox.cc,v 1.195 2003/10/05 06:28:47 rathnor Exp $ #include "fluxbox.hh"

@@ -208,6 +208,13 @@ if (sscanf(strval, "%ul", &m_value) != 1)

setDefaultValue(); } +template<> +void FbTk::Resource<long>:: +setFromString(const char *strval) { + if (sscanf(strval, "%ld", &m_value) != 1) + setDefaultValue(); +} + //----------------------------------------------------------------- //---- manipulators for int, bool, and some enums with Resource --- //-----------------------------------------------------------------

@@ -287,6 +294,14 @@ return string(tmpstr);

} template<> +string FbTk::Resource<long>:: +getString() { + char tmpstr[128]; + sprintf(tmpstr, "%ld", m_value); + return string(tmpstr); +} + +template<> void FbTk::Resource<Fluxbox::Layer>:: setFromString(const char *strval) { int tempnum = 0;

@@ -403,6 +418,7 @@ TitlebarList(&s_titlebar_right[0], &s_titlebar_right[3]),

"session.titlebar.right", "Session.Titlebar.Right"), m_rc_cache_life(m_resourcemanager, 5, "session.cacheLife", "Session.CacheLife"), m_rc_cache_max(m_resourcemanager, 200, "session.cacheMax", "Session.CacheMax"), + m_rc_auto_raise_delay(m_resourcemanager, 250, "session.autoRaiseDelay", "Session.AutoRaiseDelay"), m_focused_window(0), m_mousescreen(0), m_keyscreen(0),

@@ -493,7 +509,6 @@ if (XSetLocaleModifiers("") == 0)

cerr<<"Warning: cannot set locale modifiers"<<endl; - resource.auto_raise_delay.tv_sec = resource.auto_raise_delay.tv_usec = 0; resource.update_delay_time = 5; #ifdef HAVE_GETPID

@@ -1499,11 +1514,6 @@

sprintf(rc_string, "session.updateDelayTime: %lu", resource.update_delay_time); XrmPutLineResource(&new_blackboxrc, rc_string); - sprintf(rc_string, "session.autoRaiseDelay: %lu", - ((resource.auto_raise_delay.tv_sec * 1000) + - (resource.auto_raise_delay.tv_usec / 1000))); - XrmPutLineResource(&new_blackboxrc, rc_string); - ScreenList::iterator it = m_screen_list.begin(); ScreenList::iterator it_end = m_screen_list.end();

@@ -1661,18 +1671,6 @@ if (sscanf(value.addr, "%lu", &resource.update_delay_time) != 1)

resource.update_delay_time = 5; } else resource.update_delay_time = 5; - - if (XrmGetResource(*database, "session.autoRaiseDelay", "Session.AutoRaiseDelay", - &value_type, &value)) { - if (sscanf(value.addr, "%lu", &resource.auto_raise_delay.tv_usec) != 1) - resource.auto_raise_delay.tv_usec = 250; - } else - resource.auto_raise_delay.tv_usec = 250; - - resource.auto_raise_delay.tv_sec = resource.auto_raise_delay.tv_usec / 1000; - resource.auto_raise_delay.tv_usec -= - (resource.auto_raise_delay.tv_sec * 1000); - resource.auto_raise_delay.tv_usec *= 1000; // expand tilde *m_rc_groupfile = StringUtil::expandFilename(*m_rc_groupfile);
M src/fluxbox.hhsrc/fluxbox.hh

@@ -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.hh,v 1.73 2003/10/05 02:31:23 rathnor Exp $ +// $Id: fluxbox.hh,v 1.74 2003/10/05 06:28:47 rathnor Exp $ #ifndef FLUXBOX_HH #define FLUXBOX_HH

@@ -143,7 +143,7 @@ inline int getBottomLayer() const { return 10; }

inline int getDesktopLayer() const { return 12; } - inline const timeval &getAutoRaiseDelay() const { return resource.auto_raise_delay; } + inline time_t getAutoRaiseDelay() const { return *m_rc_auto_raise_delay; } inline unsigned int getCacheLife() const { return *m_rc_cache_life * 60000; } inline unsigned int getCacheMax() const { return *m_rc_cache_max; }

@@ -226,7 +226,6 @@ } MenuTimestamp;

struct resource { Time double_click_interval; - timeval auto_raise_delay; long update_delay_time; } resource;

@@ -261,6 +260,7 @@

FbTk::Resource<TitlebarList> m_rc_titlebar_left, m_rc_titlebar_right; FbTk::Resource<unsigned int> m_rc_cache_life, m_rc_cache_max; + FbTk::Resource<time_t> m_rc_auto_raise_delay; std::map<Window, WinClient *> m_window_search;