From 3e1ac648d0f9dfe060091dc1f0c6e654064f4f7f Mon Sep 17 00:00:00 2001 From: fluxgen Date: Sat, 10 May 2003 22:59:32 +0000 Subject: using FbRootWindow --- src/Ewmh.cc | 16 ++++++++-------- src/Gnome.cc | 16 ++++++++-------- src/IconBar.cc | 9 +++++---- src/Screen.cc | 30 ++++++++++++++---------------- src/Slit.cc | 10 +++++----- src/WinClient.cc | 4 ++-- 6 files changed, 42 insertions(+), 43 deletions(-) diff --git a/src/Ewmh.cc b/src/Ewmh.cc index 2349d8a..c4349b9 100644 --- a/src/Ewmh.cc +++ b/src/Ewmh.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Ewmh.cc,v 1.20 2003/05/10 13:21:36 fluxgen Exp $ +// $Id: Ewmh.cc,v 1.21 2003/05/10 22:56:48 fluxgen Exp $ #include "Ewmh.hh" @@ -50,13 +50,13 @@ void Ewmh::initForScreen(BScreen &screen) { Window wincheck = XCreateSimpleWindow(disp, - screen.getRootWindow(), + screen.rootWindow().window(), 0, 0, 5, 5, 0, 0, 0); if (wincheck != None) { m_windows.push_back(wincheck); - XChangeProperty(disp, screen.getRootWindow(), m_net_supporting_wm_check, XA_WINDOW, 32, + XChangeProperty(disp, screen.rootWindow().window(), m_net_supporting_wm_check, XA_WINDOW, 32, PropModeReplace, (unsigned char *) &wincheck, 1); XChangeProperty(disp, wincheck, m_net_supporting_wm_check, XA_WINDOW, 32, PropModeReplace, (unsigned char *) &wincheck, 1); @@ -86,7 +86,7 @@ void Ewmh::initForScreen(BScreen &screen) { m_net_supporting_wm_check }; - XChangeProperty(disp, screen.getRootWindow(), + XChangeProperty(disp, screen.rootWindow().window(), m_net_supported, XA_ATOM, 32, PropModeReplace, (unsigned char *) &atomsupported, @@ -193,7 +193,7 @@ void Ewmh::updateClientList(BScreen &screen) { //number of windows to show in client list num = win; XChangeProperty(FbTk::App::instance()->display(), - screen.getRootWindow(), + screen.rootWindow().window(), m_net_client_list, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)wl, num); @@ -213,7 +213,7 @@ void Ewmh::updateWorkspaceNames(BScreen &screen) { } if (XStringListToTextProperty(names, number_of_desks, &text)) { - XSetTextProperty(FbTk::App::instance()->display(), screen.getRootWindow(), + XSetTextProperty(FbTk::App::instance()->display(), screen.rootWindow().window(), &text, m_net_desktop_names); XFree(text.value); } @@ -225,7 +225,7 @@ void Ewmh::updateWorkspaceNames(BScreen &screen) { void Ewmh::updateCurrentWorkspace(BScreen &screen) { size_t workspace = screen.getCurrentWorkspaceID(); XChangeProperty(FbTk::App::instance()->display(), - screen.getRootWindow(), + screen.rootWindow().window(), m_net_current_desktop, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&workspace, 1); @@ -233,7 +233,7 @@ void Ewmh::updateCurrentWorkspace(BScreen &screen) { void Ewmh::updateWorkspaceCount(BScreen &screen) { size_t numworkspaces = screen.getCount(); - XChangeProperty(FbTk::App::instance()->display(), screen.getRootWindow(), + XChangeProperty(FbTk::App::instance()->display(), screen.rootWindow().window(), m_net_number_of_desktops, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&numworkspaces, 1); } diff --git a/src/Gnome.cc b/src/Gnome.cc index f90fa9e..11cce0d 100644 --- a/src/Gnome.cc +++ b/src/Gnome.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Gnome.cc,v 1.19 2003/05/08 02:50:38 rathnor Exp $ +// $Id: Gnome.cc,v 1.20 2003/05/10 22:57:37 fluxgen Exp $ #include "Gnome.hh" @@ -51,9 +51,9 @@ void Gnome::initForScreen(BScreen &screen) { Display *disp = FbTk::App::instance()->display(); // create the GNOME window Window gnome_win = XCreateSimpleWindow(disp, - screen.getRootWindow(), 0, 0, 5, 5, 0, 0, 0); + screen.rootWindow().window(), 0, 0, 5, 5, 0, 0, 0); // supported WM check - XChangeProperty(disp, screen.getRootWindow(), + XChangeProperty(disp, screen.rootWindow().window(), m_gnome_wm_supporting_wm_check, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &gnome_win, 1); @@ -71,7 +71,7 @@ void Gnome::initForScreen(BScreen &screen) { }; //list atoms that we support - XChangeProperty(disp, screen.getRootWindow(), + XChangeProperty(disp, screen.rootWindow().window(), m_gnome_wm_prot, XA_ATOM, 32, PropModeReplace, (unsigned char *)gnomeatomlist, (sizeof gnomeatomlist)/sizeof gnomeatomlist[0]); @@ -173,7 +173,7 @@ void Gnome::updateClientList(BScreen &screen) { //number of windows to show in client list num = win; XChangeProperty(FbTk::App::instance()->display(), - screen.getRootWindow(), + screen.rootWindow().window(), m_gnome_wm_win_client_list, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)wl, num); @@ -195,7 +195,7 @@ void Gnome::updateWorkspaceNames(BScreen &screen) { } if (XStringListToTextProperty(names, number_of_desks, &text)) { - XSetTextProperty(FbTk::App::instance()->display(), screen.getRootWindow(), + XSetTextProperty(FbTk::App::instance()->display(), screen.rootWindow().window(), &text, m_gnome_wm_win_workspace_names); XFree(text.value); } @@ -207,7 +207,7 @@ void Gnome::updateWorkspaceNames(BScreen &screen) { void Gnome::updateCurrentWorkspace(BScreen &screen) { int workspace = screen.getCurrentWorkspaceID(); XChangeProperty(FbTk::App::instance()->display(), - screen.getRootWindow(), + screen.rootWindow().window(), m_gnome_wm_win_workspace, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&workspace, 1); @@ -216,7 +216,7 @@ void Gnome::updateCurrentWorkspace(BScreen &screen) { void Gnome::updateWorkspaceCount(BScreen &screen) { int numworkspaces = screen.getCount(); - XChangeProperty(FbTk::App::instance()->display(), screen.getRootWindow(), + XChangeProperty(FbTk::App::instance()->display(), screen.rootWindow().window(), m_gnome_wm_win_workspace_count, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&numworkspaces, 1); } diff --git a/src/IconBar.cc b/src/IconBar.cc index 8e28f2a..d6e6d88 100644 --- a/src/IconBar.cc +++ b/src/IconBar.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: IconBar.cc,v 1.32 2003/04/28 16:48:22 rathnor Exp $ +// $Id: IconBar.cc,v 1.33 2003/05/10 22:55:10 fluxgen Exp $ #include "IconBar.hh" @@ -294,15 +294,16 @@ Window IconBar::createIconWindow(FluxboxWindow *fluxboxwin, Window parent) { attrib.background_pixel = attrib.border_pixel = BlackPixel(m_display, screen().getScreenNumber()); - // fluxboxwin->getScreen().getWindowStyle()->tab.border_color.pixel(); - attrib.colormap = fluxboxwin->getScreen().colormap(); + // fluxboxwin->screen().getWindowStyle()->tab.border_color.pixel(); + attrib.colormap = fluxboxwin->screen().rootWindow().colormap(); attrib.override_redirect = True; attrib.event_mask = ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | ExposureMask | EnterWindowMask; //create iconwindow Window iconwin = XCreateWindow(m_display, parent, 0, 0, 1, 1, 0, - fluxboxwin->getScreen().getDepth(), InputOutput, fluxboxwin->getScreen().getVisual(), + fluxboxwin->screen().rootWindow().depth(), + InputOutput, fluxboxwin->screen().rootWindow().visual(), attrib_mask, &attrib); return iconwin; diff --git a/src/Screen.cc b/src/Screen.cc index b85c3b4..1b27ff3 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.cc,v 1.151 2003/05/10 18:15:23 fluxgen Exp $ +// $Id: Screen.cc,v 1.152 2003/05/10 22:52:44 fluxgen Exp $ #include "Screen.hh" @@ -512,6 +512,7 @@ BScreen::BScreen(ResourceManager &rm, m_root_theme(new RootTheme(scrn, *resource.rootcommand)), + m_root_window(scrn), resource(rm, screenname, altscreenname), m_toolbarhandler(0) { @@ -523,7 +524,7 @@ BScreen::BScreen(ResourceManager &rm, ButtonPressMask | ButtonReleaseMask| SubstructureNotifyMask; XErrorHandler old = XSetErrorHandler((XErrorHandler) anotherWMRunning); - XSelectInput(disp, getRootWindow(), event_mask); + rootWindow().setEventMask(event_mask); XSync(disp, False); XSetErrorHandler((XErrorHandler) old); @@ -539,14 +540,14 @@ BScreen::BScreen(ResourceManager &rm, FBNLS::ScreenSet, FBNLS::ScreenManagingScreen, "BScreen::BScreen: managing screen %d " "using visual 0x%lx, depth %d\n"), - getScreenNumber(), XVisualIDFromVisual(getVisual()), - getDepth()); + getScreenNumber(), XVisualIDFromVisual(rootWindow().visual()), + rootWindow().depth()); Fluxbox * const fluxbox = Fluxbox::instance(); #ifdef HAVE_GETPID pid_t bpid = getpid(); - XChangeProperty(disp, getRootWindow(), + XChangeProperty(disp, rootWindow().window(), Fluxbox::instance()->getFluxboxPidAtom(), XA_CARDINAL, sizeof(pid_t) * 8, PropModeReplace, (unsigned char *) &bpid, 1); @@ -555,7 +556,7 @@ BScreen::BScreen(ResourceManager &rm, cycling_window = focused_list.end(); - XDefineCursor(disp, getRootWindow(), fluxbox->getSessionCursor()); + XDefineCursor(disp, rootWindow().window(), fluxbox->getSessionCursor()); image_control = new FbTk::ImageControl(scrn, true, fluxbox->colorsPerChannel(), @@ -591,13 +592,13 @@ BScreen::BScreen(ResourceManager &rm, XSetWindowAttributes attrib; unsigned long mask = CWBorderPixel | CWColormap | CWSaveUnder; attrib.border_pixel = m_root_theme->borderColor().pixel(); - attrib.colormap = colormap(); + attrib.colormap = rootWindow().colormap(); attrib.save_under = true; geom_window = - XCreateWindow(disp, getRootWindow(), - 0, 0, geom_w, geom_h, rootTheme().borderWidth(), getDepth(), - InputOutput, getVisual(), mask, &attrib); + XCreateWindow(disp, rootWindow().window(), + 0, 0, geom_w, geom_h, rootTheme().borderWidth(), rootWindow().depth(), + InputOutput, rootWindow().visual(), mask, &attrib); geom_visible = false; if (winFrameTheme().labelFocusTexture().type() & FbTk::Texture::PARENTRELATIVE) { @@ -675,7 +676,7 @@ BScreen::BScreen(ResourceManager &rm, int i; unsigned int nchild; Window r, p, *children; - XQueryTree(disp, getRootWindow(), &r, &p, &children, &nchild); + XQueryTree(disp, rootWindow().window(), &r, &p, &children, &nchild); // preen the window list of all icon windows... for better dockapp support for (i = 0; i < (int) nchild; i++) { @@ -787,7 +788,7 @@ Pixmap BScreen::rootPixmap() const { int real_format; unsigned long items_read, items_left; unsigned int *data; - if (XGetWindowProperty(disp, getRootWindow(), + if (XGetWindowProperty(disp, rootWindow().window(), XInternAtom(disp, "_XROOTPMAP_ID", false), 0L, 1L, false, XA_PIXMAP, &real_type, @@ -2270,16 +2271,13 @@ void BScreen::createStyleMenu(FbTk::Menu &menu, void BScreen::shutdown() { Display *disp = FbTk::App::instance()->display(); - XSelectInput(disp, getRootWindow(), NoEventMask); + rootWindow().setEventMask(NoEventMask); XSync(disp, False); for_each(workspacesList.begin(), workspacesList.end(), mem_fun(&Workspace::shutdown)); - - - #ifdef SLIT if (m_slit.get()) m_slit->shutdown(); diff --git a/src/Slit.cc b/src/Slit.cc index 86648af..1f4e4cc 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.47 2003/05/07 22:52:36 fluxgen Exp $ +// $Id: Slit.cc,v 1.48 2003/05/10 22:53:57 fluxgen Exp $ #include "Slit.hh" @@ -297,7 +297,7 @@ Slit::Slit(BScreen &scr, FbTk::XLayer &layer, const char *filename) attrib.background_pixmap = None; attrib.background_pixel = attrib.border_pixel = screen().rootTheme().borderColor().pixel(); - attrib.colormap = screen().colormap(); + attrib.colormap = screen().rootWindow().colormap(); attrib.override_redirect = True; attrib.event_mask = SubstructureRedirectMask | ButtonPressMask | EnterWindowMask | LeaveWindowMask; @@ -306,9 +306,9 @@ Slit::Slit(BScreen &scr, FbTk::XLayer &layer, const char *filename) frame.width = frame.height = 1; Display *disp = FbTk::App::instance()->display(); frame.window = - XCreateWindow(disp, screen().getRootWindow(), frame.x, frame.y, + XCreateWindow(disp, screen().rootWindow().window(), frame.x, frame.y, frame.width, frame.height, screen().rootTheme().borderWidth(), - screen().getDepth(), InputOutput, screen().getVisual(), + screen().rootWindow().depth(), InputOutput, screen().rootWindow().visual(), create_mask, &attrib); FbTk::EventManager::instance()->add(*this, frame.window); @@ -518,7 +518,7 @@ void Slit::removeClient(SlitClient *client, bool remap, bool destroy) { client->disableEvents(); // stop events to frame.window temporarly frame.window.setEventMask(NoEventMask); - XReparentWindow(disp, client->window, screen().getRootWindow(), + XReparentWindow(disp, client->window, screen().rootWindow().window(), client->x, client->y); XChangeSaveSet(disp, client->window, SetModeDelete); // reactivate events to frame.window diff --git a/src/WinClient.cc b/src/WinClient.cc index 1b468d1..77cc31f 100644 --- a/src/WinClient.cc +++ b/src/WinClient.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: WinClient.cc,v 1.7 2003/05/07 16:21:26 rathnor Exp $ +// $Id: WinClient.cc,v 1.8 2003/05/10 22:59:32 fluxgen Exp $ #include "WinClient.hh" @@ -194,7 +194,7 @@ void WinClient::updateTransientInfo() { if (win == window()) return; - if (win != None && m_win->getScreen().getRootWindow() == win) { + if (win != None && m_win->screen().rootWindow() == win) { modal = true; return; // transient for root window... } -- cgit v0.11.2