all repos — fluxbox @ 06fb6cbd55dfabf1069d0603938e0d2d8d22581d

custom fork of the fluxbox windowmanager

fixed a bug, removed some unused code
markt markt
commit

06fb6cbd55dfabf1069d0603938e0d2d8d22581d

parent

48f761f9816f0f11e05dcc4e8f5ac506328e1683

M src/FbTk/Resource.ccsrc/FbTk/Resource.cc

@@ -107,7 +107,15 @@ @return 0 on success else negative value representing the error

*/ bool ResourceManager::save(const char *filename, const char *mergefilename) { assert(filename); - filename = StringUtil::expandFilename(filename).c_str(); + + // these must be local variables; otherwise, the memory gets released by + // std::string, causing weird issues + string file_str = StringUtil::expandFilename(filename), mergefile_str; + filename = file_str.c_str(); + if (mergefilename) { + mergefile_str = StringUtil::expandFilename(mergefilename); + mergefilename = mergefile_str.c_str(); + } // empty database XrmDatabaseHelper database;
M src/FbWinFrame.ccsrc/FbWinFrame.cc

@@ -525,7 +525,7 @@ if (currentLabel()) {

if (newvalue) // focused applyFocusLabel(*m_current_label); else // unfocused - applyActiveLabel(*m_current_label); + applyUnfocusLabel(*m_current_label); } applyAll();

@@ -711,7 +711,7 @@

if (m_focused) applyFocusLabel(*m_current_label); else - applyActiveLabel(*m_current_label); + applyUnfocusLabel(*m_current_label); } void FbWinFrame::setLabelButtonFocus(FbTk::TextButton &btn, bool value) {

@@ -1320,10 +1320,6 @@ render(m_theme.labelUnfocusTexture(), m_labelbutton_unfocused_color,

m_labelbutton_unfocused_pm, m_tab_container.width(), m_tab_container.height(), m_tab_container.orientation()); - render(m_theme.labelActiveTexture(), m_labelbutton_active_color, - m_labelbutton_active_pm, - m_tab_container.width(), m_tab_container.height(), m_tab_container.orientation()); - renderButtons(); }

@@ -1473,7 +1469,7 @@ // clear pixmaps

m_title_focused_pm = m_title_unfocused_pm = 0; m_label_focused_pm = m_label_unfocused_pm = 0; m_tabcontainer_focused_pm = m_tabcontainer_unfocused_pm = 0; - m_labelbutton_focused_pm = m_labelbutton_unfocused_pm = m_labelbutton_active_pm = 0; + m_labelbutton_focused_pm = m_labelbutton_unfocused_pm = 0; m_handle_focused_pm = m_handle_unfocused_pm = 0; m_button_pm = m_button_unfocused_pm = m_button_pressed_pm = 0; m_grip_unfocused_pm = m_grip_focused_pm = 0;

@@ -1597,12 +1593,9 @@ Container::ItemList::iterator btn_it = m_tab_container.begin();

Container::ItemList::iterator btn_it_end = m_tab_container.end(); for (; btn_it != btn_it_end; ++btn_it) { FbTk::TextButton *btn = static_cast<FbTk::TextButton *>(*btn_it); - if (btn == m_current_label) { - if (m_focused) - applyFocusLabel(*btn); - else - applyActiveLabel(*btn); - } else + if (btn == m_current_label && m_focused) + applyFocusLabel(*btn); + else applyUnfocusLabel(*btn); } }

@@ -1674,19 +1667,6 @@ button.setBackgroundColor(m_labelbutton_focused_color);

} -void FbWinFrame::applyActiveLabel(FbTk::TextButton &button) { - - button.setGC(theme().labelTextActiveGC()); - button.setJustify(theme().justify()); - button.setAlpha(getAlpha(m_focused)); - - if (m_labelbutton_active_pm != 0) { - button.setBackgroundPixmap(m_labelbutton_active_pm); - } else - button.setBackgroundColor(m_labelbutton_active_color); - -} - void FbWinFrame::applyUnfocusLabel(FbTk::TextButton &button) { button.setGC(theme().labelTextUnfocusGC());

@@ -1698,27 +1678,6 @@ button.setBackgroundPixmap(m_labelbutton_unfocused_pm);

} else button.setBackgroundColor(m_labelbutton_unfocused_color); -} - -namespace { -class IgnoreEvent { -public: - typedef void result_type; - typedef Window argument_type; - explicit IgnoreEvent(long eventmask): - m_display(FbTk::App::instance()->display()), - m_event_mask(eventmask) { - } - - void operator()(Window win) const { - static XEvent event; - while (XCheckWindowEvent(m_display, win, m_event_mask, &event)) - continue; - } -private: - Display *m_display; - long m_event_mask; -}; } // this function translates its arguments according to win_gravity
M src/FbWinFrame.hhsrc/FbWinFrame.hh

@@ -282,7 +282,6 @@ void applyHandles();

void applyTabContainer(); // and label buttons void applyFocusLabel(FbTk::TextButton &button); void applyUnfocusLabel(FbTk::TextButton &button); - void applyActiveLabel(FbTk::TextButton &button); void applyButtons(); // only called within applyTitlebar void getCurrentFocusPixmap(Pixmap &label_pm, Pixmap &title_pm,

@@ -355,8 +354,6 @@ Pixmap m_labelbutton_focused_pm; ///< pixmap for focused label

FbTk::Color m_labelbutton_focused_color; ///< color for focused label Pixmap m_labelbutton_unfocused_pm; ///< pixmap for unfocused label FbTk::Color m_labelbutton_unfocused_color; ///< color for unfocused label - Pixmap m_labelbutton_active_pm; ///< pixmap for active label - FbTk::Color m_labelbutton_active_color; ///< color for active label FbTk::Color m_handle_focused_color, m_handle_unfocused_color; Pixmap m_handle_focused_pm, m_handle_unfocused_pm;
M src/FbWinFrameTheme.ccsrc/FbWinFrameTheme.cc

@@ -30,7 +30,6 @@ FbWinFrameTheme::FbWinFrameTheme(int screen_num):

FbTk::Theme(screen_num), m_label_focus(*this, "window.label.focus", "Window.Label.Focus"), m_label_unfocus(*this, "window.label.unfocus", "Window.Label.Unfocus"), - m_label_active(*this, "window.label.active", "Window.Label.Active"), m_title_focus(*this, "window.title.focus", "Window.Title.Focus"), m_title_unfocus(*this, "window.title.unfocus", "Window.Title.Unfocus"),

@@ -47,7 +46,6 @@ m_grip_unfocus(*this, "window.grip.unfocus", "Window.Grip.Unfocus"),

m_label_focus_color(*this, "window.label.focus.textColor", "Window.Label.Focus.TextColor"), m_label_unfocus_color(*this, "window.label.unfocus.textColor", "Window.Label.Unfocus.TextColor"), - m_label_active_color(*this, "window.label.active.textColor", "Window.Label.Active.TextColor"), m_button_focus_color(*this, "window.button.focus.picColor", "Window.Button.Focus.PicColor"), m_button_unfocus_color(*this, "window.button.unfocus.picColor", "Window.Button.Unfocus.PicColor"),

@@ -61,7 +59,6 @@ m_handle_width(*this, "window.handleWidth", "Window.handleWidth"),

m_border(*this, "window", "Window"), // for window.border* m_label_text_focus_gc(RootWindow(FbTk::App::instance()->display(), screen_num)), m_label_text_unfocus_gc(RootWindow(FbTk::App::instance()->display(), screen_num)), - m_label_text_active_gc(RootWindow(FbTk::App::instance()->display(), screen_num)), m_button_pic_focus_gc(RootWindow(FbTk::App::instance()->display(), screen_num)), m_button_pic_unfocus_gc(RootWindow(FbTk::App::instance()->display(), screen_num)), m_focused_alpha(255),

@@ -95,14 +92,6 @@ else if (item.name() == "window.bevelWidth")

return FbTk::ThemeManager::instance().loadItem(item, "bevelWidth", "bevelWidth"); else if (item.name() == "window.handleWidth") return FbTk::ThemeManager::instance().loadItem(item, "handleWidth", "HandleWidth"); - else if (item.name() == "window.label.active") { - // copy texture - *m_label_active = *m_label_unfocus; - return true; - } else if (item.name() == "window.label.active.textColor") { - return FbTk::ThemeManager::instance().loadItem(item, "window.label.unfocus.textColor", - "Window.Label.Unfocus.TextColor"); - } return false; }

@@ -120,7 +109,6 @@ *m_handle_width = 1;

m_label_text_focus_gc.setForeground(*m_label_focus_color); m_label_text_unfocus_gc.setForeground(*m_label_unfocus_color); - m_label_text_active_gc.setForeground(*m_label_active_color); m_button_pic_focus_gc.setForeground(*m_button_focus_color); m_button_pic_unfocus_gc.setForeground(*m_button_unfocus_color); }
M src/FbWinFrameTheme.hhsrc/FbWinFrameTheme.hh

@@ -45,7 +45,6 @@ */

//@{ const FbTk::Texture &labelFocusTexture() const { return *m_label_focus; } const FbTk::Texture &labelUnfocusTexture() const { return *m_label_unfocus; } - const FbTk::Texture &labelActiveTexture() const { return *m_label_active; } const FbTk::ThemeItem<FbTk::Texture> &label() const { return m_label_unfocus; } const FbTk::Texture &titleFocusTexture() const { return *m_title_focus; } const FbTk::Texture &titleUnfocusTexture() const { return *m_title_unfocus; }

@@ -67,7 +66,6 @@ */

//@{ const FbTk::Color &labelFocusColor() const { return *m_label_focus_color; } const FbTk::Color &labelUnfocusColor() const { return *m_label_unfocus_color; } - const FbTk::Color &labelActiveColor() const { return *m_label_active_color; } const FbTk::Color &buttonFocuscolor() const { return *m_button_focus_color; } const FbTk::Color &buttonUnfocuscolor() const { return *m_button_unfocus_color; }

@@ -78,7 +76,6 @@ FbTk::Justify justify() const { return *m_textjustify; }

GC labelTextFocusGC() const { return m_label_text_focus_gc.gc(); } GC labelTextUnfocusGC() const { return m_label_text_unfocus_gc.gc(); } - GC labelTextActiveGC() const { return m_label_text_active_gc.gc(); } GC buttonPicFocusGC() const { return m_button_pic_focus_gc.gc(); } GC buttonPicUnfocusGC() const { return m_button_pic_unfocus_gc.gc(); }

@@ -104,13 +101,13 @@ void setFocusedAlpha(unsigned char alpha) { m_focused_alpha = alpha; }

void setUnfocusedAlpha(unsigned char alpha) { m_unfocused_alpha = alpha; } private: - FbTk::ThemeItem<FbTk::Texture> m_label_focus, m_label_unfocus, m_label_active; + FbTk::ThemeItem<FbTk::Texture> m_label_focus, m_label_unfocus; FbTk::ThemeItem<FbTk::Texture> m_title_focus, m_title_unfocus; FbTk::ThemeItem<FbTk::Texture> m_handle_focus, m_handle_unfocus; FbTk::ThemeItem<FbTk::Texture> m_button_focus, m_button_unfocus, m_button_pressed; FbTk::ThemeItem<FbTk::Texture> m_grip_focus, m_grip_unfocus; - FbTk::ThemeItem<FbTk::Color> m_label_focus_color, m_label_unfocus_color, m_label_active_color; + FbTk::ThemeItem<FbTk::Color> m_label_focus_color, m_label_unfocus_color; FbTk::ThemeItem<FbTk::Color> m_button_focus_color, m_button_unfocus_color; FbTk::ThemeItem<FbTk::Font> m_font;

@@ -120,7 +117,7 @@

FbTk::ThemeItem<int> m_title_height, m_bevel_width, m_handle_width; BorderTheme m_border; - FbTk::GContext m_label_text_focus_gc, m_label_text_unfocus_gc, m_label_text_active_gc; + FbTk::GContext m_label_text_focus_gc, m_label_text_unfocus_gc; FbTk::GContext m_button_pic_focus_gc, m_button_pic_unfocus_gc; Cursor m_cursor_move;