fix FbPixmap retaining pixmap (that made cache not work properly)

Also small tidy in FbWinFrame.cc
This commit is contained in:
simonb 2006-06-25 14:59:34 +00:00
parent 131d04cf42
commit bf9b60833f
3 changed files with 16 additions and 18 deletions

View file

@ -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

View file

@ -126,24 +126,17 @@ FbPixmap &FbPixmap::operator = (Pixmap pm) {
}
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());

View file

@ -1204,7 +1204,6 @@ void FbWinFrame::renderTitlebar() {
m_label_unfocused_pm,
m_label.width(), m_label.height());
renderButtons();
}
void FbWinFrame::renderTabContainer() {
@ -1241,6 +1240,8 @@ void FbWinFrame::renderTabContainer() {
m_labelbutton_active_pm,
m_tab_container.width(), m_tab_container.height(), m_tab_container.orientation());
renderButtons();
}
void FbWinFrame::applyTitlebar() {
@ -1591,7 +1592,7 @@ void FbWinFrame::applyActiveLabel(FbTk::TextButton &button) {
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);