From 93ffd19686f27ae16fb547f1dafd298f9dc041ae Mon Sep 17 00:00:00 2001 From: fluxgen Date: Sat, 11 Sep 2004 18:58:27 +0000 Subject: init frame window in frame struct --- src/Slit.cc | 27 +++++---------------------- src/Slit.hh | 9 ++++++++- 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/src/Slit.cc b/src/Slit.cc index dc14d42..0023965 100644 --- a/src/Slit.cc +++ b/src/Slit.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Slit.cc,v 1.100 2004/09/11 13:31:36 fluxgen Exp $ +// $Id: Slit.cc,v 1.101 2004/09/11 18:58:27 fluxgen Exp $ #include "Slit.hh" @@ -251,6 +251,7 @@ Slit::Slit(BScreen &scr, FbTk::XLayer &layer, const char *filename) m_clientlist_menu(scr.menuTheme(), scr.imageControl(), *scr.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())), + frame(scr.rootWindow()), //For KDE dock applets m_kwm1_dockwindow(XInternAtom(FbTk::App::instance()->display(), "KWM_DOCKWINDOW", False)), //KDE v1.x @@ -292,33 +293,15 @@ Slit::Slit(BScreen &scr, FbTk::XLayer &layer, const char *filename) FbTk::RefCount toggle_hidden(new FbTk::SimpleCommand(*this, &Slit::toggleHidden)); m_timer.setCommand(toggle_hidden); - // create main window - XSetWindowAttributes attrib; - unsigned long create_mask = CWBackPixmap | CWBackPixel | CWBorderPixel | - CWColormap | CWOverrideRedirect | CWEventMask; - attrib.background_pixmap = None; - attrib.background_pixel = attrib.border_pixel = theme().borderColor().pixel(); - attrib.colormap = screen().rootWindow().colormap(); - attrib.override_redirect = True; - attrib.event_mask = s_eventmask; - - frame.x = frame.y = 0; - frame.width = frame.height = 1; - Display *disp = FbTk::App::instance()->display(); - frame.window = - XCreateWindow(disp, screen().rootWindow().window(), frame.x, frame.y, - frame.width, frame.height, theme().borderWidth(), - screen().rootWindow().depth(), InputOutput, screen().rootWindow().visual(), - create_mask, &attrib); FbTk::EventManager::instance()->add(*this, frame.window); frame.window.setAlpha(*m_rc_alpha); m_layeritem.reset(new FbTk::XLayerItem(frame.window, layer)); m_layermenu.reset(new LayerMenu(scr.menuTheme(), - scr.imageControl(), - *scr.layerManager(). - getLayer(Fluxbox::instance()->getMenuLayer()), + scr.imageControl(), + *scr.layerManager(). + getLayer(Fluxbox::instance()->getMenuLayer()), this, true)); moveToLayer((*m_rc_layernum).getNum()); diff --git a/src/Slit.hh b/src/Slit.hh index eea3ad2..8b3249f 100644 --- a/src/Slit.hh +++ b/src/Slit.hh @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -/// $Id: Slit.hh,v 1.41 2004/06/07 11:46:04 rathnor Exp $ +/// $Id: Slit.hh,v 1.42 2004/09/11 18:58:27 fluxgen Exp $ #ifndef SLIT_HH #define SLIT_HH @@ -140,6 +140,13 @@ private: std::string m_filename; struct frame { + frame(const FbTk::FbWindow &parent): + window(parent, 0, 0, 10, 10, + SubstructureRedirectMask | ButtonPressMask | + EnterWindowMask | LeaveWindowMask | ExposureMask, + true), // override redirect + x(0), y(0), x_hidden(0), y_hidden(0), + width(10), height(10) {} Pixmap pixmap; FbTk::FbWindow window; -- cgit v0.11.2