fix FbPixmap retaining pixmap (that made cache not work properly) Also small tidy in FbWinFrame.cc
simonb simonb
3 files changed,
16 insertions(+),
18 deletions(-)
M
ChangeLog
→
ChangeLog
@@ -1,6 +1,10 @@
(Format: Year/Month/Day) Changes for 1.0rc2: *06/06/25: + * Fix [ 1512046 ] "window.label.unfocus.pixmap" doesn't update (Simon) + - FbPixmap::copy was keeping the same pixmap if they had same + dimensions. This effectively broke the image cache. + FbPixmap.cc * Explicitly map NoSymbol to keycode 0 (thanks Julien Trolet) (seems to be assigned to several keycodes) FbTk/KeyUtil.cc
M
src/FbTk/FbPixmap.cc
→
src/FbTk/FbPixmap.cc
@@ -126,24 +126,17 @@ return *this;
} void FbPixmap::copy(const FbPixmap &the_copy) { - - bool create_new = false; - - if (the_copy.width() != width() || - the_copy.height() != height() || - the_copy.depth() != depth() || - drawable() == 0) - create_new = true; - - if (create_new) - free(); + /* This function previously retained the old pixmap and copied in + the new contents if they had the same dimensions. + This broke the image cache, so we don't do that now. If you want to + do it, then you'll need to invalidate all copies of this pixmap in + the cache */ + free(); if (the_copy.drawable() != 0) { - if (create_new) { - create(the_copy.drawable(), - the_copy.width(), the_copy.height(), - the_copy.depth()); - } + create(the_copy.drawable(), + the_copy.width(), the_copy.height(), + the_copy.depth()); if (drawable()) { GContext gc(drawable());
M
src/FbWinFrame.cc
→
src/FbWinFrame.cc
@@ -1204,7 +1204,6 @@ render(m_theme.labelUnfocusTexture(), m_label_unfocused_color,
m_label_unfocused_pm, m_label.width(), m_label.height()); - renderButtons(); } void FbWinFrame::renderTabContainer() {@@ -1240,6 +1239,8 @@
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(); }@@ -1591,7 +1592,7 @@ button.setJustify(theme().justify());
button.setAlpha(m_focused?theme().focusedAlpha():theme().unfocusedAlpha()); if (m_labelbutton_active_pm != 0) { - button.setBackgroundPixmap(m_labelbutton_active_pm); + button.setBackgroundPixmap(m_labelbutton_active_pm); } else button.setBackgroundColor(m_labelbutton_active_color);