bugfix: initialize the Shape of a menu AFTER we created the window for the menu

on startup a lot of 'Fluxbox: X Error: BadDrawable (invalid Pixmap ...)' occured.
this was caused by using an empty 'Window' to create the shape.
This commit is contained in:
Mathias Gumz 2010-09-09 23:23:33 +02:00
parent 2b9a38cba5
commit 7fdb0676a7

View file

@ -91,7 +91,7 @@ Menu::Menu(FbTk::ThemeProxy<MenuTheme> &tm, ImageControl &imgctrl):
m_screen_height(DisplayHeight(FbTk::App::instance()->display(), tm->screenNum())),
m_alignment(ALIGNDONTCARE),
m_active_index(-1),
m_shape(new Shape(fbwindow(), tm->shapePlaces())),
m_shape(0),
m_need_update(true) {
// setup timers
@ -143,6 +143,9 @@ Menu::Menu(FbTk::ThemeProxy<MenuTheme> &tm, ImageControl &imgctrl):
true, // override redirect
true); // save_under
// initialize 'shape' here AFTER we created menu.window aka fbwindow()
m_shape.reset(new Shape(fbwindow(), tm->shapePlaces()));
// strip focus change mask from attrib, since we should only use it with main window
event_mask ^= FocusChangeMask;