From e2ddfaf9fff1fb9dd6ebdc1a95f2b228d6baedb2 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 26 Jul 2007 20:12:39 -0400 Subject: [PATCH] s/ob_display/obt_display/ and remove ob_display --- openbox/client.c | 83 +++--- openbox/dock.c | 47 ++-- openbox/event.c | 58 ++--- openbox/focus.c | 6 +- openbox/focus_cycle_indicator.c | 44 ++-- openbox/focus_cycle_popup.c | 30 +-- openbox/frame.c | 448 ++++++++++++++++---------------- openbox/framerender.c | 118 ++++----- openbox/grab.c | 31 +-- openbox/keyboard.c | 6 +- openbox/menuframe.c | 68 ++--- openbox/modkeys.c | 6 +- openbox/mouse.c | 4 +- openbox/moveresize.c | 22 +- openbox/openbox.c | 30 +-- openbox/openbox.h | 4 +- openbox/popup.c | 40 +-- openbox/prop.c | 24 +- openbox/screen.c | 115 ++++---- openbox/stacking.c | 4 +- openbox/startupnotify.c | 2 +- openbox/translate.c | 4 +- 22 files changed, 597 insertions(+), 597 deletions(-) diff --git a/openbox/client.c b/openbox/client.c index 3c295017..04d19a0a 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -165,7 +165,7 @@ void client_set_list(void) } else windows = NULL; - PROP_SETA32(RootWindow(ob_display, ob_screen), + PROP_SETA32(RootWindow(obt_display, ob_screen), net_client_list, window, (gulong*)windows, size); if (windows) @@ -181,13 +181,13 @@ void client_manage_all(void) XWMHints *wmhints; XWindowAttributes attrib; - XQueryTree(ob_display, RootWindow(ob_display, ob_screen), + XQueryTree(obt_display, RootWindow(obt_display, ob_screen), &w, &w, &children, &nchild); /* remove all icon windows from the list */ for (i = 0; i < nchild; i++) { if (children[i] == None) continue; - wmhints = XGetWMHints(ob_display, children[i]); + wmhints = XGetWMHints(obt_display, children[i]); if (wmhints) { if ((wmhints->flags & IconWindowHint) && (wmhints->icon_window != children[i])) @@ -203,7 +203,7 @@ void client_manage_all(void) for (i = 0; i < nchild; ++i) { if (children[i] == None) continue; - if (XGetWindowAttributes(ob_display, children[i], &attrib)) { + if (XGetWindowAttributes(obt_display, children[i], &attrib)) { if (attrib.override_redirect) continue; if (attrib.map_state != IsUnmapped) @@ -230,10 +230,10 @@ void client_manage(Window window) /* check if it has already been unmapped by the time we started mapping. the grab does a sync so we don't have to here */ - if (XCheckTypedWindowEvent(ob_display, window, DestroyNotify, &e) || - XCheckTypedWindowEvent(ob_display, window, UnmapNotify, &e)) + if (XCheckTypedWindowEvent(obt_display, window, DestroyNotify, &e) || + XCheckTypedWindowEvent(obt_display, window, UnmapNotify, &e)) { - XPutBackEvent(ob_display, &e); + XPutBackEvent(obt_display, &e); ob_debug("Trying to manage unmapped window. Aborting that.\n"); grab_server(FALSE); @@ -241,7 +241,7 @@ void client_manage(Window window) } /* make sure it isn't an override-redirect window */ - if (!XGetWindowAttributes(ob_display, window, &attrib) || + if (!XGetWindowAttributes(obt_display, window, &attrib) || attrib.override_redirect) { grab_server(FALSE); @@ -249,7 +249,7 @@ void client_manage(Window window) } /* is the window a docking app */ - if ((wmhint = XGetWMHints(ob_display, window))) { + if ((wmhint = XGetWMHints(obt_display, window))) { if ((wmhint->flags & StateHint) && wmhint->initial_state == WithdrawnState) { @@ -268,7 +268,7 @@ void client_manage(Window window) /* choose the events we want to receive on the CLIENT window */ attrib_set.event_mask = CLIENT_EVENTMASK; attrib_set.do_not_propagate_mask = CLIENT_NOPROPAGATEMASK; - XChangeWindowAttributes(ob_display, window, + XChangeWindowAttributes(obt_display, window, CWEventMask|CWDontPropagate, &attrib_set); /* create the ObClient struct, and populate it from the hints on the @@ -290,7 +290,7 @@ void client_manage(Window window) /* specify that if we exit, the window should not be destroyed and should be reparented back to root automatically */ - XChangeSaveSet(ob_display, window, SetModeInsert); + XChangeSaveSet(obt_display, window, SetModeInsert); /* create the decoration frame for the client window */ self->frame = frame_new(self); @@ -338,7 +338,7 @@ void client_manage(Window window) } /* remove the client's border */ - XSetWindowBorderWidth(ob_display, self->window, 0); + XSetWindowBorderWidth(obt_display, self->window, 0); /* adjust the frame to the client's size before showing or placing the window */ @@ -678,7 +678,7 @@ void client_unmanage(ObClient *self) /* we dont want events no more. do this before hiding the frame so we don't generate more events */ - XSelectInput(ob_display, self->window, NoEventMask); + XSelectInput(obt_display, self->window, NoEventMask); /* ignore enter events from the unmap so it doesnt mess with the focus */ if (!config_focus_under_mouse) @@ -686,7 +686,7 @@ void client_unmanage(ObClient *self) frame_hide(self->frame); /* flush to send the hide to the server quickly */ - XFlush(ob_display); + XFlush(obt_display); if (!config_focus_under_mouse) event_end_ignore_all_enters(ignore_start); @@ -694,7 +694,7 @@ void client_unmanage(ObClient *self) mouse_grab_for_client(self, FALSE); /* remove the window from our save set */ - XChangeSaveSet(ob_display, self->window, SetModeDelete); + XChangeSaveSet(obt_display, self->window, SetModeDelete); /* update the focus lists */ focus_order_remove(self); @@ -758,7 +758,7 @@ void client_unmanage(ObClient *self) self->decorations = 0; /* unmanaged windows have no decor */ /* give the client its border back */ - XSetWindowBorderWidth(ob_display, self->window, self->border_width); + XSetWindowBorderWidth(obt_display, self->window, self->border_width); client_move_resize(self, a.x, a.y, a.width, a.height); } @@ -778,7 +778,7 @@ void client_unmanage(ObClient *self) /* if we're left in an unmapped state, the client wont be mapped. this is bad, since we will no longer be managing the window on restart */ - XMapWindow(ob_display, self->window); + XMapWindow(obt_display, self->window); } /* these should not be left on the window ever. other window managers @@ -921,7 +921,7 @@ static void client_restore_session_state(ObClient *self) self->area.width = self->session->w; if (self->session->h > 0) self->area.height = self->session->h; - XResizeWindow(ob_display, self->window, + XResizeWindow(obt_display, self->window, self->area.width, self->area.height); self->desktop = (self->session->desktop == DESKTOP_ALL ? @@ -1156,7 +1156,7 @@ static void client_get_area(ObClient *self) XWindowAttributes wattrib; Status ret; - ret = XGetWindowAttributes(ob_display, self->window, &wattrib); + ret = XGetWindowAttributes(obt_display, self->window, &wattrib); g_assert(ret != BadWindow); RECT_SET(self->area, wattrib.x, wattrib.y, wattrib.width, wattrib.height); @@ -1266,9 +1266,9 @@ static void client_get_shaped(ObClient *self) guint ufoo; gint s; - XShapeSelectInput(ob_display, self->window, ShapeNotifyMask); + XShapeSelectInput(obt_display, self->window, ShapeNotifyMask); - XShapeQueryExtents(ob_display, self->window, &s, &foo, + XShapeQueryExtents(obt_display, self->window, &s, &foo, &foo, &ufoo, &ufoo, &foo, &foo, &foo, &ufoo, &ufoo); self->shaped = (s != 0); @@ -1282,7 +1282,7 @@ void client_update_transient_for(ObClient *self) ObClient *target = NULL; gboolean trangroup = FALSE; - if (XGetTransientForHint(ob_display, self->window, &t)) { + if (XGetTransientForHint(obt_display, self->window, &t)) { if (t != self->window) { /* cant be transient to itself! */ target = g_hash_table_lookup(window_map, &t); /* if this happens then we need to check for it*/ @@ -1297,7 +1297,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(ob_display, ob_screen)) + if (!target && self->group && t == RootWindow(obt_display, ob_screen)) trangroup = TRUE; } else if (self->group && self->transient) trangroup = TRUE; @@ -1486,7 +1486,7 @@ void client_get_type_and_transientness(ObClient *self) g_free(val); } - if (XGetTransientForHint(ob_display, self->window, &t)) + if (XGetTransientForHint(obt_display, self->window, &t)) self->transient = TRUE; if (self->type == (ObClientType) -1) { @@ -1558,7 +1558,7 @@ static void client_get_colormap(ObClient *self) { XWindowAttributes wa; - if (XGetWindowAttributes(ob_display, self->window, &wa)) + if (XGetWindowAttributes(obt_display, self->window, &wa)) client_update_colormap(self, wa.colormap); } @@ -1590,7 +1590,7 @@ void client_update_normal_hints(ObClient *self) SIZE_SET(self->max_size, G_MAXINT, G_MAXINT); /* get the hints from the window */ - if (XGetWMNormalHints(ob_display, self->window, &size, &ret)) { + if (XGetWMNormalHints(obt_display, self->window, &size, &ret)) { /* normal windows can't request placement! har har if (!client_normal(self)) */ @@ -1857,7 +1857,7 @@ void client_update_wmhints(ObClient *self) /* assume a window takes input if it doesnt specify */ self->can_focus = TRUE; - if ((hints = XGetWMHints(ob_display, self->window)) != NULL) { + if ((hints = XGetWMHints(obt_display, self->window)) != NULL) { gboolean ur; if (hints->flags & InputHint) @@ -2119,7 +2119,7 @@ void client_update_icons(ObClient *self) } else { XWMHints *hints; - if ((hints = XGetWMHints(ob_display, self->window))) { + if ((hints = XGetWMHints(obt_display, self->window))) { if (hints->flags & IconPixmapHint) { self->nicons = 1; self->icons = g_new(ObClientIcon, self->nicons); @@ -2910,7 +2910,7 @@ void client_configure(ObClient *self, gint x, gint y, gint w, gint h, /* if the client is enlarging, then resize the client before the frame */ if (send_resize_client && (w > oldw || h > oldh)) { - XMoveResizeWindow(ob_display, self->window, + XMoveResizeWindow(obt_display, self->window, self->frame->size.left, self->frame->size.top, MAX(w, oldw), MAX(h, oldh)); frame_adjust_client_area(self->frame); @@ -2972,7 +2972,7 @@ void client_configure(ObClient *self, gint x, gint y, gint w, gint h, XEvent event; event.type = ConfigureNotify; - event.xconfigure.display = ob_display; + event.xconfigure.display = obt_display; event.xconfigure.event = self->window; event.xconfigure.window = self->window; @@ -2998,11 +2998,11 @@ void client_configure(ObClient *self, gint x, gint y, gint w, gint h, */ if (send_resize_client && (w <= oldw || h <= oldh)) { frame_adjust_client_area(self->frame); - XMoveResizeWindow(ob_display, self->window, + XMoveResizeWindow(obt_display, self->window, self->frame->size.left, self->frame->size.top, w, h); } - XFlush(ob_display); + XFlush(obt_display); } void client_fullscreen(ObClient *self, gboolean fs) @@ -3230,7 +3230,7 @@ void client_close(ObClient *self) if (!self->delete_window) /* don't use client_kill(), we should only kill based on PID in response to a lack of PING replies */ - XKillClient(ob_display, self->window); + XKillClient(obt_display, self->window); else if (self->not_responding) client_kill(self); else @@ -3260,7 +3260,7 @@ void client_kill(ObClient *self) } } else - XKillClient(ob_display, self->window); + XKillClient(obt_display, self->window); } void client_hilite(ObClient *self, gboolean hilite) @@ -3351,11 +3351,12 @@ gboolean client_validate(ObClient *self) { XEvent e; - XSync(ob_display, FALSE); /* get all events on the server */ + XSync(obt_display, FALSE); /* get all events on the server */ - if (XCheckTypedWindowEvent(ob_display, self->window, DestroyNotify, &e) || - XCheckTypedWindowEvent(ob_display, self->window, UnmapNotify, &e)) { - XPutBackEvent(ob_display, &e); + if (XCheckTypedWindowEvent(obt_display, self->window, DestroyNotify, &e) || + XCheckTypedWindowEvent(obt_display, self->window, UnmapNotify, &e)) + { + XPutBackEvent(obt_display, &e); return FALSE; } @@ -3616,7 +3617,7 @@ gboolean client_focus(ObClient *self) if (self->can_focus) { /* This can cause a BadMatch error with CurrentTime, or if an app passed in a bad time for _NET_WM_ACTIVE_WINDOW. */ - XSetInputFocus(ob_display, self->window, RevertToPointerRoot, + XSetInputFocus(obt_display, self->window, RevertToPointerRoot, event_curtime); } @@ -3624,7 +3625,7 @@ gboolean client_focus(ObClient *self) XEvent ce; ce.xclient.type = ClientMessage; ce.xclient.message_type = prop_atoms.wm_protocols; - ce.xclient.display = ob_display; + ce.xclient.display = obt_display; ce.xclient.window = self->window; ce.xclient.format = 32; ce.xclient.data.l[0] = prop_atoms.wm_take_focus; @@ -3632,7 +3633,7 @@ gboolean client_focus(ObClient *self) ce.xclient.data.l[2] = 0l; ce.xclient.data.l[3] = 0l; ce.xclient.data.l[4] = 0l; - XSendEvent(ob_display, self->window, FALSE, NoEventMask, &ce); + XSendEvent(obt_display, self->window, FALSE, NoEventMask, &ce); } obt_display_ignore_errors(FALSE); diff --git a/openbox/dock.c b/openbox/dock.c index 0747f40e..38b7122d 100644 --- a/openbox/dock.c +++ b/openbox/dock.c @@ -57,9 +57,9 @@ void dock_startup(gboolean reconfig) if (reconfig) { GList *it; - XSetWindowBorder(ob_display, dock->frame, + XSetWindowBorder(obt_display, dock->frame, RrColorPixel(ob_rr_theme->osd_border_color)); - XSetWindowBorderWidth(ob_display, dock->frame, ob_rr_theme->obwidth); + XSetWindowBorderWidth(obt_display, dock->frame, ob_rr_theme->obwidth); RrAppearanceFree(dock->a_frame); dock->a_frame = RrAppearanceCopy(ob_rr_theme->osd_hilite_bg); @@ -85,7 +85,8 @@ 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(ob_display, RootWindow(ob_display, ob_screen), + dock->frame = XCreateWindow(obt_display, + RootWindow(obt_display, ob_screen), 0, 0, 1, 1, 0, RrDepth(ob_rr_inst), InputOutput, RrVisual(ob_rr_inst), @@ -93,9 +94,9 @@ void dock_startup(gboolean reconfig) CWDontPropagate, &attrib); dock->a_frame = RrAppearanceCopy(ob_rr_theme->osd_hilite_bg); - XSetWindowBorder(ob_display, dock->frame, + XSetWindowBorder(obt_display, dock->frame, RrColorPixel(ob_rr_theme->osd_border_color)); - XSetWindowBorderWidth(ob_display, dock->frame, ob_rr_theme->obwidth); + XSetWindowBorderWidth(obt_display, dock->frame, ob_rr_theme->obwidth); /* Setting the window type so xcompmgr can tell what it is */ PROP_SET32(dock->frame, net_wm_window_type, atom, @@ -117,7 +118,7 @@ void dock_shutdown(gboolean reconfig) return; } - XDestroyWindow(ob_display, dock->frame); + XDestroyWindow(obt_display, dock->frame); RrAppearanceFree(dock->a_frame); g_hash_table_remove(window_map, &dock->frame); stacking_remove(dock); @@ -147,7 +148,7 @@ void dock_add(Window win, XWMHints *wmhints) if (app->name == NULL) app->name = g_strdup(""); if (app->class == NULL) app->class = g_strdup(""); - if (XGetWindowAttributes(ob_display, app->icon_win, &attrib)) { + if (XGetWindowAttributes(obt_display, app->icon_win, &attrib)) { app->w = attrib.width; app->h = attrib.height; } else { @@ -157,7 +158,7 @@ void dock_add(Window win, XWMHints *wmhints) dock->dock_apps = g_list_append(dock->dock_apps, app); dock_configure(); - XReparentWindow(ob_display, app->icon_win, dock->frame, app->x, app->y); + XReparentWindow(obt_display, app->icon_win, dock->frame, app->x, app->y); /* This is the same case as in frame.c for client windows. When Openbox is starting, the window is already mapped so we see unmap events occur for @@ -170,16 +171,16 @@ void dock_add(Window win, XWMHints *wmhints) if (app->win != app->icon_win) { /* have to map it so that it can be re-managed on a restart */ - XMoveWindow(ob_display, app->win, -1000, -1000); - XMapWindow(ob_display, app->win); + XMoveWindow(obt_display, app->win, -1000, -1000); + XMapWindow(obt_display, app->win); } - XMapWindow(ob_display, app->icon_win); - XSync(ob_display, False); + XMapWindow(obt_display, app->icon_win); + XSync(obt_display, False); /* specify that if we exit, the window should not be destroyed and should be reparented back to root automatically */ - XChangeSaveSet(ob_display, app->icon_win, SetModeInsert); - XSelectInput(ob_display, app->icon_win, DOCKAPP_EVENT_MASK); + XChangeSaveSet(obt_display, app->icon_win, SetModeInsert); + XSelectInput(obt_display, app->icon_win, DOCKAPP_EVENT_MASK); dock_app_grab_button(app, TRUE); @@ -197,16 +198,16 @@ void dock_remove_all(void) void dock_remove(ObDockApp *app, gboolean reparent) { dock_app_grab_button(app, FALSE); - XSelectInput(ob_display, app->icon_win, NoEventMask); + XSelectInput(obt_display, app->icon_win, NoEventMask); /* remove the window from our save set */ - XChangeSaveSet(ob_display, app->icon_win, SetModeDelete); - XSync(ob_display, False); + XChangeSaveSet(obt_display, app->icon_win, SetModeDelete); + XSync(obt_display, False); g_hash_table_remove(window_map, &app->icon_win); if (reparent) - XReparentWindow(ob_display, app->icon_win, - RootWindow(ob_display, ob_screen), app->x, app->y); + XReparentWindow(obt_display, app->icon_win, + RootWindow(obt_display, ob_screen), app->x, app->y); dock->dock_apps = g_list_remove(dock->dock_apps, app); dock_configure(); @@ -270,7 +271,7 @@ void dock_configure(void) break; } - XMoveWindow(ob_display, app->icon_win, app->x, app->y); + XMoveWindow(obt_display, app->icon_win, app->x, app->y); } /* used for calculating offsets */ @@ -519,14 +520,14 @@ void dock_configure(void) g_assert(dock->area.width > 0); g_assert(dock->area.height > 0); - XMoveResizeWindow(ob_display, dock->frame, dock->area.x, dock->area.y, + XMoveResizeWindow(obt_display, dock->frame, dock->area.x, dock->area.y, dock->area.width, dock->area.height); RrPaint(dock->a_frame, dock->frame, dock->area.width, dock->area.height); - XMapWindow(ob_display, dock->frame); + XMapWindow(obt_display, dock->frame); } else - XUnmapWindow(ob_display, dock->frame); + XUnmapWindow(obt_display, dock->frame); /* but they are useful outside of this function! */ dock->area.width += ob_rr_theme->obwidth * 2; diff --git a/openbox/event.c b/openbox/event.c index 7e4e25f3..ad1a7fd0 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -160,7 +160,7 @@ static Window event_get_window(XEvent *e) /* pick a window */ switch (e->type) { case SelectionClear: - window = RootWindow(ob_display, ob_screen); + window = RootWindow(obt_display, ob_screen); break; case MapRequest: window = e->xmap.window; @@ -269,7 +269,7 @@ static void event_hack_mods(XEvent *e) /* If XKB is present, then the modifiers are all strange from its magic. Our X core protocol stuff won't work, so we use this to find what the modifier state is instead. */ - if (XkbGetState(ob_display, XkbUseCoreKbd, &xkb_state) == Success) + if (XkbGetState(obt_display, XkbUseCoreKbd, &xkb_state) == Success) e->xkey.state = xkb_state.compat_state; else #endif @@ -285,7 +285,7 @@ static void event_hack_mods(XEvent *e) /* compress events */ { XEvent ce; - while (XCheckTypedWindowEvent(ob_display, e->xmotion.window, + while (XCheckTypedWindowEvent(obt_display, e->xmotion.window, e->type, &ce)) { e->xmotion.x = ce.xmotion.x; e->xmotion.y = ce.xmotion.y; @@ -315,7 +315,7 @@ static gboolean wanted_focusevent(XEvent *e, gboolean in_client_only) /* These are the ones we want.. */ - if (win == RootWindow(ob_display, ob_screen)) { + if (win == RootWindow(obt_display, 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) @@ -369,7 +369,7 @@ static gboolean wanted_focusevent(XEvent *e, gboolean in_client_only) return FALSE; /* Focus left the root window revertedto state */ - if (win == RootWindow(ob_display, ob_screen)) + if (win == RootWindow(obt_display, ob_screen)) return FALSE; /* These are the ones we want.. */ @@ -549,10 +549,10 @@ static void event_process(const XEvent *ec, gpointer data) But if the other focus in is something like PointerRoot then we still want to fall back. */ - if (XCheckIfEvent(ob_display, &ce, event_look_for_focusin_client, + if (XCheckIfEvent(obt_display, &ce, event_look_for_focusin_client, NULL)) { - XPutBackEvent(ob_display, &ce); + XPutBackEvent(obt_display, &ce); ob_debug_type(OB_DEBUG_FOCUS, " but another FocusIn is coming\n"); } else { @@ -589,16 +589,16 @@ static void event_process(const XEvent *ec, gpointer data) XEvent ce; /* Look for the followup FocusIn */ - if (!XCheckIfEvent(ob_display, &ce, event_look_for_focusin, NULL)) { + if (!XCheckIfEvent(obt_display, &ce, event_look_for_focusin, NULL)) { /* There is no FocusIn, this means focus went to a window that is not being managed, or a window on another screen. */ Window win, root; gint i; guint u; obt_display_ignore_errors(TRUE); - if (XGetInputFocus(ob_display, &win, &i) != 0 && - XGetGeometry(ob_display, win, &root, &i,&i,&u,&u,&u,&u) != 0 && - root != RootWindow(ob_display, ob_screen)) + if (XGetInputFocus(obt_display, &win, &i) && + XGetGeometry(obt_display, win, &root, &i,&i,&u,&u,&u,&u) && + root != RootWindow(obt_display, ob_screen)) { ob_debug_type(OB_DEBUG_FOCUS, "Focus went to another screen !\n"); @@ -637,7 +637,7 @@ static void event_process(const XEvent *ec, gpointer data) event_handle_dockapp(dockapp, e); else if (dock) event_handle_dock(dock, e); - else if (window == RootWindow(ob_display, ob_screen)) + else if (window == RootWindow(obt_display, ob_screen)) event_handle_root(e); else if (e->type == MapRequest) client_manage(window); @@ -686,7 +686,7 @@ static void event_process(const XEvent *ec, gpointer data) /* we are not to be held responsible if someone sends us an invalid request! */ obt_display_ignore_errors(TRUE); - XConfigureWindow(ob_display, window, + XConfigureWindow(obt_display, window, e->xconfigurerequest.value_mask, &xwc); obt_display_ignore_errors(FALSE); } @@ -703,7 +703,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(ob_display, ob_screen) || + if (window != RootWindow(obt_display, ob_screen) || e->xbutton.subwindow == None) { event_handle_user_input(client, e); @@ -1258,7 +1258,7 @@ static void event_handle_client(ObClient *client, XEvent *e) /* we don't want the reparent event, put it back on the stack for the X server to deal with after we unmanage the window */ - XPutBackEvent(ob_display, e); + XPutBackEvent(obt_display, e); ob_debug("ReparentNotify for window 0x%x\n", client->window); client_unmanage(client); @@ -1281,13 +1281,13 @@ static void event_handle_client(ObClient *client, XEvent *e) msgtype = e->xclient.message_type; if (msgtype == prop_atoms.wm_change_state) { /* compress changes into a single change */ - while (XCheckTypedWindowEvent(ob_display, client->window, + while (XCheckTypedWindowEvent(obt_display, client->window, e->type, &ce)) { /* XXX: it would be nice to compress ALL messages of a type, not just messages in a row without other message types between. */ if (ce.xclient.message_type != msgtype) { - XPutBackEvent(ob_display, &ce); + XPutBackEvent(obt_display, &ce); break; } e->xclient = ce.xclient; @@ -1295,13 +1295,13 @@ static void event_handle_client(ObClient *client, XEvent *e) client_set_wm_state(client, e->xclient.data.l[0]); } else if (msgtype == prop_atoms.net_wm_desktop) { /* compress changes into a single change */ - while (XCheckTypedWindowEvent(ob_display, client->window, + while (XCheckTypedWindowEvent(obt_display, client->window, e->type, &ce)) { /* XXX: it would be nice to compress ALL messages of a type, not just messages in a row without other message types between. */ if (ce.xclient.message_type != msgtype) { - XPutBackEvent(ob_display, &ce); + XPutBackEvent(obt_display, &ce); break; } e->xclient = ce.xclient; @@ -1492,7 +1492,7 @@ static void event_handle_client(ObClient *client, XEvent *e) if (!client_validate(client)) break; /* compress changes to a single property into a single change */ - while (XCheckTypedWindowEvent(ob_display, client->window, + while (XCheckTypedWindowEvent(obt_display, client->window, e->type, &ce)) { Atom a, b; @@ -1519,7 +1519,7 @@ static void event_handle_client(ObClient *client, XEvent *e) b == prop_atoms.net_wm_icon) continue; - XPutBackEvent(ob_display, &ce); + XPutBackEvent(obt_display, &ce); break; } @@ -1929,8 +1929,8 @@ void event_halt_focus_delay(void) gulong event_start_ignore_all_enters(void) { - XSync(ob_display, FALSE); - return LastKnownRequestProcessed(ob_display); + XSync(obt_display, FALSE); + return LastKnownRequestProcessed(obt_display); } static void event_ignore_enter_range(gulong start, gulong end) @@ -1949,13 +1949,13 @@ static void event_ignore_enter_range(gulong start, gulong end) r->start, r->end); /* increment the serial so we don't ignore events we weren't meant to */ - XSync(ob_display, FALSE); + XSync(obt_display, FALSE); } void event_end_ignore_all_enters(gulong start) { - XSync(ob_display, FALSE); - event_ignore_enter_range(start, LastKnownRequestProcessed(ob_display)); + XSync(obt_display, FALSE); + event_ignore_enter_range(start, LastKnownRequestProcessed(obt_display)); } static gboolean is_enter_focus_event_ignored(XEvent *e) @@ -2004,7 +2004,7 @@ void event_cancel_all_key_grabs(void) else ungrab_passive_key(); - XSync(ob_display, FALSE); + XSync(obt_display, FALSE); } gboolean event_time_after(Time t1, Time t2) @@ -2037,9 +2037,9 @@ Time event_get_server_time(void) /* Generate a timestamp */ XEvent event; - XChangeProperty(ob_display, screen_support_win, + XChangeProperty(obt_display, screen_support_win, prop_atoms.wm_class, prop_atoms.string, 8, PropModeAppend, NULL, 0); - XWindowEvent(ob_display, screen_support_win, PropertyChangeMask, &event); + XWindowEvent(obt_display, screen_support_win, PropertyChangeMask, &event); return event.xproperty.time; } diff --git a/openbox/focus.c b/openbox/focus.c index a4eb2cfa..0d6af4ee 100644 --- a/openbox/focus.c +++ b/openbox/focus.c @@ -52,7 +52,7 @@ void focus_shutdown(gboolean reconfig) if (reconfig) return; /* reset focus to root */ - XSetInputFocus(ob_display, PointerRoot, RevertToNone, CurrentTime); + XSetInputFocus(obt_display, PointerRoot, RevertToNone, CurrentTime); } static void push_to_top(ObClient *client) @@ -91,7 +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; - PROP_SET32(RootWindow(ob_display, ob_screen), + PROP_SET32(RootWindow(obt_display, ob_screen), net_active_window, window, active); } } @@ -199,7 +199,7 @@ void focus_nothing(void) event_cancel_all_key_grabs(); /* when nothing will be focused, send focus to the backup target */ - XSetInputFocus(ob_display, screen_support_win, RevertToPointerRoot, + XSetInputFocus(obt_display, screen_support_win, RevertToPointerRoot, event_curtime); } diff --git a/openbox/focus_cycle_indicator.c b/openbox/focus_cycle_indicator.c index 0aa65a75..a9ca3a2f 100644 --- a/openbox/focus_cycle_indicator.c +++ b/openbox/focus_cycle_indicator.c @@ -45,7 +45,7 @@ static gboolean visible; static Window create_window(Window parent, gulong mask, XSetWindowAttributes *attrib) { - return XCreateWindow(ob_display, parent, 0, 0, 1, 1, 0, + return XCreateWindow(obt_display, parent, 0, 0, 1, 1, 0, RrDepth(ob_rr_inst), InputOutput, RrVisual(ob_rr_inst), mask, attrib); @@ -65,18 +65,18 @@ void focus_cycle_indicator_startup(gboolean reconfig) focus_indicator.bottom.obwin.type = Window_Internal; attr.override_redirect = True; - attr.background_pixel = BlackPixel(ob_display, ob_screen); + attr.background_pixel = BlackPixel(obt_display, ob_screen); focus_indicator.top.win = - create_window(RootWindow(ob_display, ob_screen), + create_window(RootWindow(obt_display, ob_screen), CWOverrideRedirect | CWBackPixel, &attr); focus_indicator.left.win = - create_window(RootWindow(ob_display, ob_screen), + create_window(RootWindow(obt_display, ob_screen), CWOverrideRedirect | CWBackPixel, &attr); focus_indicator.right.win = - create_window(RootWindow(ob_display, ob_screen), + create_window(RootWindow(obt_display, ob_screen), CWOverrideRedirect | CWBackPixel, &attr); focus_indicator.bottom.win = - create_window(RootWindow(ob_display, ob_screen), + create_window(RootWindow(obt_display, ob_screen), CWOverrideRedirect | CWBackPixel, &attr); stacking_add(INTERNAL_AS_WINDOW(&focus_indicator.top)); @@ -127,10 +127,10 @@ void focus_cycle_indicator_shutdown(gboolean reconfig) stacking_remove(INTERNAL_AS_WINDOW(&focus_indicator.right)); stacking_remove(INTERNAL_AS_WINDOW(&focus_indicator.bottom)); - XDestroyWindow(ob_display, focus_indicator.top.win); - XDestroyWindow(ob_display, focus_indicator.left.win); - XDestroyWindow(ob_display, focus_indicator.right.win); - XDestroyWindow(ob_display, focus_indicator.bottom.win); + XDestroyWindow(obt_display, focus_indicator.top.win); + XDestroyWindow(obt_display, focus_indicator.left.win); + XDestroyWindow(obt_display, focus_indicator.right.win); + XDestroyWindow(obt_display, focus_indicator.bottom.win); } void focus_cycle_draw_indicator(ObClient *c) @@ -141,10 +141,10 @@ void focus_cycle_draw_indicator(ObClient *c) /* kill enter events cause by this unmapping */ ignore_start = event_start_ignore_all_enters(); - XUnmapWindow(ob_display, focus_indicator.top.win); - XUnmapWindow(ob_display, focus_indicator.left.win); - XUnmapWindow(ob_display, focus_indicator.right.win); - XUnmapWindow(ob_display, focus_indicator.bottom.win); + XUnmapWindow(obt_display, focus_indicator.top.win); + XUnmapWindow(obt_display, focus_indicator.left.win); + XUnmapWindow(obt_display, focus_indicator.right.win); + XUnmapWindow(obt_display, focus_indicator.bottom.win); event_end_ignore_all_enters(ignore_start); @@ -166,7 +166,7 @@ void focus_cycle_draw_indicator(ObClient *c) w = c->frame->area.width; h = wt; - XMoveResizeWindow(ob_display, focus_indicator.top.win, + XMoveResizeWindow(obt_display, focus_indicator.top.win, x, y, w, h); a_focus_indicator->texture[0].data.lineart.x1 = 0; a_focus_indicator->texture[0].data.lineart.y1 = h-1; @@ -192,7 +192,7 @@ void focus_cycle_draw_indicator(ObClient *c) w = wl; h = c->frame->area.height; - XMoveResizeWindow(ob_display, focus_indicator.left.win, + XMoveResizeWindow(obt_display, focus_indicator.left.win, x, y, w, h); a_focus_indicator->texture[0].data.lineart.x1 = w-1; a_focus_indicator->texture[0].data.lineart.y1 = 0; @@ -218,7 +218,7 @@ void focus_cycle_draw_indicator(ObClient *c) w = wr; h = c->frame->area.height ; - XMoveResizeWindow(ob_display, focus_indicator.right.win, + XMoveResizeWindow(obt_display, focus_indicator.right.win, x, y, w, h); a_focus_indicator->texture[0].data.lineart.x1 = 0; a_focus_indicator->texture[0].data.lineart.y1 = 0; @@ -244,7 +244,7 @@ void focus_cycle_draw_indicator(ObClient *c) w = c->frame->area.width; h = wb; - XMoveResizeWindow(ob_display, focus_indicator.bottom.win, + XMoveResizeWindow(obt_display, focus_indicator.bottom.win, x, y, w, h); a_focus_indicator->texture[0].data.lineart.x1 = 0; a_focus_indicator->texture[0].data.lineart.y1 = 0; @@ -265,10 +265,10 @@ void focus_cycle_draw_indicator(ObClient *c) RrPaint(a_focus_indicator, focus_indicator.bottom.win, w, h); - XMapWindow(ob_display, focus_indicator.top.win); - XMapWindow(ob_display, focus_indicator.left.win); - XMapWindow(ob_display, focus_indicator.right.win); - XMapWindow(ob_display, focus_indicator.bottom.win); + XMapWindow(obt_display, focus_indicator.top.win); + XMapWindow(obt_display, focus_indicator.left.win); + XMapWindow(obt_display, focus_indicator.right.win); + XMapWindow(obt_display, focus_indicator.bottom.win); visible = TRUE; } diff --git a/openbox/focus_cycle_popup.c b/openbox/focus_cycle_popup.c index 9a6f2420..98998c88 100644 --- a/openbox/focus_cycle_popup.c +++ b/openbox/focus_cycle_popup.c @@ -87,7 +87,7 @@ static void popup_render (ObFocusCyclePopup *p, static Window create_window(Window parent, guint bwidth, gulong mask, XSetWindowAttributes *attr) { - return XCreateWindow(ob_display, parent, 0, 0, 1, 1, bwidth, + return XCreateWindow(obt_display, parent, 0, 0, 1, 1, bwidth, RrDepth(ob_rr_inst), InputOutput, RrVisual(ob_rr_inst), mask, attr); } @@ -113,7 +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(ob_display, ob_screen), + popup.bg = create_window(RootWindow(obt_display, ob_screen), ob_rr_theme->obwidth, CWOverrideRedirect | CWBorderPixel, &attrib); @@ -125,7 +125,7 @@ void focus_cycle_popup_startup(gboolean reconfig) popup.hilite_rgba = NULL; - XMapWindow(ob_display, popup.text); + XMapWindow(obt_display, popup.text); stacking_add(INTERNAL_AS_WINDOW(&popup)); g_hash_table_insert(window_map, &popup.bg, &popup); @@ -142,7 +142,7 @@ void focus_cycle_popup_shutdown(gboolean reconfig) ObFocusCyclePopupTarget *t = popup.targets->data; g_free(t->text); - XDestroyWindow(ob_display, t->win); + XDestroyWindow(obt_display, t->win); popup.targets = g_list_delete_link(popup.targets, popup.targets); } @@ -150,8 +150,8 @@ void focus_cycle_popup_shutdown(gboolean reconfig) g_free(popup.hilite_rgba); popup.hilite_rgba = NULL; - XDestroyWindow(ob_display, popup.text); - XDestroyWindow(ob_display, popup.bg); + XDestroyWindow(obt_display, popup.text); + XDestroyWindow(obt_display, popup.bg); RrAppearanceFree(popup.a_icon); RrAppearanceFree(popup.a_text); @@ -198,7 +198,7 @@ static void popup_setup(ObFocusCyclePopup *p, gboolean create_targets, t->text = text; t->win = create_window(p->bg, 0, 0, NULL); - XMapWindow(ob_display, t->win); + XMapWindow(obt_display, t->win); p->targets = g_list_prepend(p->targets, t); ++n; @@ -313,7 +313,7 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c) if (!p->mapped) { /* position the background but don't draw it*/ - XMoveResizeWindow(ob_display, p->bg, x, y, w, h); + XMoveResizeWindow(obt_display, p->bg, x, y, w, h); /* set up the hilite texture for the background */ p->a_bg->texture[0].data.rgba.width = rgbaw; @@ -323,7 +323,7 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c) p->a_bg->texture[0].data.rgba.data = p->hilite_rgba; /* position the text, but don't draw it */ - XMoveResizeWindow(ob_display, p->text, textx, texty, textw, texth); + XMoveResizeWindow(obt_display, p->text, textx, texty, textw, texth); p->a_text->surface.parentx = textx; p->a_text->surface.parenty = texty; } @@ -411,7 +411,7 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c) innery += ICON_HILITE_WIDTH + ICON_HILITE_MARGIN; /* move the icon */ - XMoveResizeWindow(ob_display, target->win, + XMoveResizeWindow(obt_display, target->win, innerx, innery, innerw, innerh); /* get the icon from the client */ @@ -456,8 +456,8 @@ void focus_cycle_popup_show(ObClient *c, gboolean iconic_windows, if (!popup.mapped) { /* show the dialog */ - XMapWindow(ob_display, popup.bg); - XFlush(ob_display); + XMapWindow(obt_display, popup.bg); + XFlush(obt_display); popup.mapped = TRUE; screen_hide_desktop_popup(); } @@ -469,8 +469,8 @@ void focus_cycle_popup_hide(void) ignore_start = event_start_ignore_all_enters(); - XUnmapWindow(ob_display, popup.bg); - XFlush(ob_display); + XUnmapWindow(obt_display, popup.bg); + XFlush(obt_display); event_end_ignore_all_enters(ignore_start); @@ -480,7 +480,7 @@ void focus_cycle_popup_hide(void) ObFocusCyclePopupTarget *t = popup.targets->data; g_free(t->text); - XDestroyWindow(ob_display, t->win); + XDestroyWindow(obt_display, t->win); popup.targets = g_list_delete_link(popup.targets, popup.targets); } diff --git a/openbox/frame.c b/openbox/frame.c index be8230c0..7f28bbb2 100644 --- a/openbox/frame.c +++ b/openbox/frame.c @@ -55,7 +55,7 @@ static void frame_adjust_cursors(ObFrame *self); static Window createWindow(Window parent, Visual *visual, gulong mask, XSetWindowAttributes *attrib) { - return XCreateWindow(ob_display, parent, 0, 0, 1, 1, 0, + return XCreateWindow(obt_display, parent, 0, 0, 1, 1, 0, (visual ? 32 : RrDepth(ob_rr_inst)), InputOutput, (visual ? visual : RrVisual(ob_rr_inst)), mask, attrib); @@ -72,7 +72,7 @@ static Visual *check_32bit_client(ObClient *c) if (RrDepth(ob_rr_inst) == 32) return NULL; - ret = XGetWindowAttributes(ob_display, c->window, &wattrib); + ret = XGetWindowAttributes(obt_display, c->window, &wattrib); g_assert(ret != BadDrawable); g_assert(ret != BadWindow); @@ -101,13 +101,13 @@ ObFrame *frame_new(ObClient *client) mask |= CWColormap | CWBackPixel | CWBorderPixel; /* create a colormap with the visual */ self->colormap = attrib.colormap = - XCreateColormap(ob_display, - RootWindow(ob_display, ob_screen), + XCreateColormap(obt_display, + RootWindow(obt_display, ob_screen), visual, AllocNone); - attrib.background_pixel = BlackPixel(ob_display, ob_screen); - attrib.border_pixel = BlackPixel(ob_display, ob_screen); + attrib.background_pixel = BlackPixel(obt_display, ob_screen); + attrib.border_pixel = BlackPixel(obt_display, ob_screen); } - self->window = createWindow(RootWindow(ob_display, ob_screen), visual, + self->window = createWindow(RootWindow(obt_display, ob_screen), visual, mask, &attrib); /* create the visible decor windows */ @@ -178,9 +178,9 @@ ObFrame *frame_new(ObClient *client) self->focused = FALSE; /* the other stuff is shown based on decor settings */ - XMapWindow(ob_display, self->label); - XMapWindow(ob_display, self->backback); - XMapWindow(ob_display, self->backfront); + XMapWindow(obt_display, self->label); + XMapWindow(obt_display, self->backback); + XMapWindow(obt_display, self->backfront); self->max_press = self->close_press = self->desk_press = self->iconify_press = self->shade_press = FALSE; @@ -195,25 +195,25 @@ ObFrame *frame_new(ObClient *client) static void set_theme_statics(ObFrame *self) { /* set colors/appearance/sizes for stuff that doesn't change */ - XResizeWindow(ob_display, self->max, + XResizeWindow(obt_display, self->max, ob_rr_theme->button_size, ob_rr_theme->button_size); - XResizeWindow(ob_display, self->iconify, + XResizeWindow(obt_display, self->iconify, ob_rr_theme->button_size, ob_rr_theme->button_size); - XResizeWindow(ob_display, self->icon, + XResizeWindow(obt_display, self->icon, ob_rr_theme->button_size + 2, ob_rr_theme->button_size + 2); - XResizeWindow(ob_display, self->close, + XResizeWindow(obt_display, self->close, ob_rr_theme->button_size, ob_rr_theme->button_size); - XResizeWindow(ob_display, self->desk, + XResizeWindow(obt_display, self->desk, ob_rr_theme->button_size, ob_rr_theme->button_size); - XResizeWindow(ob_display, self->shade, + XResizeWindow(obt_display, self->shade, ob_rr_theme->button_size, ob_rr_theme->button_size); - XResizeWindow(ob_display, self->tltresize, + XResizeWindow(obt_display, self->tltresize, ob_rr_theme->grip_width, ob_rr_theme->paddingy + 1); - XResizeWindow(ob_display, self->trtresize, + XResizeWindow(obt_display, self->trtresize, ob_rr_theme->grip_width, ob_rr_theme->paddingy + 1); - XResizeWindow(ob_display, self->tllresize, + XResizeWindow(obt_display, self->tllresize, ob_rr_theme->paddingx + 1, ob_rr_theme->title_height); - XResizeWindow(ob_display, self->trrresize, + XResizeWindow(obt_display, self->trrresize, ob_rr_theme->paddingx + 1, ob_rr_theme->title_height); /* set up the dynamic appearances */ @@ -242,9 +242,9 @@ void frame_free(ObFrame *self) { free_theme_statics(self); - XDestroyWindow(ob_display, self->window); + XDestroyWindow(obt_display, self->window); if (self->colormap) - XFreeColormap(ob_display, self->colormap); + XFreeColormap(obt_display, self->colormap); g_free(self); } @@ -258,8 +258,8 @@ void frame_show(ObFrame *self) the client gets its MapNotify, i.e. to make sure the client is _visible_ when it gets MapNotify. */ grab_server(TRUE); - XMapWindow(ob_display, self->client->window); - XMapWindow(ob_display, self->window); + XMapWindow(obt_display, self->client->window); + XMapWindow(obt_display, self->window); grab_server(FALSE); } } @@ -269,10 +269,10 @@ void frame_hide(ObFrame *self) if (self->visible) { self->visible = FALSE; if (!frame_iconify_animating(self)) - XUnmapWindow(ob_display, self->window); + XUnmapWindow(obt_display, self->window); /* we unmap the client itself so that we can get MapRequest events, and because the ICCCM tells us to! */ - XUnmapWindow(ob_display, self->client->window); + XUnmapWindow(obt_display, self->client->window); self->client->ignore_unmaps += 1; } } @@ -291,13 +291,13 @@ void frame_adjust_shape(ObFrame *self) if (!self->client->shaped) { /* clear the shape on the frame window */ - XShapeCombineMask(ob_display, self->window, ShapeBounding, + XShapeCombineMask(obt_display, self->window, ShapeBounding, self->size.left, self->size.top, None, ShapeSet); } else { /* make the frame's shape match the clients */ - XShapeCombineShape(ob_display, self->window, ShapeBounding, + XShapeCombineShape(obt_display, self->window, ShapeBounding, self->size.left, self->size.top, self->client->window, @@ -323,7 +323,7 @@ void frame_adjust_shape(ObFrame *self) ++num; } - XShapeCombineRectangles(ob_display, self->window, + XShapeCombineRectangles(obt_display, self->window, ShapeBounding, 0, 0, xrect, num, ShapeUnion, Unsorted); } @@ -398,17 +398,17 @@ void frame_adjust_area(ObFrame *self, gboolean moved, ob_rr_theme->grip_width - self->size.bottom; if (self->cbwidth_l) { - XMoveResizeWindow(ob_display, self->innerleft, + XMoveResizeWindow(obt_display, self->innerleft, self->size.left - self->cbwidth_l, self->size.top, self->cbwidth_l, self->client->area.height); - XMapWindow(ob_display, self->innerleft); + XMapWindow(obt_display, self->innerleft); } else - XUnmapWindow(ob_display, self->innerleft); + XUnmapWindow(obt_display, self->innerleft); if (self->cbwidth_l && innercornerheight > 0) { - XMoveResizeWindow(ob_display, self->innerbll, + XMoveResizeWindow(obt_display, self->innerbll, 0, self->client->area.height - (ob_rr_theme->grip_width - @@ -416,22 +416,22 @@ void frame_adjust_area(ObFrame *self, gboolean moved, self->cbwidth_l, ob_rr_theme->grip_width - self->size.bottom); - XMapWindow(ob_display, self->innerbll); + XMapWindow(obt_display, self->innerbll); } else - XUnmapWindow(ob_display, self->innerbll); + XUnmapWindow(obt_display, self->innerbll); if (self->cbwidth_r) { - XMoveResizeWindow(ob_display, self->innerright, + XMoveResizeWindow(obt_display, self->innerright, self->size.left + self->client->area.width, self->size.top, self->cbwidth_r, self->client->area.height); - XMapWindow(ob_display, self->innerright); + XMapWindow(obt_display, self->innerright); } else - XUnmapWindow(ob_display, self->innerright); + XUnmapWindow(obt_display, self->innerright); if (self->cbwidth_r && innercornerheight > 0) { - XMoveResizeWindow(ob_display, self->innerbrr, + XMoveResizeWindow(obt_display, self->innerbrr, 0, self->client->area.height - (ob_rr_theme->grip_width - @@ -439,35 +439,35 @@ void frame_adjust_area(ObFrame *self, gboolean moved, self->cbwidth_r, ob_rr_theme->grip_width - self->size.bottom); - XMapWindow(ob_display, self->innerbrr); + XMapWindow(obt_display, self->innerbrr); } else - XUnmapWindow(ob_display, self->innerbrr); + XUnmapWindow(obt_display, self->innerbrr); if (self->cbwidth_t) { - XMoveResizeWindow(ob_display, self->innertop, + XMoveResizeWindow(obt_display, self->innertop, self->size.left - self->cbwidth_l, self->size.top - self->cbwidth_t, self->client->area.width + self->cbwidth_l + self->cbwidth_r, self->cbwidth_t); - XMapWindow(ob_display, self->innertop); + XMapWindow(obt_display, self->innertop); } else - XUnmapWindow(ob_display, self->innertop); + XUnmapWindow(obt_display, self->innertop); if (self->cbwidth_b) { - XMoveResizeWindow(ob_display, self->innerbottom, + XMoveResizeWindow(obt_display, self->innerbottom, self->size.left - self->cbwidth_l, self->size.top + self->client->area.height, self->client->area.width + self->cbwidth_l + self->cbwidth_r, self->cbwidth_b); - XMoveResizeWindow(ob_display, self->innerblb, + XMoveResizeWindow(obt_display, self->innerblb, 0, 0, ob_rr_theme->grip_width + self->bwidth, self->cbwidth_b); - XMoveResizeWindow(ob_display, self->innerbrb, + XMoveResizeWindow(obt_display, self->innerbrb, self->client->area.width + self->cbwidth_l + self->cbwidth_r - (ob_rr_theme->grip_width + self->bwidth), @@ -475,13 +475,13 @@ void frame_adjust_area(ObFrame *self, gboolean moved, ob_rr_theme->grip_width + self->bwidth, self->cbwidth_b); - XMapWindow(ob_display, self->innerbottom); - XMapWindow(ob_display, self->innerblb); - XMapWindow(ob_display, self->innerbrb); + XMapWindow(obt_display, self->innerbottom); + XMapWindow(obt_display, self->innerblb); + XMapWindow(obt_display, self->innerbrb); } else { - XUnmapWindow(ob_display, self->innerbottom); - XUnmapWindow(ob_display, self->innerblb); - XUnmapWindow(ob_display, self->innerbrb); + XUnmapWindow(obt_display, self->innerbottom); + XUnmapWindow(obt_display, self->innerblb); + XUnmapWindow(obt_display, self->innerbrb); } if (self->bwidth) { @@ -490,16 +490,16 @@ void frame_adjust_area(ObFrame *self, gboolean moved, /* height of titleleft and titleright */ titlesides = (!self->max_horz ? ob_rr_theme->grip_width : 0); - XMoveResizeWindow(ob_display, self->titletop, + XMoveResizeWindow(obt_display, self->titletop, ob_rr_theme->grip_width + self->bwidth, 0, /* width + bwidth*2 - bwidth*2 - grips*2 */ self->width - ob_rr_theme->grip_width * 2, self->bwidth); - XMoveResizeWindow(ob_display, self->titletopleft, + XMoveResizeWindow(obt_display, self->titletopleft, 0, 0, ob_rr_theme->grip_width + self->bwidth, self->bwidth); - XMoveResizeWindow(ob_display, self->titletopright, + XMoveResizeWindow(obt_display, self->titletopright, self->client->area.width + self->size.left + self->size.right - ob_rr_theme->grip_width - self->bwidth, @@ -508,11 +508,11 @@ void frame_adjust_area(ObFrame *self, gboolean moved, self->bwidth); if (titlesides > 0) { - XMoveResizeWindow(ob_display, self->titleleft, + XMoveResizeWindow(obt_display, self->titleleft, 0, self->bwidth, self->bwidth, titlesides); - XMoveResizeWindow(ob_display, self->titleright, + XMoveResizeWindow(obt_display, self->titleright, self->client->area.width + self->size.left + self->size.right - self->bwidth, @@ -520,73 +520,73 @@ void frame_adjust_area(ObFrame *self, gboolean moved, self->bwidth, titlesides); - XMapWindow(ob_display, self->titleleft); - XMapWindow(ob_display, self->titleright); + XMapWindow(obt_display, self->titleleft); + XMapWindow(obt_display, self->titleright); } else { - XUnmapWindow(ob_display, self->titleleft); - XUnmapWindow(ob_display, self->titleright); + XUnmapWindow(obt_display, self->titleleft); + XUnmapWindow(obt_display, self->titleright); } - XMapWindow(ob_display, self->titletop); - XMapWindow(ob_display, self->titletopleft); - XMapWindow(ob_display, self->titletopright); + XMapWindow(obt_display, self->titletop); + XMapWindow(obt_display, self->titletopleft); + XMapWindow(obt_display, self->titletopright); if (self->decorations & OB_FRAME_DECOR_TITLEBAR) { - XMoveResizeWindow(ob_display, self->titlebottom, + XMoveResizeWindow(obt_display, self->titlebottom, (self->max_horz ? 0 : self->bwidth), ob_rr_theme->title_height + self->bwidth, self->width, self->bwidth); - XMapWindow(ob_display, self->titlebottom); + XMapWindow(obt_display, self->titlebottom); } else - XUnmapWindow(ob_display, self->titlebottom); + XUnmapWindow(obt_display, self->titlebottom); } else { - XUnmapWindow(ob_display, self->titlebottom); + XUnmapWindow(obt_display, self->titlebottom); - XUnmapWindow(ob_display, self->titletop); - XUnmapWindow(ob_display, self->titletopleft); - XUnmapWindow(ob_display, self->titletopright); - XUnmapWindow(ob_display, self->titleleft); - XUnmapWindow(ob_display, self->titleright); + XUnmapWindow(obt_display, self->titletop); + XUnmapWindow(obt_display, self->titletopleft); + XUnmapWindow(obt_display, self->titletopright); + XUnmapWindow(obt_display, self->titleleft); + XUnmapWindow(obt_display, self->titleright); } if (self->decorations & OB_FRAME_DECOR_TITLEBAR) { - XMoveResizeWindow(ob_display, self->title, + XMoveResizeWindow(obt_display, self->title, (self->max_horz ? 0 : self->bwidth), self->bwidth, self->width, ob_rr_theme->title_height); - XMapWindow(ob_display, self->title); + XMapWindow(obt_display, self->title); if (self->decorations & OB_FRAME_DECOR_GRIPS) { - XMoveResizeWindow(ob_display, self->topresize, + XMoveResizeWindow(obt_display, self->topresize, ob_rr_theme->grip_width, 0, self->width - ob_rr_theme->grip_width *2, ob_rr_theme->paddingy + 1); - XMoveWindow(ob_display, self->tltresize, 0, 0); - XMoveWindow(ob_display, self->tllresize, 0, 0); - XMoveWindow(ob_display, self->trtresize, + XMoveWindow(obt_display, self->tltresize, 0, 0); + XMoveWindow(obt_display, self->tllresize, 0, 0); + XMoveWindow(obt_display, self->trtresize, self->width - ob_rr_theme->grip_width, 0); - XMoveWindow(ob_display, self->trrresize, + XMoveWindow(obt_display, self->trrresize, self->width - ob_rr_theme->paddingx - 1, 0); - XMapWindow(ob_display, self->topresize); - XMapWindow(ob_display, self->tltresize); - XMapWindow(ob_display, self->tllresize); - XMapWindow(ob_display, self->trtresize); - XMapWindow(ob_display, self->trrresize); + XMapWindow(obt_display, self->topresize); + XMapWindow(obt_display, self->tltresize); + XMapWindow(obt_display, self->tllresize); + XMapWindow(obt_display, self->trtresize); + XMapWindow(obt_display, self->trrresize); } else { - XUnmapWindow(ob_display, self->topresize); - XUnmapWindow(ob_display, self->tltresize); - XUnmapWindow(ob_display, self->tllresize); - XUnmapWindow(ob_display, self->trtresize); - XUnmapWindow(ob_display, self->trrresize); + XUnmapWindow(obt_display, self->topresize); + XUnmapWindow(obt_display, self->tltresize); + XUnmapWindow(obt_display, self->tllresize); + XUnmapWindow(obt_display, self->trtresize); + XUnmapWindow(obt_display, self->trrresize); } } else - XUnmapWindow(ob_display, self->title); + XUnmapWindow(obt_display, self->title); } if ((self->decorations & OB_FRAME_DECOR_TITLEBAR)) @@ -597,7 +597,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved, gint sidebwidth = self->max_horz ? 0 : self->bwidth; if (self->bwidth && self->size.bottom) { - XMoveResizeWindow(ob_display, self->handlebottom, + XMoveResizeWindow(obt_display, self->handlebottom, ob_rr_theme->grip_width + self->bwidth + sidebwidth, self->size.top + self->client->area.height + @@ -608,7 +608,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved, if (sidebwidth) { - XMoveResizeWindow(ob_display, self->lgripleft, + XMoveResizeWindow(obt_display, self->lgripleft, 0, self->size.top + self->client->area.height + @@ -620,7 +620,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved, (!self->max_horz ? ob_rr_theme->grip_width : self->size.bottom - self->cbwidth_b)); - XMoveResizeWindow(ob_display, self->rgripright, + XMoveResizeWindow(obt_display, self->rgripright, self->size.left + self->client->area.width + self->size.right - self->bwidth, @@ -635,20 +635,20 @@ void frame_adjust_area(ObFrame *self, gboolean moved, ob_rr_theme->grip_width : self->size.bottom - self->cbwidth_b)); - XMapWindow(ob_display, self->lgripleft); - XMapWindow(ob_display, self->rgripright); + XMapWindow(obt_display, self->lgripleft); + XMapWindow(obt_display, self->rgripright); } else { - XUnmapWindow(ob_display, self->lgripleft); - XUnmapWindow(ob_display, self->rgripright); + XUnmapWindow(obt_display, self->lgripleft); + XUnmapWindow(obt_display, self->rgripright); } - XMoveResizeWindow(ob_display, self->lgripbottom, + XMoveResizeWindow(obt_display, self->lgripbottom, sidebwidth, self->size.top + self->client->area.height + self->size.bottom - self->bwidth, ob_rr_theme->grip_width + self->bwidth, self->bwidth); - XMoveResizeWindow(ob_display, self->rgripbottom, + XMoveResizeWindow(obt_display, self->rgripbottom, self->size.left + self->client->area.width + self->size.right - self->bwidth - sidebwidth- ob_rr_theme->grip_width, @@ -657,29 +657,29 @@ void frame_adjust_area(ObFrame *self, gboolean moved, ob_rr_theme->grip_width + self->bwidth, self->bwidth); - XMapWindow(ob_display, self->handlebottom); - XMapWindow(ob_display, self->lgripbottom); - XMapWindow(ob_display, self->rgripbottom); + XMapWindow(obt_display, self->handlebottom); + XMapWindow(obt_display, self->lgripbottom); + XMapWindow(obt_display, self->rgripbottom); if (self->decorations & OB_FRAME_DECOR_HANDLE && ob_rr_theme->handle_height > 0) { - XMoveResizeWindow(ob_display, self->handletop, + XMoveResizeWindow(obt_display, self->handletop, ob_rr_theme->grip_width + self->bwidth + sidebwidth, FRAME_HANDLE_Y(self), self->width - (ob_rr_theme->grip_width + sidebwidth) * 2, self->bwidth); - XMapWindow(ob_display, self->handletop); + XMapWindow(obt_display, self->handletop); if (self->decorations & OB_FRAME_DECOR_GRIPS) { - XMoveResizeWindow(ob_display, self->handleleft, + XMoveResizeWindow(obt_display, self->handleleft, ob_rr_theme->grip_width, 0, self->bwidth, ob_rr_theme->handle_height); - XMoveResizeWindow(ob_display, self->handleright, + XMoveResizeWindow(obt_display, self->handleright, self->width - ob_rr_theme->grip_width - self->bwidth, @@ -687,13 +687,13 @@ void frame_adjust_area(ObFrame *self, gboolean moved, self->bwidth, ob_rr_theme->handle_height); - XMoveResizeWindow(ob_display, self->lgriptop, + XMoveResizeWindow(obt_display, self->lgriptop, sidebwidth, FRAME_HANDLE_Y(self), ob_rr_theme->grip_width + self->bwidth, self->bwidth); - XMoveResizeWindow(ob_display, self->rgriptop, + XMoveResizeWindow(obt_display, self->rgriptop, self->size.left + self->client->area.width + self->size.right - self->bwidth - @@ -703,77 +703,77 @@ void frame_adjust_area(ObFrame *self, gboolean moved, self->bwidth, self->bwidth); - XMapWindow(ob_display, self->handleleft); - XMapWindow(ob_display, self->handleright); - XMapWindow(ob_display, self->lgriptop); - XMapWindow(ob_display, self->rgriptop); + XMapWindow(obt_display, self->handleleft); + XMapWindow(obt_display, self->handleright); + XMapWindow(obt_display, self->lgriptop); + XMapWindow(obt_display, self->rgriptop); } else { - XUnmapWindow(ob_display, self->handleleft); - XUnmapWindow(ob_display, self->handleright); - XUnmapWindow(ob_display, self->lgriptop); - XUnmapWindow(ob_display, self->rgriptop); + XUnmapWindow(obt_display, self->handleleft); + XUnmapWindow(obt_display, self->handleright); + XUnmapWindow(obt_display, self->lgriptop); + XUnmapWindow(obt_display, self->rgriptop); } } else { - XUnmapWindow(ob_display, self->handleleft); - XUnmapWindow(ob_display, self->handleright); - XUnmapWindow(ob_display, self->lgriptop); - XUnmapWindow(ob_display, self->rgriptop); + XUnmapWindow(obt_display, self->handleleft); + XUnmapWindow(obt_display, self->handleright); + XUnmapWindow(obt_display, self->lgriptop); + XUnmapWindow(obt_display, self->rgriptop); - XUnmapWindow(ob_display, self->handletop); + XUnmapWindow(obt_display, self->handletop); } } else { - XUnmapWindow(ob_display, self->handleleft); - XUnmapWindow(ob_display, self->handleright); - XUnmapWindow(ob_display, self->lgriptop); - XUnmapWindow(ob_display, self->rgriptop); - - XUnmapWindow(ob_display, self->handletop); - - XUnmapWindow(ob_display, self->handlebottom); - XUnmapWindow(ob_display, self->lgripleft); - XUnmapWindow(ob_display, self->rgripright); - XUnmapWindow(ob_display, self->lgripbottom); - XUnmapWindow(ob_display, self->rgripbottom); + XUnmapWindow(obt_display, self->handleleft); + XUnmapWindow(obt_display, self->handleright); + XUnmapWindow(obt_display, self->lgriptop); + XUnmapWindow(obt_display, self->rgriptop); + + XUnmapWindow(obt_display, self->handletop); + + XUnmapWindow(obt_display, self->handlebottom); + XUnmapWindow(obt_display, self->lgripleft); + XUnmapWindow(obt_display, self->rgripright); + XUnmapWindow(obt_display, self->lgripbottom); + XUnmapWindow(obt_display, self->rgripbottom); } if (self->decorations & OB_FRAME_DECOR_HANDLE && ob_rr_theme->handle_height > 0) { - XMoveResizeWindow(ob_display, self->handle, + XMoveResizeWindow(obt_display, self->handle, sidebwidth, FRAME_HANDLE_Y(self) + self->bwidth, self->width, ob_rr_theme->handle_height); - XMapWindow(ob_display, self->handle); + XMapWindow(obt_display, self->handle); if (self->decorations & OB_FRAME_DECOR_GRIPS) { - XMoveResizeWindow(ob_display, self->lgrip, + XMoveResizeWindow(obt_display, self->lgrip, 0, 0, ob_rr_theme->grip_width, ob_rr_theme->handle_height); - XMoveResizeWindow(ob_display, self->rgrip, + XMoveResizeWindow(obt_display, self->rgrip, self->width - ob_rr_theme->grip_width, 0, ob_rr_theme->grip_width, ob_rr_theme->handle_height); - XMapWindow(ob_display, self->lgrip); - XMapWindow(ob_display, self->rgrip); + XMapWindow(obt_display, self->lgrip); + XMapWindow(obt_display, self->rgrip); } else { - XUnmapWindow(ob_display, self->lgrip); - XUnmapWindow(ob_display, self->rgrip); + XUnmapWindow(obt_display, self->lgrip); + XUnmapWindow(obt_display, self->rgrip); } } else { - XUnmapWindow(ob_display, self->lgrip); - XUnmapWindow(ob_display, self->rgrip); + XUnmapWindow(obt_display, self->lgrip); + XUnmapWindow(obt_display, self->rgrip); - XUnmapWindow(ob_display, self->handle); + XUnmapWindow(obt_display, self->handle); } if (self->bwidth && !self->max_horz && (self->client->area.height + self->size.top + self->size.bottom) > ob_rr_theme->grip_width * 2) { - XMoveResizeWindow(ob_display, self->left, + XMoveResizeWindow(obt_display, self->left, 0, self->bwidth + ob_rr_theme->grip_width, self->bwidth, @@ -781,15 +781,15 @@ void frame_adjust_area(ObFrame *self, gboolean moved, self->size.top + self->size.bottom - ob_rr_theme->grip_width * 2); - XMapWindow(ob_display, self->left); + XMapWindow(obt_display, self->left); } else - XUnmapWindow(ob_display, self->left); + XUnmapWindow(obt_display, self->left); if (self->bwidth && !self->max_horz && (self->client->area.height + self->size.top + self->size.bottom) > ob_rr_theme->grip_width * 2) { - XMoveResizeWindow(ob_display, self->right, + XMoveResizeWindow(obt_display, self->right, self->client->area.width + self->cbwidth_l + self->cbwidth_r + self->bwidth, self->bwidth + ob_rr_theme->grip_width, @@ -798,11 +798,11 @@ void frame_adjust_area(ObFrame *self, gboolean moved, self->size.top + self->size.bottom - ob_rr_theme->grip_width * 2); - XMapWindow(ob_display, self->right); + XMapWindow(obt_display, self->right); } else - XUnmapWindow(ob_display, self->right); + XUnmapWindow(obt_display, self->right); - XMoveResizeWindow(ob_display, self->backback, + XMoveResizeWindow(obt_display, self->backback, self->size.left, self->size.top, self->client->area.width, self->client->area.height); @@ -834,7 +834,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved, but don't do this during an iconify animation. it will be reflected afterwards. */ - XMoveResizeWindow(ob_display, self->window, + XMoveResizeWindow(obt_display, self->window, self->area.x, self->area.y, self->area.width, @@ -844,7 +844,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved, also this correctly positions the client when it maps. this also needs to be run when the frame's decorations sizes change! */ - XMoveWindow(ob_display, self->client->window, + XMoveWindow(obt_display, self->client->window, self->size.left, self->size.top); if (resized) { @@ -871,7 +871,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved, focus_cycle_draw_indicator(self->client); } if (resized && (self->decorations & OB_FRAME_DECOR_TITLEBAR)) - XResizeWindow(ob_display, self->label, self->label_width, + XResizeWindow(obt_display, self->label, self->label_width, ob_rr_theme->label_height); } @@ -893,58 +893,58 @@ static void frame_adjust_cursors(ObFrame *self) /* these ones turn off when max vert, and some when shaded */ a.cursor = ob_cursor(r && topbot && !sh ? OB_CURSOR_NORTH : OB_CURSOR_NONE); - XChangeWindowAttributes(ob_display, self->topresize, CWCursor, &a); - XChangeWindowAttributes(ob_display, self->titletop, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->topresize, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->titletop, CWCursor, &a); a.cursor = ob_cursor(r && topbot ? OB_CURSOR_SOUTH : OB_CURSOR_NONE); - XChangeWindowAttributes(ob_display, self->handle, CWCursor, &a); - XChangeWindowAttributes(ob_display, self->handletop, CWCursor, &a); - XChangeWindowAttributes(ob_display, self->handlebottom, CWCursor, &a); - XChangeWindowAttributes(ob_display, self->innerbottom, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->handle, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->handletop, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->handlebottom, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->innerbottom, CWCursor, &a); /* these ones change when shaded */ a.cursor = ob_cursor(r ? (sh ? OB_CURSOR_WEST : OB_CURSOR_NORTHWEST) : OB_CURSOR_NONE); - XChangeWindowAttributes(ob_display, self->titleleft, CWCursor, &a); - XChangeWindowAttributes(ob_display, self->tltresize, CWCursor, &a); - XChangeWindowAttributes(ob_display, self->tllresize, CWCursor, &a); - XChangeWindowAttributes(ob_display, self->titletopleft, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->titleleft, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->tltresize, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->tllresize, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->titletopleft, CWCursor, &a); a.cursor = ob_cursor(r ? (sh ? OB_CURSOR_EAST : OB_CURSOR_NORTHEAST) : OB_CURSOR_NONE); - XChangeWindowAttributes(ob_display, self->titleright, CWCursor, &a); - XChangeWindowAttributes(ob_display, self->trtresize, CWCursor, &a); - XChangeWindowAttributes(ob_display, self->trrresize, CWCursor, &a); - XChangeWindowAttributes(ob_display, self->titletopright, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->titleright, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->trtresize, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->trrresize, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->titletopright, CWCursor,&a); /* these ones are pretty static */ a.cursor = ob_cursor(r ? OB_CURSOR_WEST : OB_CURSOR_NONE); - XChangeWindowAttributes(ob_display, self->left, CWCursor, &a); - XChangeWindowAttributes(ob_display, self->innerleft, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->left, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->innerleft, CWCursor, &a); a.cursor = ob_cursor(r ? OB_CURSOR_EAST : OB_CURSOR_NONE); - XChangeWindowAttributes(ob_display, self->right, CWCursor, &a); - XChangeWindowAttributes(ob_display, self->innerright, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->right, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->innerright, CWCursor, &a); a.cursor = ob_cursor(r ? OB_CURSOR_SOUTHWEST : OB_CURSOR_NONE); - XChangeWindowAttributes(ob_display, self->lgrip, CWCursor, &a); - XChangeWindowAttributes(ob_display, self->handleleft, CWCursor, &a); - XChangeWindowAttributes(ob_display, self->lgripleft, CWCursor, &a); - XChangeWindowAttributes(ob_display, self->lgriptop, CWCursor, &a); - XChangeWindowAttributes(ob_display, self->lgripbottom, CWCursor, &a); - XChangeWindowAttributes(ob_display, self->innerbll, CWCursor, &a); - XChangeWindowAttributes(ob_display, self->innerblb, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->lgrip, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->handleleft, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->lgripleft, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->lgriptop, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->lgripbottom, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->innerbll, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->innerblb, CWCursor, &a); a.cursor = ob_cursor(r ? OB_CURSOR_SOUTHEAST : OB_CURSOR_NONE); - XChangeWindowAttributes(ob_display, self->rgrip, CWCursor, &a); - XChangeWindowAttributes(ob_display, self->handleright, CWCursor, &a); - XChangeWindowAttributes(ob_display, self->rgripright, CWCursor, &a); - XChangeWindowAttributes(ob_display, self->rgriptop, CWCursor, &a); - XChangeWindowAttributes(ob_display, self->rgripbottom, CWCursor, &a); - XChangeWindowAttributes(ob_display, self->innerbrr, CWCursor, &a); - XChangeWindowAttributes(ob_display, self->innerbrb, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->rgrip, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->handleright, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->rgripright, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->rgriptop, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->rgripbottom, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->innerbrr, CWCursor, &a); + XChangeWindowAttributes(obt_display, self->innerbrb, CWCursor, &a); } } void frame_adjust_client_area(ObFrame *self) { /* adjust the window which is there to prevent flashing on unmap */ - XMoveResizeWindow(ob_display, self->backfront, 0, 0, + XMoveResizeWindow(obt_display, self->backfront, 0, 0, self->client->area.width, self->client->area.height); } @@ -960,7 +960,7 @@ void frame_adjust_focus(ObFrame *self, gboolean hilite) self->focused = hilite; self->need_render = TRUE; framerender_frame(self); - XFlush(ob_display); + XFlush(obt_display); } void frame_adjust_title(ObFrame *self) @@ -983,7 +983,7 @@ void frame_grab_client(ObFrame *self) */ /* reparent the client to the frame */ - XReparentWindow(ob_display, self->client->window, self->window, 0, 0); + XReparentWindow(obt_display, self->client->window, self->window, 0, 0); /* When reparenting the client window, it is usually not mapped yet, since @@ -996,7 +996,7 @@ void frame_grab_client(ObFrame *self) /* select the event mask on the client's parent (to receive config/map req's) the ButtonPress is to catch clicks on the client border */ - XSelectInput(ob_display, self->window, FRAME_EVENTMASK); + XSelectInput(obt_display, self->window, FRAME_EVENTMASK); /* set all the windows for the frame in the window_map */ g_hash_table_insert(window_map, &self->window, self->client); @@ -1056,7 +1056,7 @@ void frame_release_client(ObFrame *self) self, FALSE); /* check if the app has already reparented its window away */ - while (XCheckTypedWindowEvent(ob_display, self->client->window, + while (XCheckTypedWindowEvent(obt_display, self->client->window, ReparentNotify, &ev)) { /* This check makes sure we don't catch our own reparent action to @@ -1068,7 +1068,7 @@ void frame_release_client(ObFrame *self) */ if (ev.xreparent.parent != self->window) { reparent = FALSE; - XPutBackEvent(ob_display, &ev); + XPutBackEvent(obt_display, &ev); break; } } @@ -1076,8 +1076,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(ob_display, self->client->window, - RootWindow(ob_display, ob_screen), + XReparentWindow(obt_display, self->client->window, + RootWindow(obt_display, ob_screen), self->client->area.x, self->client->area.y); } @@ -1255,54 +1255,54 @@ static void layout_title(ObFrame *self) /* position and map the elements */ if (self->icon_on) { - XMapWindow(ob_display, self->icon); - XMoveWindow(ob_display, self->icon, self->icon_x, + XMapWindow(obt_display, self->icon); + XMoveWindow(obt_display, self->icon, self->icon_x, ob_rr_theme->paddingy); } else - XUnmapWindow(ob_display, self->icon); + XUnmapWindow(obt_display, self->icon); if (self->desk_on) { - XMapWindow(ob_display, self->desk); - XMoveWindow(ob_display, self->desk, self->desk_x, + XMapWindow(obt_display, self->desk); + XMoveWindow(obt_display, self->desk, self->desk_x, ob_rr_theme->paddingy + 1); } else - XUnmapWindow(ob_display, self->desk); + XUnmapWindow(obt_display, self->desk); if (self->shade_on) { - XMapWindow(ob_display, self->shade); - XMoveWindow(ob_display, self->shade, self->shade_x, + XMapWindow(obt_display, self->shade); + XMoveWindow(obt_display, self->shade, self->shade_x, ob_rr_theme->paddingy + 1); } else - XUnmapWindow(ob_display, self->shade); + XUnmapWindow(obt_display, self->shade); if (self->iconify_on) { - XMapWindow(ob_display, self->iconify); - XMoveWindow(ob_display, self->iconify, self->iconify_x, + XMapWindow(obt_display, self->iconify); + XMoveWindow(obt_display, self->iconify, self->iconify_x, ob_rr_theme->paddingy + 1); } else - XUnmapWindow(ob_display, self->iconify); + XUnmapWindow(obt_display, self->iconify); if (self->max_on) { - XMapWindow(ob_display, self->max); - XMoveWindow(ob_display, self->max, self->max_x, + XMapWindow(obt_display, self->max); + XMoveWindow(obt_display, self->max, self->max_x, ob_rr_theme->paddingy + 1); } else - XUnmapWindow(ob_display, self->max); + XUnmapWindow(obt_display, self->max); if (self->close_on) { - XMapWindow(ob_display, self->close); - XMoveWindow(ob_display, self->close, self->close_x, + XMapWindow(obt_display, self->close); + XMoveWindow(obt_display, self->close, self->close_x, ob_rr_theme->paddingy + 1); } else - XUnmapWindow(ob_display, self->close); + XUnmapWindow(obt_display, self->close); if (self->label_on) { self->label_width = MAX(1, self->label_width); /* no lower than 1 */ - XMapWindow(ob_display, self->label); - XMoveWindow(ob_display, self->label, self->label_x, + XMapWindow(obt_display, self->label); + XMoveWindow(obt_display, self->label, self->label_x, ob_rr_theme->paddingy); } else - XUnmapWindow(ob_display, self->label); + XUnmapWindow(obt_display, self->label); } ObFrameContext frame_context_from_string(const gchar *name) @@ -1357,7 +1357,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(ob_display, ob_screen)) + if (win == RootWindow(obt_display, ob_screen)) return OB_FRAME_CONTEXT_ROOT ; if (client == NULL) return OB_FRAME_CONTEXT_NONE; if (win == client->window) { @@ -1744,8 +1744,8 @@ static gboolean frame_animate_iconify(gpointer p) if (time == 0) frame_end_iconify_animation(self); else { - XMoveResizeWindow(ob_display, self->window, x, y, w, h); - XFlush(ob_display); + XMoveResizeWindow(obt_display, self->window, x, y, w, h); + XFlush(obt_display); } return time > 0; /* repeat until we're out of time */ @@ -1757,7 +1757,7 @@ void frame_end_iconify_animation(ObFrame *self) if (self->iconify_animation_going == 0) return; if (!self->visible) - XUnmapWindow(ob_display, self->window); + XUnmapWindow(obt_display, self->window); else { /* Send a ConfigureNotify when the animation is done, this fixes KDE's pager showing the window in the wrong place. since the @@ -1770,12 +1770,12 @@ void frame_end_iconify_animation(ObFrame *self) /* we're not animating any more ! */ self->iconify_animation_going = 0; - XMoveResizeWindow(ob_display, self->window, + XMoveResizeWindow(obt_display, self->window, self->area.x, self->area.y, self->area.width, self->area.height); /* we delay re-rendering until after we're done animating */ framerender_frame(self); - XFlush(ob_display); + XFlush(obt_display); } void frame_begin_iconify_animation(ObFrame *self, gboolean iconifying) @@ -1826,6 +1826,6 @@ void frame_begin_iconify_animation(ObFrame *self, gboolean iconifying) /* show it during the animation even if it is not "visible" */ if (!self->visible) - XMapWindow(ob_display, self->window); + XMapWindow(obt_display, self->window); } } diff --git a/openbox/framerender.c b/openbox/framerender.c index af6be016..0b2363cd 100644 --- a/openbox/framerender.c +++ b/openbox/framerender.c @@ -49,67 +49,67 @@ void framerender_frame(ObFrame *self) RrColorPixel(ob_rr_theme->cb_focused_color) : RrColorPixel(ob_rr_theme->cb_unfocused_color)); - XSetWindowBackground(ob_display, self->backback, px); - XClearWindow(ob_display, self->backback); - XSetWindowBackground(ob_display, self->innerleft, px); - XClearWindow(ob_display, self->innerleft); - XSetWindowBackground(ob_display, self->innertop, px); - XClearWindow(ob_display, self->innertop); - XSetWindowBackground(ob_display, self->innerright, px); - XClearWindow(ob_display, self->innerright); - XSetWindowBackground(ob_display, self->innerbottom, px); - XClearWindow(ob_display, self->innerbottom); - XSetWindowBackground(ob_display, self->innerbll, px); - XClearWindow(ob_display, self->innerbll); - XSetWindowBackground(ob_display, self->innerbrr, px); - XClearWindow(ob_display, self->innerbrr); - XSetWindowBackground(ob_display, self->innerblb, px); - XClearWindow(ob_display, self->innerblb); - XSetWindowBackground(ob_display, self->innerbrb, px); - XClearWindow(ob_display, self->innerbrb); + XSetWindowBackground(obt_display, self->backback, px); + XClearWindow(obt_display, self->backback); + XSetWindowBackground(obt_display, self->innerleft, px); + XClearWindow(obt_display, self->innerleft); + XSetWindowBackground(obt_display, self->innertop, px); + XClearWindow(obt_display, self->innertop); + XSetWindowBackground(obt_display, self->innerright, px); + XClearWindow(obt_display, self->innerright); + XSetWindowBackground(obt_display, self->innerbottom, px); + XClearWindow(obt_display, self->innerbottom); + XSetWindowBackground(obt_display, self->innerbll, px); + XClearWindow(obt_display, self->innerbll); + XSetWindowBackground(obt_display, self->innerbrr, px); + XClearWindow(obt_display, self->innerbrr); + XSetWindowBackground(obt_display, self->innerblb, px); + XClearWindow(obt_display, self->innerblb); + XSetWindowBackground(obt_display, self->innerbrb, px); + XClearWindow(obt_display, self->innerbrb); px = (self->focused ? RrColorPixel(ob_rr_theme->frame_focused_border_color) : RrColorPixel(ob_rr_theme->frame_unfocused_border_color)); - XSetWindowBackground(ob_display, self->left, px); - XClearWindow(ob_display, self->left); - XSetWindowBackground(ob_display, self->right, px); - XClearWindow(ob_display, self->right); - - XSetWindowBackground(ob_display, self->titleleft, px); - XClearWindow(ob_display, self->titleleft); - XSetWindowBackground(ob_display, self->titletop, px); - XClearWindow(ob_display, self->titletop); - XSetWindowBackground(ob_display, self->titletopleft, px); - XClearWindow(ob_display, self->titletopleft); - XSetWindowBackground(ob_display, self->titletopright, px); - XClearWindow(ob_display, self->titletopright); - XSetWindowBackground(ob_display, self->titleright, px); - XClearWindow(ob_display, self->titleright); - - XSetWindowBackground(ob_display, self->handleleft, px); - XClearWindow(ob_display, self->handleleft); - XSetWindowBackground(ob_display, self->handletop, px); - XClearWindow(ob_display, self->handletop); - XSetWindowBackground(ob_display, self->handleright, px); - XClearWindow(ob_display, self->handleright); - XSetWindowBackground(ob_display, self->handlebottom, px); - XClearWindow(ob_display, self->handlebottom); - - XSetWindowBackground(ob_display, self->lgripleft, px); - XClearWindow(ob_display, self->lgripleft); - XSetWindowBackground(ob_display, self->lgriptop, px); - XClearWindow(ob_display, self->lgriptop); - XSetWindowBackground(ob_display, self->lgripbottom, px); - XClearWindow(ob_display, self->lgripbottom); - - XSetWindowBackground(ob_display, self->rgripright, px); - XClearWindow(ob_display, self->rgripright); - XSetWindowBackground(ob_display, self->rgriptop, px); - XClearWindow(ob_display, self->rgriptop); - XSetWindowBackground(ob_display, self->rgripbottom, px); - XClearWindow(ob_display, self->rgripbottom); + XSetWindowBackground(obt_display, self->left, px); + XClearWindow(obt_display, self->left); + XSetWindowBackground(obt_display, self->right, px); + XClearWindow(obt_display, self->right); + + XSetWindowBackground(obt_display, self->titleleft, px); + XClearWindow(obt_display, self->titleleft); + XSetWindowBackground(obt_display, self->titletop, px); + XClearWindow(obt_display, self->titletop); + XSetWindowBackground(obt_display, self->titletopleft, px); + XClearWindow(obt_display, self->titletopleft); + XSetWindowBackground(obt_display, self->titletopright, px); + XClearWindow(obt_display, self->titletopright); + XSetWindowBackground(obt_display, self->titleright, px); + XClearWindow(obt_display, self->titleright); + + XSetWindowBackground(obt_display, self->handleleft, px); + XClearWindow(obt_display, self->handleleft); + XSetWindowBackground(obt_display, self->handletop, px); + XClearWindow(obt_display, self->handletop); + XSetWindowBackground(obt_display, self->handleright, px); + XClearWindow(obt_display, self->handleright); + XSetWindowBackground(obt_display, self->handlebottom, px); + XClearWindow(obt_display, self->handlebottom); + + XSetWindowBackground(obt_display, self->lgripleft, px); + XClearWindow(obt_display, self->lgripleft); + XSetWindowBackground(obt_display, self->lgriptop, px); + XClearWindow(obt_display, self->lgriptop); + XSetWindowBackground(obt_display, self->lgripbottom, px); + XClearWindow(obt_display, self->lgripbottom); + + XSetWindowBackground(obt_display, self->rgripright, px); + XClearWindow(obt_display, self->rgripright); + XSetWindowBackground(obt_display, self->rgriptop, px); + XClearWindow(obt_display, self->rgriptop); + XSetWindowBackground(obt_display, self->rgripbottom, px); + XClearWindow(obt_display, self->rgripbottom); /* don't use the separator color for shaded windows */ if (!self->client->shaded) @@ -117,8 +117,8 @@ void framerender_frame(ObFrame *self) RrColorPixel(ob_rr_theme->title_separator_focused_color) : RrColorPixel(ob_rr_theme->title_separator_unfocused_color)); - XSetWindowBackground(ob_display, self->titlebottom, px); - XClearWindow(ob_display, self->titlebottom); + XSetWindowBackground(obt_display, self->titlebottom, px); + XClearWindow(obt_display, self->titlebottom); } if (self->decorations & OB_FRAME_DECOR_TITLEBAR) { @@ -343,7 +343,7 @@ void framerender_frame(ObFrame *self) } } - XFlush(ob_display); + XFlush(obt_display); } static void framerender_label(ObFrame *self, RrAppearance *a) diff --git a/openbox/grab.c b/openbox/grab.c index fea2b62e..bc9d4cca 100644 --- a/openbox/grab.c +++ b/openbox/grab.c @@ -74,7 +74,8 @@ gboolean grab_keyboard_full(gboolean grab) if (grab) { if (kgrabs++ == 0) { - ret = XGrabKeyboard(ob_display, RootWindow(ob_display, ob_screen), + ret = XGrabKeyboard(obt_display, + RootWindow(obt_display, ob_screen), False, GrabModeAsync, GrabModeAsync, event_curtime) == Success; if (!ret) @@ -87,7 +88,7 @@ gboolean grab_keyboard_full(gboolean grab) ret = TRUE; } else if (kgrabs > 0) { if (--kgrabs == 0) { - XUngrabKeyboard(ob_display, ungrab_time()); + XUngrabKeyboard(obt_display, ungrab_time()); } ret = TRUE; } @@ -102,10 +103,10 @@ gboolean grab_pointer_full(gboolean grab, gboolean owner_events, if (grab) { if (pgrabs++ == 0) { - ret = XGrabPointer(ob_display, screen_support_win, owner_events, + ret = XGrabPointer(obt_display, screen_support_win, owner_events, GRAB_PTR_MASK, GrabModeAsync, GrabModeAsync, - (confine ? RootWindow(ob_display, ob_screen) : + (confine ? RootWindow(obt_display, ob_screen) : None), ob_cursor(cur), event_curtime) == Success; if (!ret) @@ -116,7 +117,7 @@ gboolean grab_pointer_full(gboolean grab, gboolean owner_events, ret = TRUE; } else if (pgrabs > 0) { if (--pgrabs == 0) { - XUngrabPointer(ob_display, ungrab_time()); + XUngrabPointer(obt_display, ungrab_time()); } ret = TRUE; } @@ -128,13 +129,13 @@ gint grab_server(gboolean grab) static guint sgrabs = 0; if (grab) { if (sgrabs++ == 0) { - XGrabServer(ob_display); - XSync(ob_display, FALSE); + XGrabServer(obt_display); + XSync(obt_display, FALSE); } } else if (sgrabs > 0) { if (--sgrabs == 0) { - XUngrabServer(ob_display); - XFlush(ob_display); + XUngrabServer(obt_display); + XFlush(obt_display); } } return sgrabs; @@ -177,8 +178,8 @@ void grab_button_full(guint button, guint state, Window win, guint mask, /* can get BadAccess from these */ obt_display_ignore_errors(TRUE); for (i = 0; i < MASK_LIST_SIZE; ++i) - XGrabButton(ob_display, button, state | mask_list[i], win, False, mask, - pointer_mode, GrabModeAsync, None, ob_cursor(cur)); + XGrabButton(obt_display, button, state | mask_list[i], win, False, + mask, pointer_mode, GrabModeAsync, None, ob_cursor(cur)); obt_display_ignore_errors(FALSE); if (obt_display_error_occured) ob_debug("Failed to grab button %d modifiers %d", button, state); @@ -189,7 +190,7 @@ void ungrab_button(guint button, guint state, Window win) guint i; for (i = 0; i < MASK_LIST_SIZE; ++i) - XUngrabButton(ob_display, button, state | mask_list[i], win); + XUngrabButton(obt_display, button, state | mask_list[i], win); } void grab_key(guint keycode, guint state, Window win, gint keyboard_mode) @@ -199,7 +200,7 @@ void grab_key(guint keycode, guint state, Window win, gint keyboard_mode) /* can get BadAccess' from these */ obt_display_ignore_errors(TRUE); for (i = 0; i < MASK_LIST_SIZE; ++i) - XGrabKey(ob_display, keycode, state | mask_list[i], win, FALSE, + XGrabKey(obt_display, keycode, state | mask_list[i], win, FALSE, GrabModeAsync, keyboard_mode); obt_display_ignore_errors(FALSE); if (obt_display_error_occured) @@ -208,7 +209,7 @@ void grab_key(guint keycode, guint state, Window win, gint keyboard_mode) void ungrab_all_keys(Window win) { - XUngrabKey(ob_display, AnyKey, AnyModifier, win); + XUngrabKey(obt_display, AnyKey, AnyModifier, win); } void grab_key_passive_count(int change) @@ -223,7 +224,7 @@ void ungrab_passive_key(void) /*ob_debug("ungrabbing %d passive grabs\n", passive_count);*/ if (passive_count) { /* kill out passive grab */ - XUngrabKeyboard(ob_display, event_curtime); + XUngrabKeyboard(obt_display, event_curtime); passive_count = 0; } } diff --git a/openbox/keyboard.c b/openbox/keyboard.c index 077262a6..57565188 100644 --- a/openbox/keyboard.c +++ b/openbox/keyboard.c @@ -45,20 +45,20 @@ static void grab_keys(gboolean grab) { KeyBindingTree *p; - ungrab_all_keys(RootWindow(ob_display, ob_screen)); + ungrab_all_keys(RootWindow(obt_display, ob_screen)); if (grab) { p = curpos ? curpos->first_child : keyboard_firstnode; while (p) { if (p->key) - grab_key(p->key, p->state, RootWindow(ob_display, ob_screen), + grab_key(p->key, p->state, RootWindow(obt_display, ob_screen), GrabModeAsync); p = p->next_sibling; } if (curpos) grab_key(config_keyboard_reset_keycode, config_keyboard_reset_state, - RootWindow(ob_display, ob_screen), GrabModeAsync); + RootWindow(obt_display, ob_screen), GrabModeAsync); } } diff --git a/openbox/menuframe.c b/openbox/menuframe.c index 18f1a1b7..f8f0a6bc 100644 --- a/openbox/menuframe.c +++ b/openbox/menuframe.c @@ -50,7 +50,7 @@ static void menu_frame_hide(ObMenuFrame *self); static Window createWindow(Window parent, gulong mask, XSetWindowAttributes *attrib) { - return XCreateWindow(ob_display, parent, 0, 0, 1, 1, 0, + return XCreateWindow(obt_display, parent, 0, 0, 1, 1, 0, RrDepth(ob_rr_inst), InputOutput, RrVisual(ob_rr_inst), mask, attrib); } @@ -85,11 +85,11 @@ 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(ob_display, ob_screen), + self->window = createWindow(RootWindow(obt_display, ob_screen), CWEventMask, &attr); - XSetWindowBorderWidth(ob_display, self->window, ob_rr_theme->mbwidth); - XSetWindowBorder(ob_display, self->window, + XSetWindowBorderWidth(obt_display, self->window, ob_rr_theme->mbwidth); + XSetWindowBorder(obt_display, self->window, RrColorPixel(ob_rr_theme->menu_border_color)); self->a_title = RrAppearanceCopy(ob_rr_theme->a_menu_title); @@ -110,7 +110,7 @@ void menu_frame_free(ObMenuFrame *self) stacking_remove(MENU_AS_WINDOW(self)); - XDestroyWindow(ob_display, self->window); + XDestroyWindow(obt_display, self->window); RrAppearanceFree(self->a_items); RrAppearanceFree(self->a_title); @@ -145,8 +145,8 @@ static ObMenuEntryFrame* menu_entry_frame_new(ObMenuEntry *entry, g_hash_table_insert(menu_frame_map, &self->bullet, self); } - XMapWindow(ob_display, self->window); - XMapWindow(ob_display, self->text); + XMapWindow(obt_display, self->window); + XMapWindow(obt_display, self->text); self->a_normal = RrAppearanceCopy(ob_rr_theme->a_menu_normal); self->a_selected = RrAppearanceCopy(ob_rr_theme->a_menu_selected); @@ -187,16 +187,16 @@ static void menu_entry_frame_free(ObMenuEntryFrame *self) if (self) { menu_entry_unref(self->entry); - XDestroyWindow(ob_display, self->text); - XDestroyWindow(ob_display, self->window); + XDestroyWindow(obt_display, self->text); + XDestroyWindow(obt_display, self->window); g_hash_table_remove(menu_frame_map, &self->text); g_hash_table_remove(menu_frame_map, &self->window); if (self->entry->type == OB_MENU_ENTRY_TYPE_NORMAL) { - XDestroyWindow(ob_display, self->icon); + XDestroyWindow(obt_display, self->icon); g_hash_table_remove(menu_frame_map, &self->icon); } if (self->entry->type == OB_MENU_ENTRY_TYPE_SUBMENU) { - XDestroyWindow(ob_display, self->bullet); + XDestroyWindow(obt_display, self->bullet); g_hash_table_remove(menu_frame_map, &self->bullet); } @@ -223,7 +223,7 @@ static void menu_entry_frame_free(ObMenuEntryFrame *self) void menu_frame_move(ObMenuFrame *self, gint x, gint y) { RECT_SET_POINT(self->area, x, y); - XMoveWindow(ob_display, self->window, self->area.x, self->area.y); + XMoveWindow(obt_display, self->window, self->area.x, self->area.y); } static void menu_frame_place_topmenu(ObMenuFrame *self, gint *x, gint *y) @@ -380,7 +380,7 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self) g_assert_not_reached(); } RECT_SET_SIZE(self->area, self->frame->inner_w, th); - XResizeWindow(ob_display, self->window, + XResizeWindow(obt_display, self->window, self->area.width, self->area.height); item_a->surface.parent = self->frame->a_items; item_a->surface.parentx = self->area.x; @@ -434,7 +434,7 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self) switch (self->entry->type) { case OB_MENU_ENTRY_TYPE_NORMAL: - XMoveResizeWindow(ob_display, self->text, + XMoveResizeWindow(obt_display, self->text, self->frame->text_x, PADDING, self->frame->text_w, ITEM_HEIGHT - 2*PADDING); @@ -445,7 +445,7 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self) ITEM_HEIGHT - 2*PADDING); break; case OB_MENU_ENTRY_TYPE_SUBMENU: - XMoveResizeWindow(ob_display, self->text, + XMoveResizeWindow(obt_display, self->text, self->frame->text_x, PADDING, self->frame->text_w - ITEM_HEIGHT, ITEM_HEIGHT - 2*PADDING); @@ -458,7 +458,7 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self) case OB_MENU_ENTRY_TYPE_SEPARATOR: if (self->entry->data.separator.label != NULL) { /* labeled separator */ - XMoveResizeWindow(ob_display, self->text, + XMoveResizeWindow(obt_display, self->text, ob_rr_theme->paddingx, ob_rr_theme->paddingy, self->area.width - 2*ob_rr_theme->paddingx, ob_rr_theme->menu_title_height - @@ -472,7 +472,7 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self) 2*ob_rr_theme->paddingy); } else { /* unlabeled separaator */ - XMoveResizeWindow(ob_display, self->text, PADDING, PADDING, + XMoveResizeWindow(obt_display, self->text, PADDING, PADDING, self->area.width - 2*PADDING, SEPARATOR_HEIGHT); self->a_separator->surface.parent = item_a; self->a_separator->surface.parentx = PADDING; @@ -493,7 +493,7 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self) if (self->entry->type == OB_MENU_ENTRY_TYPE_NORMAL && self->entry->data.normal.icon_data) { - XMoveResizeWindow(ob_display, self->icon, + XMoveResizeWindow(obt_display, self->icon, PADDING, frame->item_margin.top, ITEM_HEIGHT - frame->item_margin.top - frame->item_margin.bottom, @@ -515,13 +515,13 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self) - frame->item_margin.bottom, ITEM_HEIGHT - frame->item_margin.top - frame->item_margin.bottom); - XMapWindow(ob_display, self->icon); + XMapWindow(obt_display, self->icon); } else if (self->entry->type == OB_MENU_ENTRY_TYPE_NORMAL && self->entry->data.normal.mask) { RrColor *c; - XMoveResizeWindow(ob_display, self->icon, + XMoveResizeWindow(obt_display, self->icon, PADDING, frame->item_margin.top, ITEM_HEIGHT - frame->item_margin.top - frame->item_margin.bottom, @@ -550,13 +550,13 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self) - frame->item_margin.bottom, ITEM_HEIGHT - frame->item_margin.top - frame->item_margin.bottom); - XMapWindow(ob_display, self->icon); + XMapWindow(obt_display, self->icon); } else - XUnmapWindow(ob_display, self->icon); + XUnmapWindow(obt_display, self->icon); if (self->entry->type == OB_MENU_ENTRY_TYPE_SUBMENU) { RrAppearance *bullet_a; - XMoveResizeWindow(ob_display, self->bullet, + XMoveResizeWindow(obt_display, self->bullet, self->frame->text_x + self->frame->text_w - ITEM_HEIGHT + PADDING, PADDING, ITEM_HEIGHT - 2*PADDING, @@ -571,11 +571,11 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self) RrPaint(bullet_a, self->bullet, ITEM_HEIGHT - 2*PADDING, ITEM_HEIGHT - 2*PADDING); - XMapWindow(ob_display, self->bullet); + XMapWindow(obt_display, self->bullet); } else - XUnmapWindow(ob_display, self->bullet); + XUnmapWindow(obt_display, self->bullet); - XFlush(ob_display); + XFlush(obt_display); } /*! this code is taken from the menu_frame_render. if that changes, this won't @@ -693,10 +693,10 @@ void menu_frame_render(ObMenuFrame *self) } RECT_SET_POINT(e->area, 0, h+e->border); - XMoveWindow(ob_display, e->window, + XMoveWindow(obt_display, e->window, e->area.x-e->border, e->area.y-e->border); - XSetWindowBorderWidth(ob_display, e->window, e->border); - XSetWindowBorder(ob_display, e->window, + XSetWindowBorderWidth(obt_display, e->window, e->border); + XSetWindowBorder(obt_display, e->window, RrColorPixel(ob_rr_theme->menu_border_color)); @@ -775,7 +775,7 @@ void menu_frame_render(ObMenuFrame *self) if (!w) w = 10; if (!h) h = 3; - XResizeWindow(ob_display, self->window, w, h); + XResizeWindow(obt_display, self->window, w, h); self->inner_w = w; @@ -789,7 +789,7 @@ void menu_frame_render(ObMenuFrame *self) RECT_SET_SIZE(self->area, w, h); - XFlush(ob_display); + XFlush(obt_display); } static void menu_frame_update(ObMenuFrame *self) @@ -971,7 +971,7 @@ gboolean menu_frame_show_topmenu(ObMenuFrame *self, gint x, gint y, menu_frame_move(self, x, y); - XMapWindow(ob_display, self->window); + XMapWindow(obt_display, self->window); if (screen_pointer_pos(&px, &py)) { ObMenuEntryFrame *e = menu_entry_frame_under(px, py); @@ -1014,7 +1014,7 @@ gboolean menu_frame_show_submenu(ObMenuFrame *self, ObMenuFrame *parent, } menu_frame_move(self, x + dx, y + dy); - XMapWindow(ob_display, self->window); + XMapWindow(obt_display, self->window); if (screen_pointer_pos(&px, &py)) { ObMenuEntryFrame *e = menu_entry_frame_under(px, py); @@ -1051,7 +1051,7 @@ static void menu_frame_hide(ObMenuFrame *self) ungrab_keyboard(); } - XUnmapWindow(ob_display, self->window); + XUnmapWindow(obt_display, self->window); menu_frame_free(self); } diff --git a/openbox/modkeys.c b/openbox/modkeys.c index 9e8da321..3ac70c13 100644 --- a/openbox/modkeys.c +++ b/openbox/modkeys.c @@ -54,11 +54,11 @@ void modkeys_startup(gboolean reconfigure) for (i = 0; i < OB_MODKEY_NUM_KEYS; ++i) modkeys_keys[i] = 0; - modmap = XGetModifierMapping(ob_display); + modmap = XGetModifierMapping(obt_display); g_assert(modmap->max_keypermod > 0); - XDisplayKeycodes(ob_display, &min_keycode, &max_keycode); - keymap = XGetKeyboardMapping(ob_display, min_keycode, + XDisplayKeycodes(obt_display, &min_keycode, &max_keycode); + keymap = XGetKeyboardMapping(obt_display, min_keycode, max_keycode - min_keycode + 1, &keysyms_per_keycode); diff --git a/openbox/mouse.c b/openbox/mouse.c index 5a9fe170..56553c7d 100644 --- a/openbox/mouse.c +++ b/openbox/mouse.c @@ -237,7 +237,7 @@ void mouse_event(ObClient *client, XEvent *e) if (CLIENT_CONTEXT(context, client)) { /* Replay the event, so it goes to the client*/ - XAllowEvents(ob_display, ReplayPointer, event_curtime); + XAllowEvents(obt_display, ReplayPointer, event_curtime); /* Fall through to the release case! */ } else break; @@ -258,7 +258,7 @@ void mouse_event(ObClient *client, XEvent *e) guint ujunk, b, w, h; /* this can cause errors to occur when the window closes */ obt_display_ignore_errors(TRUE); - junk1 = XGetGeometry(ob_display, e->xbutton.window, + junk1 = XGetGeometry(obt_display, e->xbutton.window, &wjunk, &junk1, &junk2, &w, &h, &b, &ujunk); obt_display_ignore_errors(FALSE); if (junk1) { diff --git a/openbox/moveresize.c b/openbox/moveresize.c index ed70899c..7bfee102 100644 --- a/openbox/moveresize.c +++ b/openbox/moveresize.c @@ -261,7 +261,7 @@ void moveresize_start(ObClient *c, gint x, gint y, guint b, guint32 cnr) /* set the counter to an initial value */ XSyncIntToValue(&val, 0); - XSyncSetCounter(ob_display, moveresize_client->sync_counter, val); + XSyncSetCounter(obt_display, moveresize_client->sync_counter, val); /* this will be incremented when we tell the client what we're looking for */ @@ -277,7 +277,7 @@ void moveresize_start(ObClient *c, gint x, gint y, guint b, guint32 cnr) aa.trigger.test_type = XSyncPositiveTransition; aa.events = True; XSyncIntToValue(&aa.delta, 1); - moveresize_alarm = XSyncCreateAlarm(ob_display, + moveresize_alarm = XSyncCreateAlarm(obt_display, XSyncCACounter | XSyncCAValue | XSyncCAValueType | @@ -306,7 +306,7 @@ void moveresize_end(gboolean cancel) #ifdef SYNC /* turn off the alarm */ if (moveresize_alarm != None) { - XSyncDestroyAlarm(ob_display, moveresize_alarm); + XSyncDestroyAlarm(obt_display, moveresize_alarm); moveresize_alarm = None; } @@ -382,7 +382,7 @@ static void do_resize(void) /* tell the client what we're waiting for */ ce.xclient.type = ClientMessage; ce.xclient.message_type = prop_atoms.wm_protocols; - ce.xclient.display = ob_display; + ce.xclient.display = obt_display; ce.xclient.window = moveresize_client->window; ce.xclient.format = 32; ce.xclient.data.l[0] = prop_atoms.net_wm_sync_request; @@ -390,7 +390,7 @@ static void do_resize(void) ce.xclient.data.l[2] = XSyncValueLow32(val); ce.xclient.data.l[3] = XSyncValueHigh32(val); ce.xclient.data.l[4] = 0l; - XSendEvent(ob_display, moveresize_client->window, FALSE, + XSendEvent(obt_display, moveresize_client->window, FALSE, NoEventMask, &ce); waiting_for_sync = TRUE; @@ -632,12 +632,12 @@ static void move_with_keys(gint keycode, gint state) } screen_pointer_pos(&opx, &opy); - XWarpPointer(ob_display, None, None, 0, 0, 0, 0, dx, dy); + XWarpPointer(obt_display, None, None, 0, 0, 0, 0, dx, dy); /* steal the motion events this causes */ - XSync(ob_display, FALSE); + XSync(obt_display, FALSE); { XEvent ce; - while (XCheckTypedEvent(ob_display, MotionNotify, &ce)); + while (XCheckTypedEvent(obt_display, MotionNotify, &ce)); } screen_pointer_pos(&px, &py); @@ -789,12 +789,12 @@ static void resize_with_keys(gint keycode, gint state) pdy = dh; screen_pointer_pos(&opx, &opy); - XWarpPointer(ob_display, None, None, 0, 0, 0, 0, pdx, pdy); + XWarpPointer(obt_display, None, None, 0, 0, 0, 0, pdx, pdy); /* steal the motion events this causes */ - XSync(ob_display, FALSE); + XSync(obt_display, FALSE); { XEvent ce; - while (XCheckTypedEvent(ob_display, MotionNotify, &ce)); + while (XCheckTypedEvent(obt_display, MotionNotify, &ce)); } screen_pointer_pos(&px, &py); diff --git a/openbox/openbox.c b/openbox/openbox.c index 79b30c0d..ce866ae0 100644 --- a/openbox/openbox.c +++ b/openbox/openbox.c @@ -85,7 +85,6 @@ RrInstance *ob_rr_inst; RrTheme *ob_rr_theme; ObtMainLoop *ob_main_loop; -Display *ob_display; gint ob_screen; gboolean ob_replace_wm = FALSE; gboolean ob_sm_use = TRUE; @@ -144,7 +143,6 @@ gint main(gint argc, gchar **argv) if (!obt_display_open(NULL)) ob_exit_with_error(_("Failed to open the display from the DISPLAY environment variable.")); - ob_display = obt_display; if (remote_control) { prop_startup(); @@ -152,13 +150,13 @@ gint main(gint argc, gchar **argv) /* Send client message telling the OB process to: * remote_control = 1 -> reconfigure * remote_control = 2 -> restart */ - PROP_MSG(RootWindow(ob_display, ob_screen), + PROP_MSG(RootWindow(obt_display, ob_screen), ob_control, remote_control, 0, 0, 0); - obt_display_close(ob_display); + obt_display_close(obt_display); exit(EXIT_SUCCESS); } - ob_main_loop = obt_main_loop_new(ob_display); + ob_main_loop = obt_main_loop_new(obt_display); /* set up signal handler */ obt_main_loop_signal_add(ob_main_loop, SIGUSR1, signal_handler, NULL,NULL); @@ -169,13 +167,13 @@ gint main(gint argc, gchar **argv) obt_main_loop_signal_add(ob_main_loop, SIGPIPE, signal_handler, NULL,NULL); obt_main_loop_signal_add(ob_main_loop, SIGCHLD, signal_handler, NULL,NULL); - ob_screen = DefaultScreen(ob_display); + ob_screen = DefaultScreen(obt_display); - ob_rr_inst = RrInstanceNew(ob_display, ob_screen); + ob_rr_inst = RrInstanceNew(obt_display, ob_screen); if (ob_rr_inst == NULL) ob_exit_with_error(_("Failed to initialize the obrender library.")); - XSynchronize(ob_display, xsync); + XSynchronize(obt_display, xsync); /* check for locale support */ if (!XSupportsLocale()) @@ -185,7 +183,7 @@ gint main(gint argc, gchar **argv) /* set the DISPLAY environment variable for any lauched children, to the display we're using, so they open in the right place. */ - putenv(g_strdup_printf("DISPLAY=%s", DisplayString(ob_display))); + putenv(g_strdup_printf("DISPLAY=%s", DisplayString(obt_display))); /* create available cursors */ cursors[OB_CURSOR_NONE] = None; @@ -243,7 +241,7 @@ gint main(gint argc, gchar **argv) /* if (config_type != NULL) - PROP_SETS(RootWindow(ob_display, ob_screen), + PROP_SETS(RootWindow(obt_display, ob_screen), ob_config, config_type); */ @@ -267,7 +265,7 @@ gint main(gint argc, gchar **argv) if (ob_rr_theme == NULL) ob_exit_with_error(_("Unable to load a theme.")); - PROP_SETS(RootWindow(ob_display, ob_screen), + PROP_SETS(RootWindow(obt_display, ob_screen), ob_theme, ob_rr_theme->name); } @@ -310,7 +308,7 @@ gint main(gint argc, gchar **argv) focus_nothing(); /* focus what was focused if a wm was already running */ - if (PROP_GET32(RootWindow(ob_display, ob_screen), + if (PROP_GET32(RootWindow(obt_display, ob_screen), net_active_window, window, &xid) && (w = g_hash_table_lookup(window_map, &xid)) && WINDOW_IS_CLIENT(w)) @@ -369,14 +367,14 @@ gint main(gint argc, gchar **argv) } while (reconfigure); } - XSync(ob_display, FALSE); + XSync(obt_display, FALSE); RrThemeFree(ob_rr_theme); RrInstanceFree(ob_rr_inst); session_shutdown(being_replaced); - obt_display_close(ob_display); + obt_display_close(obt_display); parse_paths_shutdown(); @@ -602,10 +600,10 @@ static Cursor load_cursor(const gchar *name, guint fontval) Cursor c = None; #if USE_XCURSOR - c = XcursorLibraryLoadCursor(ob_display, name); + c = XcursorLibraryLoadCursor(obt_display, name); #endif if (c == None) - c = XCreateFontCursor(ob_display, fontval); + c = XCreateFontCursor(obt_display, fontval); return c; } diff --git a/openbox/openbox.h b/openbox/openbox.h index 7c38e20f..47d92042 100644 --- a/openbox/openbox.h +++ b/openbox/openbox.h @@ -24,6 +24,7 @@ #include "render/render.h" #include "render/theme.h" #include "obt/mainloop.h" +#include "obt/display.h" #include #include @@ -33,9 +34,6 @@ extern RrTheme *ob_rr_theme; extern ObtMainLoop *ob_main_loop; -/*! The X display */ -extern Display *ob_display; - /*! The number of the screen on which we're running */ extern gint ob_screen; diff --git a/openbox/popup.c b/openbox/popup.c index 979a896d..13465d3f 100644 --- a/openbox/popup.c +++ b/openbox/popup.c @@ -41,20 +41,20 @@ ObPopup *popup_new(void) self->iconwm = self->iconhm = 1; attrib.override_redirect = True; - self->bg = XCreateWindow(ob_display, RootWindow(ob_display, ob_screen), + self->bg = XCreateWindow(obt_display, RootWindow(obt_display, ob_screen), 0, 0, 1, 1, 0, RrDepth(ob_rr_inst), InputOutput, RrVisual(ob_rr_inst), CWOverrideRedirect, &attrib); - self->text = XCreateWindow(ob_display, self->bg, + self->text = XCreateWindow(obt_display, self->bg, 0, 0, 1, 1, 0, RrDepth(ob_rr_inst), InputOutput, RrVisual(ob_rr_inst), 0, NULL); - XSetWindowBorderWidth(ob_display, self->bg, ob_rr_theme->obwidth); - XSetWindowBorder(ob_display, self->bg, + XSetWindowBorderWidth(obt_display, self->bg, ob_rr_theme->obwidth); + XSetWindowBorder(obt_display, self->bg, RrColorPixel(ob_rr_theme->osd_border_color)); - XMapWindow(ob_display, self->text); + XMapWindow(obt_display, self->text); stacking_add(INTERNAL_AS_WINDOW(self)); g_hash_table_insert(window_map, &self->bg, self); @@ -64,8 +64,8 @@ ObPopup *popup_new(void) void popup_free(ObPopup *self) { if (self) { - XDestroyWindow(ob_display, self->bg); - XDestroyWindow(ob_display, self->text); + XDestroyWindow(obt_display, self->bg); + XDestroyWindow(obt_display, self->text); RrAppearanceFree(self->a_bg); RrAppearanceFree(self->a_text); g_hash_table_remove(window_map, &self->bg); @@ -140,7 +140,7 @@ static gboolean popup_show_timeout(gpointer data) { ObPopup *self = data; - XMapWindow(ob_display, self->bg); + XMapWindow(obt_display, self->bg); stacking_raise(INTERNAL_AS_WINDOW(self)); self->mapped = TRUE; self->delay_mapped = FALSE; @@ -268,7 +268,7 @@ void popup_delay_show(ObPopup *self, gulong usec, gchar *text) } /* set the windows/appearances up */ - XMoveResizeWindow(ob_display, self->bg, x, y, w, h); + XMoveResizeWindow(obt_display, self->bg, x, y, w, h); /* when there is no icon and the text is not parent relative, then fill the whole dialog with the text appearance, don't use the bg at all */ @@ -279,7 +279,7 @@ void popup_delay_show(ObPopup *self, gulong usec, gchar *text) self->a_text->surface.parent = self->a_bg; self->a_text->surface.parentx = textx; self->a_text->surface.parenty = texty; - XMoveResizeWindow(ob_display, self->text, textx, texty, textw, texth); + XMoveResizeWindow(obt_display, self->text, textx, texty, textw, texth); RrPaint(self->a_text, self->text, textw, texth); } @@ -312,7 +312,7 @@ void popup_hide(ObPopup *self) /* kill enter events cause by this unmapping */ ignore_start = event_start_ignore_all_enters(); - XUnmapWindow(ob_display, self->bg); + XUnmapWindow(obt_display, self->bg); self->mapped = FALSE; event_end_ignore_all_enters(ignore_start); @@ -329,7 +329,7 @@ static void icon_popup_draw_icon(gint x, gint y, gint w, gint h, gpointer data) self->a_icon->surface.parent = self->popup->a_bg; self->a_icon->surface.parentx = x; self->a_icon->surface.parenty = y; - XMoveResizeWindow(ob_display, self->icon, x, y, w, h); + XMoveResizeWindow(obt_display, self->icon, x, y, w, h); RrPaint(self->a_icon, self->icon, w, h); } @@ -340,11 +340,11 @@ ObIconPopup *icon_popup_new(void) self = g_new0(ObIconPopup, 1); self->popup = popup_new(); self->a_icon = RrAppearanceCopy(ob_rr_theme->a_clear_tex); - self->icon = XCreateWindow(ob_display, self->popup->bg, + self->icon = XCreateWindow(obt_display, self->popup->bg, 0, 0, 1, 1, 0, RrDepth(ob_rr_inst), InputOutput, RrVisual(ob_rr_inst), 0, NULL); - XMapWindow(ob_display, self->icon); + XMapWindow(obt_display, self->icon); self->popup->hasicon = TRUE; self->popup->draw_icon = icon_popup_draw_icon; @@ -356,7 +356,7 @@ ObIconPopup *icon_popup_new(void) void icon_popup_free(ObIconPopup *self) { if (self) { - XDestroyWindow(ob_display, self->icon); + XDestroyWindow(obt_display, self->icon); RrAppearanceFree(self->a_icon); popup_free(self->popup); g_free(self); @@ -481,7 +481,7 @@ static void pager_popup_draw_icon(gint px, gint py, gint w, gint h, a->surface.parent = self->popup->a_bg; a->surface.parentx = x + px; a->surface.parenty = y + py; - XMoveResizeWindow(ob_display, self->wins[n], + XMoveResizeWindow(obt_display, self->wins[n], x + px, y + py, eachw, eachh); RrPaint(a, self->wins[n], eachw, eachh); } @@ -516,7 +516,7 @@ void pager_popup_free(ObPagerPopup *self) guint i; for (i = 0; i < self->desks; ++i) - XDestroyWindow(ob_display, self->wins[i]); + XDestroyWindow(obt_display, self->wins[i]); g_free(self->wins); RrAppearanceFree(self->hilight); RrAppearanceFree(self->unhilight); @@ -532,7 +532,7 @@ void pager_popup_delay_show(ObPagerPopup *self, gulong usec, if (screen_num_desktops < self->desks) for (i = screen_num_desktops; i < self->desks; ++i) - XDestroyWindow(ob_display, self->wins[i]); + XDestroyWindow(obt_display, self->wins[i]); if (screen_num_desktops != self->desks) self->wins = g_renew(Window, self->wins, screen_num_desktops); @@ -543,12 +543,12 @@ void pager_popup_delay_show(ObPagerPopup *self, gulong usec, attr.border_pixel = RrColorPixel(ob_rr_theme->osd_border_color); - self->wins[i] = XCreateWindow(ob_display, self->popup->bg, + self->wins[i] = XCreateWindow(obt_display, self->popup->bg, 0, 0, 1, 1, ob_rr_theme->obwidth, RrDepth(ob_rr_inst), InputOutput, RrVisual(ob_rr_inst), CWBorderPixel, &attr); - XMapWindow(ob_display, self->wins[i]); + XMapWindow(obt_display, self->wins[i]); } self->desks = screen_num_desktops; diff --git a/openbox/prop.c b/openbox/prop.c index c4b8baea..3f58db14 100644 --- a/openbox/prop.c +++ b/openbox/prop.c @@ -25,7 +25,7 @@ Atoms prop_atoms; #define CREATE(var, name) (prop_atoms.var = \ - XInternAtom(ob_display, name, FALSE)) + XInternAtom(obt_display, name, FALSE)) void prop_startup(void) { @@ -218,7 +218,7 @@ static gboolean get_prealloc(Window win, Atom prop, Atom type, gint size, gulong ret_items, bytes_left; glong num32 = 32 / size * num; /* num in 32-bit elements */ - res = XGetWindowProperty(ob_display, win, prop, 0l, num32, + res = XGetWindowProperty(obt_display, win, prop, 0l, num32, FALSE, type, &ret_type, &ret_size, &ret_items, &bytes_left, &xdata); if (res == Success && ret_items && xdata) { @@ -255,7 +255,7 @@ static gboolean get_all(Window win, Atom prop, Atom type, gint size, gint ret_size; gulong ret_items, bytes_left; - res = XGetWindowProperty(ob_display, win, prop, 0l, G_MAXLONG, + res = XGetWindowProperty(obt_display, win, prop, 0l, G_MAXLONG, FALSE, type, &ret_type, &ret_size, &ret_items, &bytes_left, &xdata); if (res == Success) { @@ -290,7 +290,7 @@ static gboolean get_stringlist(Window win, Atom prop, gchar ***list, gint *nstr) XTextProperty tprop; gboolean ret = FALSE; - if (XGetTextProperty(ob_display, win, &tprop, prop) && tprop.nitems) { + if (XGetTextProperty(obt_display, win, &tprop, prop) && tprop.nitems) { if (XTextPropertyToStringList(&tprop, list, nstr)) ret = TRUE; XFree(tprop.value); @@ -407,20 +407,20 @@ gboolean prop_get_strings_utf8(Window win, Atom prop, gchar ***ret) void prop_set32(Window win, Atom prop, Atom type, gulong val) { - XChangeProperty(ob_display, win, prop, type, 32, PropModeReplace, + XChangeProperty(obt_display, win, prop, type, 32, PropModeReplace, (guchar*)&val, 1); } void prop_set_array32(Window win, Atom prop, Atom type, gulong *val, guint num) { - XChangeProperty(ob_display, win, prop, type, 32, PropModeReplace, + XChangeProperty(obt_display, win, prop, type, 32, PropModeReplace, (guchar*)val, num); } void prop_set_string_utf8(Window win, Atom prop, const gchar *val) { - XChangeProperty(ob_display, win, prop, prop_atoms.utf8, 8, + XChangeProperty(obt_display, win, prop, prop_atoms.utf8, 8, PropModeReplace, (const guchar*)val, strlen(val)); } @@ -434,20 +434,20 @@ void prop_set_strings_utf8(Window win, Atom prop, gchar **strs) str = g_string_append(str, *s); str = g_string_append_c(str, '\0'); } - XChangeProperty(ob_display, win, prop, prop_atoms.utf8, 8, + XChangeProperty(obt_display, win, prop, prop_atoms.utf8, 8, PropModeReplace, (guchar*)str->str, str->len); g_string_free(str, TRUE); } void prop_erase(Window win, Atom prop) { - XDeleteProperty(ob_display, win, prop); + XDeleteProperty(obt_display, win, prop); } void prop_message(Window about, Atom messagetype, glong data0, glong data1, glong data2, glong data3, glong mask) { - prop_message_to(RootWindow(ob_display, ob_screen), about, messagetype, + prop_message_to(RootWindow(obt_display, ob_screen), about, messagetype, data0, data1, data2, data3, 0, mask); } @@ -458,7 +458,7 @@ void prop_message_to(Window to, Window about, Atom messagetype, XEvent ce; ce.xclient.type = ClientMessage; ce.xclient.message_type = messagetype; - ce.xclient.display = ob_display; + ce.xclient.display = obt_display; ce.xclient.window = about; ce.xclient.format = 32; ce.xclient.data.l[0] = data0; @@ -466,5 +466,5 @@ void prop_message_to(Window to, Window about, Atom messagetype, ce.xclient.data.l[2] = data2; ce.xclient.data.l[3] = data3; ce.xclient.data.l[4] = data4; - XSendEvent(ob_display, to, FALSE, mask, &ce); + XSendEvent(obt_display, to, FALSE, mask, &ce); } diff --git a/openbox/screen.c b/openbox/screen.c index e8a175d1..d89bf856 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -90,10 +90,10 @@ static gboolean replace_wm(void) Time timestamp; wm_sn = g_strdup_printf("WM_S%d", ob_screen); - wm_sn_atom = XInternAtom(ob_display, wm_sn, FALSE); + wm_sn_atom = XInternAtom(obt_display, wm_sn, FALSE); g_free(wm_sn); - current_wm_sn_owner = XGetSelectionOwner(ob_display, wm_sn_atom); + current_wm_sn_owner = XGetSelectionOwner(obt_display, wm_sn_atom); if (current_wm_sn_owner == screen_support_win) current_wm_sn_owner = None; if (current_wm_sn_owner) { @@ -105,8 +105,8 @@ static gboolean replace_wm(void) obt_display_ignore_errors(TRUE); /* We want to find out when the current selection owner dies */ - XSelectInput(ob_display, current_wm_sn_owner, StructureNotifyMask); - XSync(ob_display, FALSE); + XSelectInput(obt_display, current_wm_sn_owner, StructureNotifyMask); + XSync(obt_display, FALSE); obt_display_ignore_errors(FALSE); if (obt_display_error_occured) @@ -115,10 +115,10 @@ static gboolean replace_wm(void) timestamp = event_get_server_time(); - XSetSelectionOwner(ob_display, wm_sn_atom, screen_support_win, + XSetSelectionOwner(obt_display, wm_sn_atom, screen_support_win, timestamp); - if (XGetSelectionOwner(ob_display, wm_sn_atom) != screen_support_win) { + if (XGetSelectionOwner(obt_display, wm_sn_atom) != screen_support_win) { g_message(_("Could not acquire window manager selection on screen %d"), ob_screen); return FALSE; @@ -131,7 +131,7 @@ static gboolean replace_wm(void) const gulong timeout = G_USEC_PER_SEC * 15; /* wait for 15s max */ while (wait < timeout) { - if (XCheckWindowEvent(ob_display, current_wm_sn_owner, + if (XCheckWindowEvent(obt_display, current_wm_sn_owner, StructureNotifyMask, &event) && event.type == DestroyNotify) break; @@ -146,7 +146,7 @@ static gboolean replace_wm(void) } /* Send client message indicating that we are now the WM */ - prop_message(RootWindow(ob_display, ob_screen), prop_atoms.manager, + prop_message(RootWindow(obt_display, ob_screen), prop_atoms.manager, timestamp, wm_sn_atom, screen_support_win, 0, SubstructureNotifyMask); @@ -164,30 +164,30 @@ gboolean screen_annex(void) /* create the netwm support window */ attrib.override_redirect = TRUE; attrib.event_mask = PropertyChangeMask; - screen_support_win = XCreateWindow(ob_display, - RootWindow(ob_display, ob_screen), + screen_support_win = XCreateWindow(obt_display, + RootWindow(obt_display, ob_screen), -100, -100, 1, 1, 0, CopyFromParent, InputOutput, CopyFromParent, CWEventMask | CWOverrideRedirect, &attrib); - XMapWindow(ob_display, screen_support_win); - XLowerWindow(ob_display, screen_support_win); + XMapWindow(obt_display, screen_support_win); + XLowerWindow(obt_display, screen_support_win); if (!replace_wm()) { - XDestroyWindow(ob_display, screen_support_win); + XDestroyWindow(obt_display, screen_support_win); return FALSE; } obt_display_ignore_errors(TRUE); - XSelectInput(ob_display, RootWindow(ob_display, ob_screen), + XSelectInput(obt_display, RootWindow(obt_display, 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"), ob_screen); - XDestroyWindow(ob_display, screen_support_win); + XDestroyWindow(obt_display, screen_support_win); return FALSE; } @@ -195,11 +195,11 @@ gboolean screen_annex(void) /* set the OPENBOX_PID hint */ pid = getpid(); - PROP_SET32(RootWindow(ob_display, ob_screen), + PROP_SET32(RootWindow(obt_display, ob_screen), openbox_pid, cardinal, pid); /* set supporting window */ - PROP_SET32(RootWindow(ob_display, ob_screen), + PROP_SET32(RootWindow(obt_display, ob_screen), net_supporting_wm_check, window, screen_support_win); /* set properties on the supporting window */ @@ -300,7 +300,7 @@ gboolean screen_annex(void) supported[i++] = prop_atoms.ob_control; g_assert(i == num_support); - PROP_SETA32(RootWindow(ob_display, ob_screen), + PROP_SETA32(RootWindow(obt_display, ob_screen), net_supported, atom, supported, num_support); g_free(supported); @@ -333,13 +333,13 @@ static void screen_tell_ksplash(void) hear it anyways. perhaps it is for old ksplash. or new ksplash. or something. oh well. */ e.xclient.type = ClientMessage; - e.xclient.display = ob_display; - e.xclient.window = RootWindow(ob_display, ob_screen); + e.xclient.display = obt_display; + e.xclient.window = RootWindow(obt_display, ob_screen); e.xclient.message_type = - XInternAtom(ob_display, "_KDE_SPLASH_PROGRESS", False ); + XInternAtom(obt_display, "_KDE_SPLASH_PROGRESS", False ); e.xclient.format = 8; strcpy(e.xclient.data.b, "wm started"); - XSendEvent(ob_display, RootWindow(ob_display, ob_screen), + XSendEvent(obt_display, RootWindow(obt_display, ob_screen), False, SubstructureNotifyMask, &e ); } @@ -364,7 +364,7 @@ void screen_startup(gboolean reconfig) screen_resize(); /* have names already been set for the desktops? */ - if (PROP_GETSS(RootWindow(ob_display, ob_screen), + if (PROP_GETSS(RootWindow(obt_display, ob_screen), net_desktop_names, utf8, &names)) { g_strfreev(names); @@ -387,7 +387,8 @@ void screen_startup(gboolean reconfig) names[i] = g_strdup(it->data); /* set the root window property */ - PROP_SETSS(RootWindow(ob_display, ob_screen), net_desktop_names,names); + PROP_SETSS(RootWindow(obt_display, ob_screen), + net_desktop_names,names); g_strfreev(names); } @@ -397,7 +398,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 (PROP_GET32(RootWindow(ob_display, ob_screen), + if (PROP_GET32(RootWindow(obt_display, ob_screen), net_number_of_desktops, cardinal, &d)) screen_set_num_desktops(d); /* restore from session if possible */ @@ -408,7 +409,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 (PROP_GET32(RootWindow(ob_display, ob_screen), + if (PROP_GET32(RootWindow(obt_display, ob_screen), net_current_desktop, cardinal, &d) && d < screen_num_desktops) { @@ -423,7 +424,7 @@ void screen_startup(gboolean reconfig) /* don't start in showing-desktop mode */ screen_showing_desktop = FALSE; - PROP_SET32(RootWindow(ob_display, ob_screen), + PROP_SET32(RootWindow(obt_display, ob_screen), net_showing_desktop, cardinal, screen_showing_desktop); if (session_desktop_layout_present && @@ -442,17 +443,17 @@ void screen_shutdown(gboolean reconfig) if (reconfig) return; - XSelectInput(ob_display, RootWindow(ob_display, ob_screen), + XSelectInput(obt_display, RootWindow(obt_display, ob_screen), NoEventMask); /* we're not running here no more! */ - PROP_ERASE(RootWindow(ob_display, ob_screen), openbox_pid); + PROP_ERASE(RootWindow(obt_display, ob_screen), openbox_pid); /* not without us */ - PROP_ERASE(RootWindow(ob_display, ob_screen), net_supported); + PROP_ERASE(RootWindow(obt_display, ob_screen), net_supported); /* don't keep this mode */ - PROP_ERASE(RootWindow(ob_display, ob_screen), net_showing_desktop); + PROP_ERASE(RootWindow(obt_display, ob_screen), net_showing_desktop); - XDestroyWindow(ob_display, screen_support_win); + XDestroyWindow(obt_display, screen_support_win); g_strfreev(screen_desktop_names); screen_desktop_names = NULL; @@ -465,8 +466,8 @@ void screen_resize(void) GList *it; gulong geometry[2]; - w = WidthOfScreen(ScreenOfDisplay(ob_display, ob_screen)); - h = HeightOfScreen(ScreenOfDisplay(ob_display, ob_screen)); + w = WidthOfScreen(ScreenOfDisplay(obt_display, ob_screen)); + h = HeightOfScreen(ScreenOfDisplay(obt_display, ob_screen)); if (w == oldw && h == oldh) return; @@ -475,7 +476,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; - PROP_SETA32(RootWindow(ob_display, ob_screen), + PROP_SETA32(RootWindow(obt_display, ob_screen), net_desktop_geometry, cardinal, geometry, 2); if (ob_state() == OB_STATE_STARTING) @@ -500,12 +501,12 @@ void screen_set_num_desktops(guint num) old = screen_num_desktops; screen_num_desktops = num; - PROP_SET32(RootWindow(ob_display, ob_screen), + PROP_SET32(RootWindow(obt_display, ob_screen), net_number_of_desktops, cardinal, num); /* set the viewport hint */ viewport = g_new0(gulong, num * 2); - PROP_SETA32(RootWindow(ob_display, ob_screen), + PROP_SETA32(RootWindow(obt_display, ob_screen), net_desktop_viewport, cardinal, viewport, num * 2); g_free(viewport); @@ -601,7 +602,7 @@ void screen_set_desktop(guint num, gboolean dofocus) if (previous == num) return; - PROP_SET32(RootWindow(ob_display, ob_screen), + PROP_SET32(RootWindow(obt_display, ob_screen), net_current_desktop, cardinal, num); /* This whole thing decides when/how to save the screen_last_desktop so @@ -1091,7 +1092,7 @@ void screen_update_layout(void) screen_desktop_layout.rows = 1; screen_desktop_layout.columns = screen_num_desktops; - if (PROP_GETA32(RootWindow(ob_display, ob_screen), + if (PROP_GETA32(RootWindow(obt_display, ob_screen), net_desktop_layout, cardinal, &data, &num)) { if (num == 3 || num == 4) { @@ -1136,7 +1137,7 @@ void screen_update_desktop_names(void) g_strfreev(screen_desktop_names); screen_desktop_names = NULL; - if (PROP_GETSS(RootWindow(ob_display, ob_screen), + if (PROP_GETSS(RootWindow(obt_display, ob_screen), net_desktop_names, utf8, &screen_desktop_names)) for (i = 0; screen_desktop_names[i] && i < screen_num_desktops; ++i); else @@ -1163,7 +1164,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 */ - PROP_SETSS(RootWindow(ob_display, ob_screen), net_desktop_names, + PROP_SETSS(RootWindow(obt_display, ob_screen), net_desktop_names, screen_desktop_names); } @@ -1231,7 +1232,7 @@ void screen_show_desktop(gboolean show, ObClient *show_only) } show = !!show; /* make it boolean */ - PROP_SET32(RootWindow(ob_display, ob_screen), + PROP_SET32(RootWindow(obt_display, ob_screen), net_showing_desktop, cardinal, show); } @@ -1239,15 +1240,15 @@ void screen_install_colormap(ObClient *client, gboolean install) { if (client == NULL || client->colormap == None) { if (install) - XInstallColormap(ob_display, RrColormap(ob_rr_inst)); + XInstallColormap(obt_display, RrColormap(ob_rr_inst)); else - XUninstallColormap(ob_display, RrColormap(ob_rr_inst)); + XUninstallColormap(obt_display, RrColormap(ob_rr_inst)); } else { obt_display_ignore_errors(TRUE); if (install) - XInstallColormap(ob_display, client->colormap); + XInstallColormap(obt_display, client->colormap); else - XUninstallColormap(ob_display, client->colormap); + XUninstallColormap(obt_display, client->colormap); obt_display_ignore_errors(FALSE); } } @@ -1297,8 +1298,8 @@ static void get_xinerama_screens(Rect **xin_areas, guint *nxin) if (ob_debug_xinerama) { g_print("Using fake xinerama !\n"); - gint w = WidthOfScreen(ScreenOfDisplay(ob_display, ob_screen)); - gint h = HeightOfScreen(ScreenOfDisplay(ob_display, ob_screen)); + gint w = WidthOfScreen(ScreenOfDisplay(obt_display, ob_screen)); + gint h = HeightOfScreen(ScreenOfDisplay(obt_display, ob_screen)); *nxin = 2; *xin_areas = g_new(Rect, *nxin + 1); RECT_SET((*xin_areas)[0], 0, 0, w/2, h); @@ -1308,7 +1309,7 @@ static void get_xinerama_screens(Rect **xin_areas, guint *nxin) else if (obt_display_extension_xinerama) { guint i; gint n; - XineramaScreenInfo *info = XineramaQueryScreens(ob_display, &n); + XineramaScreenInfo *info = XineramaQueryScreens(obt_display, &n); *nxin = n; *xin_areas = g_new(Rect, *nxin + 1); for (i = 0; i < *nxin; ++i) @@ -1321,8 +1322,8 @@ static void get_xinerama_screens(Rect **xin_areas, guint *nxin) *nxin = 1; *xin_areas = g_new(Rect, *nxin + 1); RECT_SET((*xin_areas)[0], 0, 0, - WidthOfScreen(ScreenOfDisplay(ob_display, ob_screen)), - HeightOfScreen(ScreenOfDisplay(ob_display, ob_screen))); + WidthOfScreen(ScreenOfDisplay(obt_display, ob_screen)), + HeightOfScreen(ScreenOfDisplay(obt_display, ob_screen))); } /* returns one extra with the total area in it */ @@ -1456,7 +1457,7 @@ void screen_update_areas(void) /* all the work areas are not used here, only the ones for the first monitor are */ - PROP_SETA32(RootWindow(ob_display, ob_screen), net_workarea, cardinal, + PROP_SETA32(RootWindow(obt_display, ob_screen), net_workarea, cardinal, dims, 4 * screen_num_desktops); /* the area has changed, adjust all the windows if they need it */ @@ -1698,10 +1699,10 @@ Rect* screen_physical_area_active(void) void screen_set_root_cursor(void) { if (sn_app_starting()) - XDefineCursor(ob_display, RootWindow(ob_display, ob_screen), + XDefineCursor(obt_display, RootWindow(obt_display, ob_screen), ob_cursor(OB_CURSOR_BUSYPOINTER)); else - XDefineCursor(ob_display, RootWindow(ob_display, ob_screen), + XDefineCursor(obt_display, RootWindow(obt_display, ob_screen), ob_cursor(OB_CURSOR_POINTER)); } @@ -1712,12 +1713,12 @@ gboolean screen_pointer_pos(gint *x, gint *y) guint u; gboolean ret; - ret = !!XQueryPointer(ob_display, RootWindow(ob_display, ob_screen), + ret = !!XQueryPointer(obt_display, RootWindow(obt_display, ob_screen), &w, &w, x, y, &i, &i, &u); if (!ret) { - for (i = 0; i < ScreenCount(ob_display); ++i) + for (i = 0; i < ScreenCount(obt_display); ++i) if (i != ob_screen) - if (XQueryPointer(ob_display, RootWindow(ob_display, i), + if (XQueryPointer(obt_display, RootWindow(obt_display, i), &w, &w, x, y, &i, &i, &u)) break; } diff --git a/openbox/stacking.c b/openbox/stacking.c index b18c02af..6910b191 100644 --- a/openbox/stacking.c +++ b/openbox/stacking.c @@ -54,7 +54,7 @@ void stacking_set_list(void) } } - PROP_SETA32(RootWindow(ob_display, ob_screen), + PROP_SETA32(RootWindow(obt_display, ob_screen), net_client_list_stacking, window, (gulong*)windows, i); g_free(windows); @@ -104,7 +104,7 @@ static void do_restack(GList *wins, GList *before) #endif if (!pause_changes) - XRestackWindows(ob_display, win, i); + XRestackWindows(obt_display, win, i); g_free(win); stacking_set_list(); diff --git a/openbox/startupnotify.c b/openbox/startupnotify.c index 24f2a85c..1542be06 100644 --- a/openbox/startupnotify.c +++ b/openbox/startupnotify.c @@ -66,7 +66,7 @@ void sn_startup(gboolean reconfig) putenv(s); g_free(s); - sn_display = sn_display_new(ob_display, NULL, NULL); + sn_display = sn_display_new(obt_display, NULL, NULL); sn_context = sn_monitor_context_new(sn_display, ob_screen, sn_event_func, NULL, NULL); sn_launcher = sn_launcher_context_new(sn_display, ob_screen); diff --git a/openbox/translate.c b/openbox/translate.c index c697679d..263bffa4 100644 --- a/openbox/translate.c +++ b/openbox/translate.c @@ -145,7 +145,7 @@ gboolean translate_key(const gchar *str, guint *state, guint *keycode) g_message(_("Invalid key name '%s' in key binding"), l); goto translation_fail; } - *keycode = XKeysymToKeycode(ob_display, sym); + *keycode = XKeysymToKeycode(obt_display, sym); } if (!*keycode) { g_message(_("Requested key '%s' does not exist on the display"), l); @@ -164,7 +164,7 @@ gchar *translate_keycode(guint keycode) KeySym sym; const gchar *ret = NULL; - if ((sym = XKeycodeToKeysym(ob_display, keycode, 0)) != NoSymbol) + if ((sym = XKeycodeToKeysym(obt_display, keycode, 0)) != NoSymbol) ret = XKeysymToString(sym); return g_locale_to_utf8(ret, -1, NULL, NULL, NULL); } -- 2.45.2