} 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)
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]))
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)
/* 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);
}
/* 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);
}
/* 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)
{
/* 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
/* 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);
}
/* 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 */
/* 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)
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);
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);
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);
}
/* 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
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 ?
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);
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);
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*/
/* 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;
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) {
{
XWindowAttributes wa;
- if (XGetWindowAttributes(ob_display, self->window, &wa))
+ if (XGetWindowAttributes(obt_display, self->window, &wa))
client_update_colormap(self, wa.colormap);
}
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))
*/
/* 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)
} 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);
/* 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);
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;
*/
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)
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
}
}
else
- XKillClient(ob_display, self->window);
+ XKillClient(obt_display, self->window);
}
void client_hilite(ObClient *self, gboolean hilite)
{
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;
}
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);
}
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;
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);
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);
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),
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,
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);
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 {
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
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);
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();
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 */
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;
/* 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;
/* 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
/* 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;
/* 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)
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.. */
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 {
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");
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);
/* 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);
}
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);
/* 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);
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;
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;
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;
b == prop_atoms.net_wm_icon)
continue;
- XPutBackEvent(ob_display, &ce);
+ XPutBackEvent(obt_display, &ce);
break;
}
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)
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)
else
ungrab_passive_key();
- XSync(ob_display, FALSE);
+ XSync(obt_display, FALSE);
}
gboolean event_time_after(Time t1, Time t2)
/* 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;
}
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)
/* 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);
}
}
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);
}
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);
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));
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)
/* 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);
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;
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;
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;
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;
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;
}
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);
}
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);
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);
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);
}
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);
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;
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;
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;
}
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 */
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();
}
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);
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);
}
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);
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);
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 */
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;
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 */
{
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);
}
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);
}
}
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;
}
}
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,
++num;
}
- XShapeCombineRectangles(ob_display, self->window,
+ XShapeCombineRectangles(obt_display, self->window,
ShapeBounding, 0, 0, xrect, num,
ShapeUnion, Unsorted);
}
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 -
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 -
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),
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) {
/* 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,
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,
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))
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 +
if (sidebwidth) {
- XMoveResizeWindow(ob_display, self->lgripleft,
+ XMoveResizeWindow(obt_display, self->lgripleft,
0,
self->size.top +
self->client->area.height +
(!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,
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,
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,
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 -
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,
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,
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);
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,
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) {
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);
}
/* 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);
}
self->focused = hilite;
self->need_render = TRUE;
framerender_frame(self);
- XFlush(ob_display);
+ XFlush(obt_display);
}
void frame_adjust_title(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
/* 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);
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
*/
if (ev.xreparent.parent != self->window) {
reparent = FALSE;
- XPutBackEvent(ob_display, &ev);
+ XPutBackEvent(obt_display, &ev);
break;
}
}
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);
}
/* 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)
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) {
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 */
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
/* 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)
/* show it during the animation even if it is not "visible" */
if (!self->visible)
- XMapWindow(ob_display, self->window);
+ XMapWindow(obt_display, self->window);
}
}
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)
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) {
}
}
- XFlush(ob_display);
+ XFlush(obt_display);
}
static void framerender_label(ObFrame *self, RrAppearance *a)
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)
ret = TRUE;
} else if (kgrabs > 0) {
if (--kgrabs == 0) {
- XUngrabKeyboard(ob_display, ungrab_time());
+ XUngrabKeyboard(obt_display, ungrab_time());
}
ret = TRUE;
}
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)
ret = TRUE;
} else if (pgrabs > 0) {
if (--pgrabs == 0) {
- XUngrabPointer(ob_display, ungrab_time());
+ XUngrabPointer(obt_display, ungrab_time());
}
ret = TRUE;
}
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;
/* 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);
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)
/* 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)
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)
/*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;
}
}
{
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);
}
}
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);
}
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);
stacking_remove(MENU_AS_WINDOW(self));
- XDestroyWindow(ob_display, self->window);
+ XDestroyWindow(obt_display, self->window);
RrAppearanceFree(self->a_items);
RrAppearanceFree(self->a_title);
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);
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);
}
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)
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;
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);
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);
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 -
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;
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,
- 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,
- 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,
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
}
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));
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;
RECT_SET_SIZE(self->area, w, h);
- XFlush(ob_display);
+ XFlush(obt_display);
}
static void menu_frame_update(ObMenuFrame *self)
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);
}
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);
ungrab_keyboard();
}
- XUnmapWindow(ob_display, self->window);
+ XUnmapWindow(obt_display, self->window);
menu_frame_free(self);
}
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);
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;
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) {
/* 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 */
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 |
#ifdef SYNC
/* turn off the alarm */
if (moveresize_alarm != None) {
- XSyncDestroyAlarm(ob_display, moveresize_alarm);
+ XSyncDestroyAlarm(obt_display, moveresize_alarm);
moveresize_alarm = None;
}
/* 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;
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;
}
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);
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);
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;
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();
/* 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);
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())
/* 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;
/*
if (config_type != NULL)
- PROP_SETS(RootWindow(ob_display, ob_screen),
+ PROP_SETS(RootWindow(obt_display, ob_screen),
ob_config, config_type);
*/
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);
}
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))
} 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();
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;
}
#include "render/render.h"
#include "render/theme.h"
#include "obt/mainloop.h"
+#include "obt/display.h"
#include <glib.h>
#include <X11/Xlib.h>
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;
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);
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);
{
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;
}
/* 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
*/
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);
}
/* 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);
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);
}
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;
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);
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);
}
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);
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);
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;
Atoms prop_atoms;
#define CREATE(var, name) (prop_atoms.var = \
- XInternAtom(ob_display, name, FALSE))
+ XInternAtom(obt_display, name, FALSE))
void prop_startup(void)
{
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) {
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) {
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);
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));
}
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);
}
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;
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);
}
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) {
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)
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;
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;
}
/* 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);
/* 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;
}
/* 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 */
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);
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 );
}
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);
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);
}
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 */
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)
{
/* 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 &&
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;
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;
/* 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)
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);
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
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) {
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
/* 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);
}
}
show = !!show; /* make it boolean */
- PROP_SET32(RootWindow(ob_display, ob_screen),
+ PROP_SET32(RootWindow(obt_display, ob_screen),
net_showing_desktop, cardinal, show);
}
{
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);
}
}
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);
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)
*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 */
/* 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 */
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));
}
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;
}
}
}
- 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);
#endif
if (!pause_changes)
- XRestackWindows(ob_display, win, i);
+ XRestackWindows(obt_display, win, i);
g_free(win);
stacking_set_list();
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);
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);
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);
}