]> Dogcows Code - chaz/openbox/commitdiff
make an obt_root() macro
authorDana Jansens <danakj@orodu.net>
Thu, 31 Jan 2008 14:56:59 +0000 (09:56 -0500)
committerDana Jansens <danakj@orodu.net>
Thu, 31 Jan 2008 17:25:31 +0000 (12:25 -0500)
16 files changed:
obt/display.h
obt/prop.c
openbox/client.c
openbox/dock.c
openbox/event.c
openbox/focus.c
openbox/focus_cycle_indicator.c
openbox/focus_cycle_popup.c
openbox/frame.c
openbox/grab.c
openbox/keyboard.c
openbox/menuframe.c
openbox/openbox.c
openbox/popup.c
openbox/screen.c
openbox/stacking.c

index 5626f268ddb2f99712792b342ef5fbb08e685690..8c074b5bb7c7e5af20ab986be0622ec075db0c64 100644 (file)
@@ -61,6 +61,8 @@ void     obt_display_close();
 
 void     obt_display_ignore_errors(gboolean ignore);
 
+#define  obt_root(screen) (RootWindow(obt_display, screen))
+
 G_END_DECLS
 
 #endif /*__obt_display_h*/
index 7beb9a91f6fb0981cc908ff5b7d8c432b1c3afc8..e07b10d37374dbdb7803a27f864c1fa45d1a3705 100644 (file)
@@ -468,7 +468,7 @@ void obt_prop_message(gint screen, Window about, Atom messagetype,
                       glong data0, glong data1, glong data2, glong data3,
                       glong data4, glong mask)
 {
-    obt_prop_message_to(RootWindow(obt_display, screen), about, messagetype,
+    obt_prop_message_to(obt_root(screen), about, messagetype,
                         data0, data1, data2, data3, data4, mask);
 }
 
index 9986015c29d9ac3a35bd824552717bc8d6a5f67c..0558c8d44d147120819356718fe456189e66bbd7 100644 (file)
@@ -165,8 +165,8 @@ void client_set_list(void)
     } else
         windows = NULL;
 
-    OBT_PROP_SETA32(RootWindow(obt_display, ob_screen),
-                    NET_CLIENT_LIST, WINDOW, (gulong*)windows, size);
+    OBT_PROP_SETA32(obt_root(ob_screen), NET_CLIENT_LIST, WINDOW,
+                    (gulong*)windows, size);
 
     if (windows)
         g_free(windows);
@@ -1298,7 +1298,7 @@ void client_update_transient_for(ObClient *self)
         /* Setting the transient_for to Root is actually illegal, however
            applications from time have done this to specify transient for
            their group */
-        if (!target && self->group && t == RootWindow(obt_display, ob_screen))
+        if (!target && self->group && t == obt_root(ob_screen))
             trangroup = TRUE;
     } else if (self->group && self->transient)
         trangroup = TRUE;
index 291cd1d0a27c7ff224cae1acd9e66b425623880e..e78c2991c62cdbac8284fee8835c70cc5bf689cf 100644 (file)
@@ -85,8 +85,7 @@ void dock_startup(gboolean reconfig)
     attrib.event_mask = DOCK_EVENT_MASK;
     attrib.override_redirect = True;
     attrib.do_not_propagate_mask = DOCK_NOPROPAGATEMASK;
-    dock->frame = XCreateWindow(obt_display,
-                                RootWindow(obt_display, ob_screen),
+    dock->frame = XCreateWindow(obt_display, obt_root(ob_screen),
                                 0, 0, 1, 1, 0,
                                 RrDepth(ob_rr_inst), InputOutput,
                                 RrVisual(ob_rr_inst),
@@ -202,7 +201,7 @@ void dock_remove(ObDockApp *app, gboolean reparent)
 
     if (reparent)
         XReparentWindow(obt_display, app->icon_win,
-                        RootWindow(obt_display, ob_screen), app->x, app->y);
+                        obt_root(ob_screen), app->x, app->y);
 
     dock->dock_apps = g_list_remove(dock->dock_apps, app);
     dock_configure();
index 80f3c727d0e35a8527e053dd703796064267580b..c54cd1666d4494c76bce690b8c31088ccb0f5664 100644 (file)
@@ -159,7 +159,7 @@ static Window event_get_window(XEvent *e)
     /* pick a window */
     switch (e->type) {
     case SelectionClear:
-        window = RootWindow(obt_display, ob_screen);
+        window = obt_root(ob_screen);
         break;
     case MapRequest:
         window = e->xmap.window;
@@ -314,7 +314,7 @@ static gboolean wanted_focusevent(XEvent *e, gboolean in_client_only)
 
         /* These are the ones we want.. */
 
-        if (win == RootWindow(obt_display, ob_screen)) {
+        if (win == obt_root(ob_screen)) {
             /* If looking for a focus in on a client, then always return
                FALSE for focus in's to the root window */
             if (in_client_only)
@@ -368,7 +368,7 @@ static gboolean wanted_focusevent(XEvent *e, gboolean in_client_only)
             return FALSE;
 
         /* Focus left the root window revertedto state */
-        if (win == RootWindow(obt_display, ob_screen))
+        if (win == obt_root(ob_screen))
             return FALSE;
 
         /* These are the ones we want.. */
@@ -592,7 +592,7 @@ static void event_process(const XEvent *ec, gpointer data)
             obt_display_ignore_errors(TRUE);
             if (XGetInputFocus(obt_display, &win, &i) &&
                 XGetGeometry(obt_display, win, &root, &i,&i,&u,&u,&u,&u) &&
-                root != RootWindow(obt_display, ob_screen))
+                root != obt_root(ob_screen))
             {
                 ob_debug_type(OB_DEBUG_FOCUS,
                               "Focus went to another screen !\n");
@@ -633,7 +633,7 @@ static void event_process(const XEvent *ec, gpointer data)
         event_handle_dock(dock, e);
     else if (menu)
         event_handle_menu(menu, e);
-    else if (window == RootWindow(obt_display, ob_screen))
+    else if (window == obt_root(ob_screen))
         event_handle_root(e);
     else if (e->type == MapRequest)
         client_manage(window);
@@ -700,7 +700,7 @@ static void event_process(const XEvent *ec, gpointer data)
     if (e->type == ButtonPress || e->type == ButtonRelease) {
         /* If the button press was on some non-root window, or was physically
            on the root window, the process it */
-        if (window != RootWindow(obt_display, ob_screen) ||
+        if (window != obt_root(ob_screen) ||
             e->xbutton.subwindow == None)
         {
             event_handle_user_input(client, e);
index 21e2594556d78f478a7961efcffc1d8d3849b43d..7105aa41cd6022d23992d19d77a94ef0a748bd1f 100644 (file)
@@ -91,8 +91,7 @@ void focus_set_client(ObClient *client)
     /* set the NET_ACTIVE_WINDOW hint, but preserve it on shutdown */
     if (ob_state() != OB_STATE_EXITING) {
         active = client ? client->window : None;
-        OBT_PROP_SET32(RootWindow(obt_display, ob_screen),
-                       NET_ACTIVE_WINDOW, WINDOW, active);
+        OBT_PROP_SET32(obt_root(ob_screen), NET_ACTIVE_WINDOW, WINDOW, active);
     }
 }
 
index 2242b3d3d9e276bda481c65e2b473ed2604972d6..4ee456b9a723b8c66ed0bcfdd93dc3830c481225 100644 (file)
@@ -67,16 +67,16 @@ void focus_cycle_indicator_startup(gboolean reconfig)
     attr.override_redirect = True;
     attr.background_pixel = BlackPixel(obt_display, ob_screen);
     focus_indicator.top.window =
-        create_window(RootWindow(obt_display, ob_screen),
+        create_window(obt_root(ob_screen),
                       CWOverrideRedirect | CWBackPixel, &attr);
     focus_indicator.left.window =
-        create_window(RootWindow(obt_display, ob_screen),
+        create_window(obt_root(ob_screen),
                       CWOverrideRedirect | CWBackPixel, &attr);
     focus_indicator.right.window =
-        create_window(RootWindow(obt_display, ob_screen),
+        create_window(obt_root(ob_screen),
                       CWOverrideRedirect | CWBackPixel, &attr);
     focus_indicator.bottom.window =
-        create_window(RootWindow(obt_display, ob_screen),
+        create_window(obt_root(ob_screen),
                       CWOverrideRedirect | CWBackPixel, &attr);
 
     stacking_add(INTERNALWINDOW_AS_WINDOW(&focus_indicator.top));
index e4cf5c10cf95459bebcee1a2593fd626e305d6f8..755414c1598aae437ed2404855f831d3852e5553 100644 (file)
@@ -113,8 +113,7 @@ void focus_cycle_popup_startup(gboolean reconfig)
 
     attrib.override_redirect = True;
     attrib.border_pixel=RrColorPixel(ob_rr_theme->osd_border_color);
-    popup.bg = create_window(RootWindow(obt_display, ob_screen),
-                             ob_rr_theme->obwidth,
+    popup.bg = create_window(obt_root(ob_screen), ob_rr_theme->obwidth,
                              CWOverrideRedirect | CWBorderPixel, &attrib);
 
     popup.text = create_window(popup.bg, 0, 0, NULL);
index 5b7ecac61276c148399cd8714119ba0190ccd76d..5767351bc477e5c6ea72aaca7217c0375592c790 100644 (file)
@@ -101,13 +101,12 @@ ObFrame *frame_new(ObClient *client)
         mask |= CWColormap | CWBackPixel | CWBorderPixel;
         /* create a colormap with the visual */
         self->colormap = attrib.colormap =
-            XCreateColormap(obt_display,
-                            RootWindow(obt_display, ob_screen),
+            XCreateColormap(obt_display, obt_root(ob_screen),
                             visual, AllocNone);
         attrib.background_pixel = BlackPixel(obt_display, ob_screen);
         attrib.border_pixel = BlackPixel(obt_display, ob_screen);
     }
-    self->window = createWindow(RootWindow(obt_display, ob_screen), visual,
+    self->window = createWindow(obt_root(ob_screen), visual,
                                 mask, &attrib);
 
     /* create the visible decor windows */
@@ -1076,10 +1075,8 @@ void frame_release_client(ObFrame *self)
     if (reparent) {
         /* according to the ICCCM - if the client doesn't reparent itself,
            then we will reparent the window to root for them */
-        XReparentWindow(obt_display, self->client->window,
-                        RootWindow(obt_display, ob_screen),
-                        self->client->area.x,
-                        self->client->area.y);
+        XReparentWindow(obt_display, self->client->window, obt_root(ob_screen),
+                        self->client->area.x, self->client->area.y);
     }
 
     /* remove all the windows for the frame from the window_map */
@@ -1357,7 +1354,7 @@ ObFrameContext frame_context(ObClient *client, Window win, gint x, gint y)
     if (moveresize_in_progress)
         return OB_FRAME_CONTEXT_MOVE_RESIZE;
 
-    if (win == RootWindow(obt_display, ob_screen))
+    if (win == obt_root(ob_screen))
         return OB_FRAME_CONTEXT_ROOT ;
     if (client == NULL) return OB_FRAME_CONTEXT_NONE;
     if (win == client->window) {
index 4207b37d5aee357df270d7e5e76674f18de2b976..522fbf96b812cfd213e3cca276b325190a95ca06 100644 (file)
@@ -74,8 +74,7 @@ gboolean grab_keyboard_full(gboolean grab)
 
     if (grab) {
         if (kgrabs++ == 0) {
-            ret = XGrabKeyboard(obt_display,
-                                RootWindow(obt_display, ob_screen),
+            ret = XGrabKeyboard(obt_display, obt_root(ob_screen),
                                 False, GrabModeAsync, GrabModeAsync,
                                 event_curtime) == Success;
             if (!ret)
@@ -106,8 +105,7 @@ gboolean grab_pointer_full(gboolean grab, gboolean owner_events,
             ret = XGrabPointer(obt_display, screen_support_win, owner_events,
                                GRAB_PTR_MASK,
                                GrabModeAsync, GrabModeAsync,
-                               (confine ? RootWindow(obt_display, ob_screen) :
-                                None),
+                               (confine ? obt_root(ob_screen) : None),
                                ob_cursor(cur), event_curtime) == Success;
             if (!ret)
                 --pgrabs;
index 37543f46533802c5c79eaef5a6d65f67ca061738..c2e567fff2deabec27d38e5350db68893d271805 100644 (file)
@@ -44,20 +44,20 @@ static void grab_keys(gboolean grab)
 {
     KeyBindingTree *p;
 
-    ungrab_all_keys(RootWindow(obt_display, ob_screen));
+    ungrab_all_keys(obt_root(ob_screen));
 
     if (grab) {
         p = curpos ? curpos->first_child : keyboard_firstnode;
         while (p) {
             if (p->key)
-                grab_key(p->key, p->state, RootWindow(obt_display, ob_screen),
+                grab_key(p->key, p->state, obt_root(ob_screen),
                          GrabModeAsync);
             p = p->next_sibling;
         }
         if (curpos)
             grab_key(config_keyboard_reset_keycode,
                      config_keyboard_reset_state,
-                     RootWindow(obt_display, ob_screen), GrabModeAsync);
+                     obt_root(ob_screen), GrabModeAsync);
     }
 }
 
index 2abb82c68a0600515080b6b3321f2a208dad8e48..83d0e718ce36659da275181df66745d94d74f46c 100644 (file)
@@ -85,7 +85,7 @@ ObMenuFrame* menu_frame_new(ObMenu *menu, guint show_from, ObClient *client)
     self->show_from = show_from;
 
     attr.event_mask = FRAME_EVENTMASK;
-    self->window = createWindow(RootWindow(obt_display, ob_screen),
+    self->window = createWindow(obt_root(ob_screen),
                                 CWEventMask, &attr);
 
     XSetWindowBorderWidth(obt_display, self->window, ob_rr_theme->mbwidth);
index ed64682361f726d15ea9405cd5dfc8e8a1b441fb..6a58cca6e5b667825dfd43c51fc25ef0aa5930f7 100644 (file)
@@ -144,7 +144,7 @@ gint main(gint argc, gchar **argv)
         /* Send client message telling the OB process to:
          * remote_control = 1 -> reconfigure
          * remote_control = 2 -> restart */
-        OBT_PROP_MSG(ob_screen, RootWindow(obt_display, ob_screen),
+        OBT_PROP_MSG(ob_screen, obt_root(ob_screen),
                      OB_CONTROL, remote_control, 0, 0, 0, 0);
         obt_display_close(obt_display);
         exit(EXIT_SUCCESS);
@@ -233,8 +233,7 @@ gint main(gint argc, gchar **argv)
 
 /*
                 if (config_type != NULL)
-                    PROP_SETS(RootWindow(obt_display, ob_screen),
-                              ob_config, config_type);
+                    PROP_SETS(obt_root(ob_screen), ob_config, config_type);
 */
 
                 /* we're done with parsing now, kill it */
@@ -257,7 +256,7 @@ gint main(gint argc, gchar **argv)
                 if (ob_rr_theme == NULL)
                     ob_exit_with_error(_("Unable to load a theme."));
 
-                OBT_PROP_SETS(RootWindow(obt_display, ob_screen),
+                OBT_PROP_SETS(obt_root(ob_screen),
                               OB_THEME, utf8, ob_rr_theme->name);
             }
 
@@ -300,7 +299,7 @@ gint main(gint argc, gchar **argv)
                 focus_nothing();
 
                 /* focus what was focused if a wm was already running */
-                if (OBT_PROP_GET32(RootWindow(obt_display, ob_screen),
+                if (OBT_PROP_GET32(obt_root(ob_screen),
                                    NET_ACTIVE_WINDOW, WINDOW, &xid) &&
                     (w = window_find(xid)) && WINDOW_IS_CLIENT(w))
                 {
index 21beda58faccbd04d4c7c17d44f2de0c1c466abe..d9a52145554dd13d6cfe6e6742d3c08e4e163049 100644 (file)
@@ -41,7 +41,7 @@ ObPopup *popup_new(void)
     self->iconwm = self->iconhm = 1;
 
     attrib.override_redirect = True;
-    self->bg = XCreateWindow(obt_display, RootWindow(obt_display, ob_screen),
+    self->bg = XCreateWindow(obt_display, obt_root(ob_screen),
                              0, 0, 1, 1, 0, RrDepth(ob_rr_inst),
                              InputOutput, RrVisual(ob_rr_inst),
                              CWOverrideRedirect, &attrib);
index 1d617e7aca675f9ef509761a215da67c0b21414f..dde0443ec63d7335cbc80d15cb6874c47e825afd 100644 (file)
@@ -146,8 +146,7 @@ static gboolean replace_wm(void)
     }
 
     /* Send client message indicating that we are now the WM */
-    obt_prop_message(ob_screen, RootWindow(obt_display, ob_screen),
-                     OBT_PROP_ATOM(MANAGER),
+    obt_prop_message(ob_screen, obt_root(ob_screen), OBT_PROP_ATOM(MANAGER),
                      timestamp, wm_sn_atom, screen_support_win, 0, 0,
                      SubstructureNotifyMask);
 
@@ -164,8 +163,7 @@ gboolean screen_annex(void)
     /* create the netwm support window */
     attrib.override_redirect = TRUE;
     attrib.event_mask = PropertyChangeMask;
-    screen_support_win = XCreateWindow(obt_display,
-                                       RootWindow(obt_display, ob_screen),
+    screen_support_win = XCreateWindow(obt_display, obt_root(ob_screen),
                                        -100, -100, 1, 1, 0,
                                        CopyFromParent, InputOutput,
                                        CopyFromParent,
@@ -180,8 +178,7 @@ gboolean screen_annex(void)
     }
 
     obt_display_ignore_errors(TRUE);
-    XSelectInput(obt_display, RootWindow(obt_display, ob_screen),
-                 ROOT_EVENTMASK);
+    XSelectInput(obt_display, obt_root(ob_screen), ROOT_EVENTMASK);
     obt_display_ignore_errors(FALSE);
     if (obt_display_error_occured) {
         g_message(_("A window manager is already running on screen %d"),
@@ -195,11 +192,10 @@ gboolean screen_annex(void)
 
     /* set the OPENBOX_PID hint */
     pid = getpid();
-    OBT_PROP_SET32(RootWindow(obt_display, ob_screen),
-                   OPENBOX_PID, CARDINAL, pid);
+    OBT_PROP_SET32(obt_root(ob_screen), OPENBOX_PID, CARDINAL, pid);
 
     /* set supporting window */
-    OBT_PROP_SET32(RootWindow(obt_display, ob_screen),
+    OBT_PROP_SET32(obt_root(ob_screen),
                    NET_SUPPORTING_WM_CHECK, WINDOW, screen_support_win);
 
     /* set properties on the supporting window */
@@ -297,7 +293,7 @@ gboolean screen_annex(void)
     supported[i++] = OBT_PROP_ATOM(OB_CONTROL);
     g_assert(i == num_support);
 
-    OBT_PROP_SETA32(RootWindow(obt_display, ob_screen),
+    OBT_PROP_SETA32(obt_root(ob_screen),
                     NET_SUPPORTED, ATOM, supported, num_support);
     g_free(supported);
 
@@ -331,13 +327,13 @@ static void screen_tell_ksplash(void)
        something. oh well. */
     e.xclient.type = ClientMessage;
     e.xclient.display = obt_display;
-    e.xclient.window = RootWindow(obt_display, ob_screen);
+    e.xclient.window = obt_root(ob_screen);
     e.xclient.message_type =
         XInternAtom(obt_display, "_KDE_SPLASH_PROGRESS", False );
     e.xclient.format = 8;
     strcpy(e.xclient.data.b, "wm started");
-    XSendEvent(obt_display, RootWindow(obt_display, ob_screen),
-               False, SubstructureNotifyMask, &e );
+    XSendEvent(obt_display, obt_root(ob_screen),
+               False, SubstructureNotifyMask, &e);
 }
 
 void screen_startup(gboolean reconfig)
@@ -361,9 +357,7 @@ void screen_startup(gboolean reconfig)
     screen_resize();
 
     /* have names already been set for the desktops? */
-    if (OBT_PROP_GETSS(RootWindow(obt_display, ob_screen),
-                       NET_DESKTOP_NAMES, utf8, &names))
-    {
+    if (OBT_PROP_GETSS(obt_root(ob_screen), NET_DESKTOP_NAMES, utf8, &names)) {
         g_strfreev(names);
         namesexist = TRUE;
     }
@@ -384,7 +378,7 @@ void screen_startup(gboolean reconfig)
             names[i] = g_strdup(it->data);
 
         /* set the root window property */
-        OBT_PROP_SETSS(RootWindow(obt_display, ob_screen),
+        OBT_PROP_SETSS(obt_root(ob_screen),
                        NET_DESKTOP_NAMES, utf8, (const gchar**)names);
 
         g_strfreev(names);
@@ -395,7 +389,7 @@ void screen_startup(gboolean reconfig)
        this will also set the default names from the config file up for
        desktops that don't have names yet */
     screen_num_desktops = 0;
-    if (OBT_PROP_GET32(RootWindow(obt_display, ob_screen),
+    if (OBT_PROP_GET32(obt_root(ob_screen),
                        NET_NUMBER_OF_DESKTOPS, CARDINAL, &d))
         screen_set_num_desktops(d);
     /* restore from session if possible */
@@ -406,7 +400,7 @@ void screen_startup(gboolean reconfig)
 
     screen_desktop = screen_num_desktops;  /* something invalid */
     /* start on the current desktop when a wm was already running */
-    if (OBT_PROP_GET32(RootWindow(obt_display, ob_screen),
+    if (OBT_PROP_GET32(obt_root(ob_screen),
                        NET_CURRENT_DESKTOP, CARDINAL, &d) &&
         d < screen_num_desktops)
     {
@@ -421,7 +415,7 @@ void screen_startup(gboolean reconfig)
 
     /* don't start in showing-desktop mode */
     screen_showing_desktop = FALSE;
-    OBT_PROP_SET32(RootWindow(obt_display, ob_screen),
+    OBT_PROP_SET32(obt_root(ob_screen),
                    NET_SHOWING_DESKTOP, CARDINAL, screen_showing_desktop);
 
     if (session_desktop_layout_present &&
@@ -440,15 +434,14 @@ void screen_shutdown(gboolean reconfig)
     if (reconfig)
         return;
 
-    XSelectInput(obt_display, RootWindow(obt_display, ob_screen),
-                 NoEventMask);
+    XSelectInput(obt_display, obt_root(ob_screen), NoEventMask);
 
     /* we're not running here no more! */
-    OBT_PROP_ERASE(RootWindow(obt_display, ob_screen), OPENBOX_PID);
+    OBT_PROP_ERASE(obt_root(ob_screen), OPENBOX_PID);
     /* not without us */
-    OBT_PROP_ERASE(RootWindow(obt_display, ob_screen), NET_SUPPORTED);
+    OBT_PROP_ERASE(obt_root(ob_screen), NET_SUPPORTED);
     /* don't keep this mode */
-    OBT_PROP_ERASE(RootWindow(obt_display, ob_screen), NET_SHOWING_DESKTOP);
+    OBT_PROP_ERASE(obt_root(ob_screen), NET_SHOWING_DESKTOP);
 
     XDestroyWindow(obt_display, screen_support_win);
 
@@ -473,7 +466,7 @@ void screen_resize(void)
     /* Set the _NET_DESKTOP_GEOMETRY hint */
     screen_physical_size.width = geometry[0] = w;
     screen_physical_size.height = geometry[1] = h;
-    OBT_PROP_SETA32(RootWindow(obt_display, ob_screen),
+    OBT_PROP_SETA32(obt_root(ob_screen),
                     NET_DESKTOP_GEOMETRY, CARDINAL, geometry, 2);
 
     if (ob_state() == OB_STATE_STARTING)
@@ -498,12 +491,11 @@ void screen_set_num_desktops(guint num)
 
     old = screen_num_desktops;
     screen_num_desktops = num;
-    OBT_PROP_SET32(RootWindow(obt_display, ob_screen),
-                   NET_NUMBER_OF_DESKTOPS, CARDINAL, num);
+    OBT_PROP_SET32(obt_root(ob_screen), NET_NUMBER_OF_DESKTOPS, CARDINAL, num);
 
     /* set the viewport hint */
     viewport = g_new0(gulong, num * 2);
-    OBT_PROP_SETA32(RootWindow(obt_display, ob_screen),
+    OBT_PROP_SETA32(obt_root(ob_screen),
                     NET_DESKTOP_VIEWPORT, CARDINAL, viewport, num * 2);
     g_free(viewport);
 
@@ -599,8 +591,7 @@ void screen_set_desktop(guint num, gboolean dofocus)
 
     if (previous == num) return;
 
-    OBT_PROP_SET32(RootWindow(obt_display, ob_screen),
-                   NET_CURRENT_DESKTOP, CARDINAL, num);
+    OBT_PROP_SET32(obt_root(ob_screen), NET_CURRENT_DESKTOP, CARDINAL, num);
 
     /* This whole thing decides when/how to save the screen_last_desktop so
        that it can be restored later if you want */
@@ -1089,7 +1080,7 @@ void screen_update_layout(void)
     screen_desktop_layout.rows = 1;
     screen_desktop_layout.columns = screen_num_desktops;
 
-    if (OBT_PROP_GETA32(RootWindow(obt_display, ob_screen),
+    if (OBT_PROP_GETA32(obt_root(ob_screen),
                         NET_DESKTOP_LAYOUT, CARDINAL, &data, &num)) {
         if (num == 3 || num == 4) {
 
@@ -1134,7 +1125,7 @@ void screen_update_desktop_names(void)
     g_strfreev(screen_desktop_names);
     screen_desktop_names = NULL;
 
-    if (OBT_PROP_GETSS(RootWindow(obt_display, ob_screen),
+    if (OBT_PROP_GETSS(obt_root(ob_screen),
                        NET_DESKTOP_NAMES, utf8, &screen_desktop_names))
         for (i = 0; screen_desktop_names[i] && i < screen_num_desktops; ++i);
     else
@@ -1161,7 +1152,7 @@ void screen_update_desktop_names(void)
 
         /* if we changed any names, then set the root property so we can
            all agree on the names */
-        OBT_PROP_SETSS(RootWindow(obt_display, ob_screen), NET_DESKTOP_NAMES,
+        OBT_PROP_SETSS(obt_root(ob_screen), NET_DESKTOP_NAMES,
                        utf8, (const gchar**)screen_desktop_names);
     }
 
@@ -1229,8 +1220,7 @@ void screen_show_desktop(gboolean show, ObClient *show_only)
     }
 
     show = !!show; /* make it boolean */
-    OBT_PROP_SET32(RootWindow(obt_display, ob_screen),
-                   NET_SHOWING_DESKTOP, CARDINAL, show);
+    OBT_PROP_SET32(obt_root(ob_screen), NET_SHOWING_DESKTOP, CARDINAL, show);
 }
 
 void screen_install_colormap(ObClient *client, gboolean install)
@@ -1454,7 +1444,7 @@ void screen_update_areas(void)
 
     /* all the work areas are not used here, only the ones for the first
        monitor are */
-    OBT_PROP_SETA32(RootWindow(obt_display, ob_screen), NET_WORKAREA, CARDINAL,
+    OBT_PROP_SETA32(obt_root(ob_screen), NET_WORKAREA, CARDINAL,
                     dims, 4 * screen_num_desktops);
 
     /* the area has changed, adjust all the windows if they need it */
@@ -1696,10 +1686,10 @@ Rect* screen_physical_area_active(void)
 void screen_set_root_cursor(void)
 {
     if (sn_app_starting())
-        XDefineCursor(obt_display, RootWindow(obt_display, ob_screen),
+        XDefineCursor(obt_display, obt_root(ob_screen),
                       ob_cursor(OB_CURSOR_BUSYPOINTER));
     else
-        XDefineCursor(obt_display, RootWindow(obt_display, ob_screen),
+        XDefineCursor(obt_display, obt_root(ob_screen),
                       ob_cursor(OB_CURSOR_POINTER));
 }
 
@@ -1710,12 +1700,12 @@ gboolean screen_pointer_pos(gint *x, gint *y)
     guint u;
     gboolean ret;
 
-    ret = !!XQueryPointer(obt_display, RootWindow(obt_display, ob_screen),
+    ret = !!XQueryPointer(obt_display, obt_root(ob_screen),
                           &w, &w, x, y, &i, &i, &u);
     if (!ret) {
         for (i = 0; i < ScreenCount(obt_display); ++i)
             if (i != ob_screen)
-                if (XQueryPointer(obt_display, RootWindow(obt_display, i),
+                if (XQueryPointer(obt_display, obt_root(i),
                                   &w, &w, x, y, &i, &i, &u))
                     break;
     }
index b44b98196d3f884cd265ca50a3d64bfe1b445254..6b3c955a713c71866efa737ebb4d294e69ca93b4 100644 (file)
@@ -54,8 +54,8 @@ void stacking_set_list(void)
         }
     }
 
-    OBT_PROP_SETA32(RootWindow(obt_display, ob_screen),
-                    NET_CLIENT_LIST_STACKING, WINDOW, (gulong*)windows, i);
+    OBT_PROP_SETA32(obt_root(ob_screen), NET_CLIENT_LIST_STACKING, WINDOW,
+                    (gulong*)windows, i);
 
     g_free(windows);
 }
This page took 0.051002 seconds and 4 git commands to generate.