bugfix: consistent use of 'int' for alpha values (#3187373)

WindowMenuAccessor returned strange alpha values if compiled
with 'g++ -Os'; unholy black magic happens if template<int> faces
functions returning only 'usigned char'.
This commit is contained in:
Mathias Gumz 2011-02-22 22:07:39 +01:00
parent b7e84104a6
commit d11aa42ace
26 changed files with 65 additions and 61 deletions

View file

@ -49,7 +49,7 @@ void ButtonTool::updateSizing() {
btn.setBorderWidth(theme()->border().width()); btn.setBorderWidth(theme()->border().width());
} }
void ButtonTool::renderTheme(unsigned char alpha) { void ButtonTool::renderTheme(int alpha) {
FbTk::Button &btn = static_cast<FbTk::Button &>(window()); FbTk::Button &btn = static_cast<FbTk::Button &>(window());
btn.setGC(static_cast<const ButtonTheme &>(*theme()).gc()); btn.setGC(static_cast<const ButtonTheme &>(*theme()).gc());

View file

@ -41,7 +41,7 @@ public:
virtual ~ButtonTool(); virtual ~ButtonTool();
protected: protected:
void renderTheme(unsigned char alpha); void renderTheme(int alpha);
void updateSizing(); void updateSizing();
Pixmap m_cache_pm, m_cache_pressed_pm; Pixmap m_cache_pm, m_cache_pressed_pm;
FbTk::ImageControl &m_image_ctrl; FbTk::ImageControl &m_image_ctrl;

View file

@ -334,7 +334,7 @@ void ClockTool::reRender() {
} }
void ClockTool::renderTheme(unsigned char alpha) { void ClockTool::renderTheme(int alpha) {
m_button.setAlpha(alpha); m_button.setAlpha(alpha);
m_button.setJustify(m_theme->justify()); m_button.setJustify(m_theme->justify());

View file

@ -69,7 +69,7 @@ public:
private: private:
void updateTime(); void updateTime();
void update(FbTk::Subject *subj); void update(FbTk::Subject *subj);
void renderTheme(unsigned char alpha); void renderTheme(int alpha);
void reRender(); void reRender();
void updateSizing(); void updateSizing();

View file

@ -440,7 +440,7 @@ void Container::for_each(std::mem_fun_t<void, FbWindow> function) {
std::for_each(begin(), end(), function); std::for_each(begin(), end(), function);
} }
void Container::setAlpha(unsigned char alpha) { void Container::setAlpha(int alpha) {
FbWindow::setAlpha(alpha); FbWindow::setAlpha(alpha);
STLUtil::forAll(m_item_list, std::bind2nd(std::mem_fun(&Button::setAlpha), alpha)); STLUtil::forAll(m_item_list, std::bind2nd(std::mem_fun(&Button::setAlpha), alpha));
} }

View file

@ -91,7 +91,7 @@ public:
bool updateLock() const { return m_update_lock; } bool updateLock() const { return m_update_lock; }
void for_each(std::mem_fun_t<void, FbWindow> function); void for_each(std::mem_fun_t<void, FbWindow> function);
void setAlpha(unsigned char alpha); // set alpha on all windows void setAlpha(int alpha); // set alpha on all windows
ItemList::iterator begin() { return m_item_list.begin(); } ItemList::iterator begin() { return m_item_list.begin(); }
ItemList::iterator end() { return m_item_list.end(); } ItemList::iterator end() { return m_item_list.end(); }

View file

@ -171,7 +171,7 @@ void FbWindow::invalidateBackground() {
void FbWindow::updateBackground(bool only_if_alpha) { void FbWindow::updateBackground(bool only_if_alpha) {
Pixmap newbg = m_lastbg_pm; Pixmap newbg = m_lastbg_pm;
unsigned char alpha = 255; int alpha = 255;
bool free_newbg = false; bool free_newbg = false;
if (m_lastbg_pm == None && !m_lastbg_color_set) if (m_lastbg_pm == None && !m_lastbg_color_set)
@ -344,7 +344,7 @@ void FbWindow::updateTransparent(int the_x, int the_y, unsigned int the_width, u
#endif // HAVE_XRENDER #endif // HAVE_XRENDER
} }
void FbWindow::setAlpha(unsigned char alpha) { void FbWindow::setAlpha(int alpha) {
#ifdef HAVE_XRENDER #ifdef HAVE_XRENDER
if (FbTk::Transparent::haveComposite()) { if (FbTk::Transparent::haveComposite()) {
if (m_transparent.get() != 0) { if (m_transparent.get() != 0) {
@ -371,7 +371,7 @@ void FbWindow::setAlpha(unsigned char alpha) {
#endif // HAVE_XRENDER #endif // HAVE_XRENDER
} }
unsigned char FbWindow::alpha() const { int FbWindow::alpha() const {
#ifdef HAVE_XRENDER #ifdef HAVE_XRENDER
if (m_transparent.get()) if (m_transparent.get())
return m_transparent->alpha(); return m_transparent->alpha();
@ -588,7 +588,7 @@ long FbWindow::eventMask() const {
} }
void FbWindow::setOpaque(unsigned char alpha) { void FbWindow::setOpaque(int alpha) {
#ifdef HAVE_XRENDER #ifdef HAVE_XRENDER
static Atom m_alphaatom = XInternAtom(display(), "_NET_WM_WINDOW_OPACITY", False); static Atom m_alphaatom = XInternAtom(display(), "_NET_WM_WINDOW_OPACITY", False);
unsigned long opacity = alpha * 0x1010101; unsigned long opacity = alpha * 0x1010101;

View file

@ -88,7 +88,7 @@ public:
unsigned int height = 0, Pixmap dest_override = None, unsigned int height = 0, Pixmap dest_override = None,
bool override_is_offset = false); bool override_is_offset = false);
void setAlpha(unsigned char alpha); void setAlpha(int alpha);
virtual FbWindow &operator = (const FbWindow &win); virtual FbWindow &operator = (const FbWindow &win);
/// assign a new X window to this /// assign a new X window to this
@ -176,7 +176,7 @@ public:
unsigned int borderWidth() const { return m_border_width; } unsigned int borderWidth() const { return m_border_width; }
unsigned long borderColor() const { return m_border_color; } unsigned long borderColor() const { return m_border_color; }
unsigned int depth() const { return m_depth; } unsigned int depth() const { return m_depth; }
unsigned char alpha() const; int alpha() const;
int screenNumber() const; int screenNumber() const;
long eventMask() const; long eventMask() const;
@ -188,7 +188,7 @@ public:
bool operator != (const FbWindow &win) const { return m_window != win.m_window; } bool operator != (const FbWindow &win) const { return m_window != win.m_window; }
// used for composite // used for composite
void setOpaque(unsigned char alpha); void setOpaque(int alpha);
void setRenderer(FbWindowRenderer &renderer) { m_renderer = &renderer; } void setRenderer(FbWindowRenderer &renderer) { m_renderer = &renderer; }
void sendConfigureNotify(int x, int y, unsigned int width, void sendConfigureNotify(int x, int y, unsigned int width,

View file

@ -107,7 +107,7 @@ public:
unsigned int bevelWidth() const { return *m_bevel_width; } unsigned int bevelWidth() const { return *m_bevel_width; }
unsigned char alpha() const { return m_alpha; } unsigned char alpha() const { return m_alpha; }
void setAlpha(unsigned char alpha) { m_alpha = alpha; } void setAlpha(int alpha) { m_alpha = alpha; }
// this isn't actually a theme item // this isn't actually a theme item
// but we'll let it be here for now, until there's a better way to // but we'll let it be here for now, until there's a better way to
// get resources into menu // get resources into menu
@ -154,7 +154,7 @@ private:
Display *m_display; Display *m_display;
GContext t_text_gc, f_text_gc, u_text_gc, h_text_gc, d_text_gc, hilite_gc; GContext t_text_gc, f_text_gc, u_text_gc, h_text_gc, d_text_gc, hilite_gc;
unsigned char m_alpha; int m_alpha;
unsigned int m_delay; ///< in msec unsigned int m_delay; ///< in msec
unsigned int m_real_title_height; ///< the calculated item height (from font and menu.titleHeight) unsigned int m_real_title_height; ///< the calculated item height (from font and menu.titleHeight)
unsigned int m_real_item_height; ///< the calculated item height (from font and menu.itemHeight) unsigned int m_real_item_height; ///< the calculated item height (from font and menu.itemHeight)

View file

@ -43,7 +43,7 @@ using std::endl;
namespace { namespace {
#ifdef HAVE_XRENDER #ifdef HAVE_XRENDER
Picture createAlphaPic(Window drawable, unsigned char alpha) { Picture createAlphaPic(Window drawable, int alpha) {
Display *disp = FbTk::App::instance()->display(); Display *disp = FbTk::App::instance()->display();
_FB_USES_NLS; _FB_USES_NLS;
@ -149,7 +149,7 @@ bool Transparent::haveComposite(bool for_real) {
return s_use_composite; return s_use_composite;
} }
Transparent::Transparent(Drawable src, Drawable dest, unsigned char alpha, int screen_num): Transparent::Transparent(Drawable src, Drawable dest, int alpha, int screen_num):
m_alpha_pic(0), m_src_pic(0), m_dest_pic(0), m_alpha_pic(0), m_src_pic(0), m_dest_pic(0),
m_source(src), m_dest(dest), m_alpha(alpha) { m_source(src), m_dest(dest), m_alpha(alpha) {
@ -196,7 +196,7 @@ Transparent::~Transparent() {
#endif // HAVE_XRENDER #endif // HAVE_XRENDER
} }
void Transparent::setAlpha(unsigned char alpha) { void Transparent::setAlpha(int alpha) {
if (m_source == 0 || !s_render) if (m_source == 0 || !s_render)
return; return;
@ -254,7 +254,7 @@ void Transparent::setSource(Drawable source, int screen_num) {
return; return;
// save old alpha value so we can recreate new later // save old alpha value so we can recreate new later
// with the same value // with the same value
unsigned char old_alpha = m_alpha; int old_alpha = m_alpha;
if (m_alpha_pic != 0) if (m_alpha_pic != 0)
freeAlpha(); freeAlpha();
@ -314,7 +314,7 @@ void Transparent::render(int src_x, int src_y,
#endif // HAVE_XRENDER #endif // HAVE_XRENDER
} }
void Transparent::allocAlpha(unsigned char alpha) { void Transparent::allocAlpha(int alpha) {
#ifdef HAVE_XRENDER #ifdef HAVE_XRENDER
if (m_source == 0 || !s_render) if (m_source == 0 || !s_render)
return; return;

View file

@ -29,10 +29,10 @@ namespace FbTk {
/// renders to drawable together with an alpha mask /// renders to drawable together with an alpha mask
class Transparent { class Transparent {
public: public:
Transparent(Drawable source, Drawable dest, unsigned char alpha, int screen_num); Transparent(Drawable source, Drawable dest, int alpha, int screen_num);
~Transparent(); ~Transparent();
/// sets alpha value /// sets alpha value
void setAlpha(unsigned char alpha); void setAlpha(int alpha);
/// sets source drawable /// sets source drawable
void setSource(Drawable src, int screen_num); void setSource(Drawable src, int screen_num);
/// sets destination drawable /// sets destination drawable
@ -45,7 +45,7 @@ public:
int dest_x, int dest_y, int dest_x, int dest_y,
unsigned int width, unsigned int height) const; unsigned int width, unsigned int height) const;
unsigned char alpha() const { return m_alpha; } int alpha() const { return m_alpha; }
Drawable dest() const { return m_dest; } Drawable dest() const { return m_dest; }
Drawable source() const { return m_source; } Drawable source() const { return m_source; }
@ -55,7 +55,7 @@ public:
private: private:
void freeAlpha(); void freeAlpha();
void allocAlpha(unsigned char newval); void allocAlpha(int newval);
unsigned long m_alpha_pic; unsigned long m_alpha_pic;
unsigned long m_src_pic; unsigned long m_src_pic;
unsigned long m_dest_pic; unsigned long m_dest_pic;

View file

@ -427,7 +427,7 @@ void FbWinFrame::alignTabs() {
void FbWinFrame::notifyMoved(bool clear) { void FbWinFrame::notifyMoved(bool clear) {
// not important if no alpha... // not important if no alpha...
unsigned char alpha = getAlpha(m_state.focused); int alpha = getAlpha(m_state.focused);
if (alpha == 255) if (alpha == 255)
return; return;
@ -482,7 +482,7 @@ void FbWinFrame::setFocus(bool newvalue) {
if (FbTk::Transparent::haveRender() && if (FbTk::Transparent::haveRender() &&
getAlpha(true) != getAlpha(false)) { // different alpha for focused and unfocused getAlpha(true) != getAlpha(false)) { // different alpha for focused and unfocused
unsigned char alpha = getAlpha(m_state.focused); int alpha = getAlpha(m_state.focused);
if (FbTk::Transparent::haveComposite()) { if (FbTk::Transparent::haveComposite()) {
m_tab_container.setAlpha(255); m_tab_container.setAlpha(255);
m_window.setOpaque(alpha); m_window.setOpaque(alpha);
@ -536,7 +536,7 @@ void FbWinFrame::applyState() {
frameExtentSig().notify(); frameExtentSig().notify();
} }
void FbWinFrame::setAlpha(bool focused, unsigned char alpha) { void FbWinFrame::setAlpha(bool focused, int alpha) {
if (focused) if (focused)
m_focused_alpha = alpha; m_focused_alpha = alpha;
else else
@ -547,7 +547,7 @@ void FbWinFrame::setAlpha(bool focused, unsigned char alpha) {
} }
void FbWinFrame::applyAlpha() { void FbWinFrame::applyAlpha() {
unsigned char alpha = getAlpha(m_state.focused); int alpha = getAlpha(m_state.focused);
if (FbTk::Transparent::haveComposite()) if (FbTk::Transparent::haveComposite())
m_window.setOpaque(alpha); m_window.setOpaque(alpha);
else { else {
@ -557,8 +557,11 @@ void FbWinFrame::applyAlpha() {
} }
} }
unsigned char FbWinFrame::getAlpha(bool focused) const { int FbWinFrame::getAlpha(bool focused) const {
return focused ? m_focused_alpha : m_unfocused_alpha; if (focused)
return m_focused_alpha;
else
return m_unfocused_alpha;
} }
void FbWinFrame::setDefaultAlpha() { void FbWinFrame::setDefaultAlpha() {
@ -966,8 +969,7 @@ void FbWinFrame::reconfigure() {
if (isVisible()) { if (isVisible()) {
// update transparency settings // update transparency settings
if (FbTk::Transparent::haveRender()) { if (FbTk::Transparent::haveRender()) {
unsigned char alpha = int alpha = getAlpha(m_state.focused);
getAlpha(m_state.focused);
if (FbTk::Transparent::haveComposite()) { if (FbTk::Transparent::haveComposite()) {
m_tab_container.setAlpha(255); m_tab_container.setAlpha(255);
m_window.setOpaque(alpha); m_window.setOpaque(alpha);
@ -1168,7 +1170,7 @@ void FbWinFrame::applyTitlebar() {
getCurrentFocusPixmap(label_pm, title_pm, getCurrentFocusPixmap(label_pm, title_pm,
label_color, title_color); label_color, title_color);
unsigned char alpha = getAlpha (m_state.focused); int alpha = getAlpha (m_state.focused);
m_titlebar.setAlpha(alpha); m_titlebar.setAlpha(alpha);
m_label.setAlpha(alpha); m_label.setAlpha(alpha);
@ -1220,7 +1222,7 @@ void FbWinFrame::renderHandles() {
void FbWinFrame::applyHandles() { void FbWinFrame::applyHandles() {
unsigned char alpha = getAlpha(m_state.focused); int alpha = getAlpha(m_state.focused);
m_handle.setAlpha(alpha); m_handle.setAlpha(alpha);
m_grip_left.setAlpha(alpha); m_grip_left.setAlpha(alpha);
m_grip_right.setAlpha(alpha); m_grip_right.setAlpha(alpha);

View file

@ -121,9 +121,9 @@ public:
void updateTabProperties() { alignTabs(); } void updateTabProperties() { alignTabs(); }
/// Alpha settings /// Alpha settings
void setAlpha(bool focused, unsigned char value); void setAlpha(bool focused, int value);
void applyAlpha(); void applyAlpha();
unsigned char getAlpha(bool focused) const; int getAlpha(bool focused) const;
void setDefaultAlpha(); void setDefaultAlpha();
bool getUseDefaultAlpha() const; bool getUseDefaultAlpha() const;
@ -377,9 +377,9 @@ private:
bool m_need_render; bool m_need_render;
int m_button_size; ///< size for all titlebar buttons int m_button_size; ///< size for all titlebar buttons
/// alpha values /// alpha values
typedef FbTk::ConstObjectAccessor<unsigned char, FbWinFrameTheme> AlphaAcc; typedef FbTk::ConstObjectAccessor<int, FbWinFrameTheme> AlphaAcc;
FbTk::DefaultValue<unsigned char, AlphaAcc> m_focused_alpha; FbTk::DefaultValue<int, AlphaAcc> m_focused_alpha;
FbTk::DefaultValue<unsigned char, AlphaAcc> m_unfocused_alpha; FbTk::DefaultValue<int, AlphaAcc> m_unfocused_alpha;
FbTk::Shape m_shape; FbTk::Shape m_shape;
}; };

View file

@ -74,8 +74,8 @@ public:
unsigned int bevelWidth() const { return *m_bevel_width; } unsigned int bevelWidth() const { return *m_bevel_width; }
unsigned int handleWidth() const { return *m_handle_width; } unsigned int handleWidth() const { return *m_handle_width; }
unsigned char alpha() const { return m_alpha; } int alpha() const { return m_alpha; }
void setAlpha(unsigned char alpha) { m_alpha = alpha; } void setAlpha(int alpha) { m_alpha = alpha; }
IconbarTheme &iconbarTheme() { return m_iconbar_theme; } IconbarTheme &iconbarTheme() { return m_iconbar_theme; }
@ -107,7 +107,7 @@ private:
Cursor m_cursor_right_side; Cursor m_cursor_right_side;
Cursor m_cursor_top_side; Cursor m_cursor_top_side;
Cursor m_cursor_bottom_side; Cursor m_cursor_bottom_side;
unsigned char m_alpha; int m_alpha;
IconbarTheme m_iconbar_theme; IconbarTheme m_iconbar_theme;
}; };

View file

@ -78,7 +78,7 @@ FocusControl::FocusControl(BScreen &screen):
m_focused_list(screen), m_creation_order_list(screen), m_focused_list(screen), m_creation_order_list(screen),
m_focused_win_list(screen), m_creation_order_win_list(screen), m_focused_win_list(screen), m_creation_order_win_list(screen),
m_cycling_list(0), m_cycling_list(0),
m_was_iconic(false), m_was_iconic(0),
m_cycling_last(0), m_cycling_last(0),
m_ignore_mouse_x(-1), m_ignore_mouse_y(-1) { m_ignore_mouse_x(-1), m_ignore_mouse_y(-1) {

View file

@ -75,7 +75,7 @@ unsigned int GenericTool::borderWidth() const {
return m_window->borderWidth(); return m_window->borderWidth();
} }
void GenericTool::renderTheme(unsigned char alpha) { void GenericTool::renderTheme(int alpha) {
m_window->setAlpha(alpha); m_window->setAlpha(alpha);
m_window->clear(); m_window->clear();
} }

View file

@ -60,7 +60,7 @@ public:
const FbTk::FbWindow &window() const { return *m_window; } const FbTk::FbWindow &window() const { return *m_window; }
protected: protected:
virtual void renderTheme(unsigned char alpha); virtual void renderTheme(int alpha);
private: private:
void update(FbTk::Subject *subj); void update(FbTk::Subject *subj);

View file

@ -475,7 +475,7 @@ void IconbarTool::updateSizing() {
} }
void IconbarTool::renderTheme(unsigned char alpha) { void IconbarTool::renderTheme(int alpha) {
m_alpha = alpha; m_alpha = alpha;
renderTheme(); renderTheme();

View file

@ -81,7 +81,7 @@ private:
void renderButton(IconButton &button, bool clear = true); void renderButton(IconButton &button, bool clear = true);
/// render all buttons /// render all buttons
void renderTheme(); void renderTheme();
void renderTheme(unsigned char alpha); void renderTheme(int alpha);
/// destroy all icons /// destroy all icons
void deleteIcons(); void deleteIcons();
/// add or move a single window /// add or move a single window
@ -111,7 +111,7 @@ private:
FbTk::Resource<unsigned int> m_rc_client_padding; ///< padding of the text FbTk::Resource<unsigned int> m_rc_client_padding; ///< padding of the text
FbTk::Resource<bool> m_rc_use_pixmap; ///< if iconbar should use win pixmap or not FbTk::Resource<bool> m_rc_use_pixmap; ///< if iconbar should use win pixmap or not
FbMenu m_menu; FbMenu m_menu;
unsigned char m_alpha; int m_alpha;
}; };
#endif // ICONBARTOOL_HH #endif // ICONBARTOOL_HH

View file

@ -74,7 +74,7 @@ public:
int numClients() const { return m_clients.size(); } int numClients() const { return m_clients.size(); }
const FbTk::FbWindow &window() const { return m_window; } const FbTk::FbWindow &window() const { return m_window; }
void renderTheme(unsigned char alpha) { void renderTheme(int alpha) {
m_window.setBorderWidth(m_theme->border().width()); m_window.setBorderWidth(m_theme->border().width());
m_window.setBorderColor(m_theme->border().color()); m_window.setBorderColor(m_theme->border().color());
m_window.setAlpha(alpha); m_window.setAlpha(alpha);

View file

@ -41,8 +41,8 @@ public:
// textures // textures
const FbTk::Texture &texture() const { return *m_texture; } const FbTk::Texture &texture() const { return *m_texture; }
const FbTk::BorderTheme &border() const { return m_border; } const FbTk::BorderTheme &border() const { return m_border; }
unsigned char alpha() const { return m_alpha; } int alpha() const { return m_alpha; }
void setAlpha(unsigned char alpha) { m_alpha = alpha; } void setAlpha(int alpha) { m_alpha = alpha; }
virtual FbTk::Subject &reconfigSig() { return FbTk::Theme::reconfigSig(); } virtual FbTk::Subject &reconfigSig() { return FbTk::Theme::reconfigSig(); }
virtual const FbTk::Subject &reconfigSig() const { return FbTk::Theme::reconfigSig(); } virtual const FbTk::Subject &reconfigSig() const { return FbTk::Theme::reconfigSig(); }
@ -56,7 +56,7 @@ protected:
private: private:
FbTk::ThemeItem<FbTk::Texture> m_texture; FbTk::ThemeItem<FbTk::Texture> m_texture;
FbTk::BorderTheme m_border; FbTk::BorderTheme m_border;
unsigned char m_alpha; int m_alpha;
}; };
#endif // TOOLTHEME_HH #endif // TOOLTHEME_HH

View file

@ -54,7 +54,7 @@ public:
// Tools should NOT listen to theme changes - they'll get notified by // Tools should NOT listen to theme changes - they'll get notified by
// the toolbar instead. Otherwise there are ordering problems. // the toolbar instead. Otherwise there are ordering problems.
virtual void renderTheme(unsigned char alpha) = 0; virtual void renderTheme(int alpha) = 0;
// insist implemented, even if blank // insist implemented, even if blank
virtual void parentMoved() = 0; // called when moved from hiding virtual void parentMoved() = 0; // called when moved from hiding

View file

@ -198,11 +198,11 @@ public:
// ------------------ // ------------------
// Per window transparency addons // Per window transparency addons
unsigned char getFocusedAlpha() const { return frame().getAlpha(true); } int getFocusedAlpha() const { return frame().getAlpha(true); }
unsigned char getUnfocusedAlpha() const { return frame().getAlpha(false); } int getUnfocusedAlpha() const { return frame().getAlpha(false); }
void setFocusedAlpha(unsigned char alpha) { frame().setAlpha(true, alpha); } void setFocusedAlpha(int alpha) { frame().setAlpha(true, alpha); }
void setUnfocusedAlpha(unsigned char alpha) { frame().setAlpha(false, alpha); } void setUnfocusedAlpha(int alpha) { frame().setAlpha(false, alpha); }
void updateAlpha(bool focused, unsigned char alpha) { frame().setAlpha(focused, alpha); } void updateAlpha(bool focused, int alpha) { frame().setAlpha(focused, alpha); }
bool getUseDefaultAlpha() const { return frame().getUseDefaultAlpha(); } bool getUseDefaultAlpha() const { return frame().getUseDefaultAlpha(); }
void setDefaultAlpha() { frame().setDefaultAlpha(); } void setDefaultAlpha() { frame().setDefaultAlpha(); }

View file

@ -37,7 +37,9 @@ public:
operator Ret() const { operator Ret() const {
FluxboxWindow *fbwin = FbMenu::window(); FluxboxWindow *fbwin = FbMenu::window();
return fbwin ? (fbwin->*m_getter)() : m_def; if (fbwin)
return (Ret)(fbwin->*m_getter)();
return m_def;
} }
FbTk::Accessor<Ret> &operator =(const Ret &val) { FbTk::Accessor<Ret> &operator =(const Ret &val) {
FluxboxWindow *fbwin = FbMenu::window(); FluxboxWindow *fbwin = FbMenu::window();

View file

@ -147,7 +147,7 @@ void WorkspaceNameTool::reRender() {
} }
} }
void WorkspaceNameTool::renderTheme(unsigned char alpha) { void WorkspaceNameTool::renderTheme(int alpha) {
m_button.setJustify(m_theme->justify()); m_button.setJustify(m_theme->justify());
m_button.setBorderWidth(m_theme->border().width()); m_button.setBorderWidth(m_theme->border().width());

View file

@ -64,7 +64,7 @@ private:
/// Called when workspace changed on \c screen /// Called when workspace changed on \c screen
void updateForScreen(BScreen &screen); void updateForScreen(BScreen &screen);
void renderTheme(unsigned char alpha); void renderTheme(int alpha);
void reRender(); void reRender();
void updateSizing(); void updateSizing();
FbTk::TextButton m_button; FbTk::TextButton m_button;