From: root Date: Thu, 2 Feb 2006 18:04:45 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=236668850b75f24e66e21488b2b0715c62b43dc1;p=dana%2Furxvt.git *** empty log message *** --- diff --git a/README.configure b/README.configure index 4eebfceb..480ae7fe 100644 --- a/README.configure +++ b/README.configure @@ -215,7 +215,7 @@ CONFIGURE OPTIONS --enable-dmalloc (default: off) Use Gray Watson's malloc - which is good for debugging See - http://www.letters.com/dmalloc/ for details If you use either this + for details If you use either this or the next option, you may need to edit src/Makefile after compiling to point DINCLUDE and DLIB to the right places. diff --git a/doc/rxvt.7.man.in b/doc/rxvt.7.man.in index 81981200..b69663e5 100644 --- a/doc/rxvt.7.man.in +++ b/doc/rxvt.7.man.in @@ -2472,7 +2472,7 @@ Remove support for mouse selection style like that of xterm. .IP "\-\-enable\-dmalloc (default: off)" 4 .IX Item "--enable-dmalloc (default: off)" Use Gray Watson's malloc \- which is good for debugging See -http://www.letters.com/dmalloc/ for details If you use either this or the + for details If you use either this or the next option, you may need to edit src/Makefile after compiling to point \&\s-1DINCLUDE\s0 and \s-1DLIB\s0 to the right places. .Sp diff --git a/doc/rxvt.7.pod b/doc/rxvt.7.pod index 848d95fa..d6891d27 100644 --- a/doc/rxvt.7.pod +++ b/doc/rxvt.7.pod @@ -2295,7 +2295,7 @@ Remove support for mouse selection style like that of xterm. =item --enable-dmalloc (default: off) Use Gray Watson's malloc - which is good for debugging See -http://www.letters.com/dmalloc/ for details If you use either this or the +L for details If you use either this or the next option, you may need to edit src/Makefile after compiling to point DINCLUDE and DLIB to the right places. diff --git a/doc/rxvt.7.txt b/doc/rxvt.7.txt index 14fe9d12..95748e3f 100644 --- a/doc/rxvt.7.txt +++ b/doc/rxvt.7.txt @@ -1834,7 +1834,7 @@ CONFIGURE OPTIONS --enable-dmalloc (default: off) Use Gray Watson's malloc - which is good for debugging See - http://www.letters.com/dmalloc/ for details If you use either this + for details If you use either this or the next option, you may need to edit src/Makefile after compiling to point DINCLUDE and DLIB to the right places. diff --git a/src/command.C b/src/command.C index 691880e6..1bf7cbb6 100644 --- a/src/command.C +++ b/src/command.C @@ -1179,7 +1179,7 @@ rxvt_term::pty_cb (io_watcher &w, short revents) void rxvt_term::pointer_unblank () { - XDefineCursor (xdisp, vt, TermWin_cursor); + XDefineCursor (dpy, vt, TermWin_cursor); recolour_cursor (); #ifdef POINTER_BLANK @@ -1197,8 +1197,8 @@ rxvt_term::pointer_blank () if (!OPTION (Opt_pointerBlank)) return; - XDefineCursor (xdisp, vt, display->blank_cursor); - XFlush (xdisp); + XDefineCursor (dpy, vt, display->blank_cursor); + XFlush (dpy); hidden_pointer = 1; } @@ -1287,7 +1287,7 @@ rxvt_term::x_cb (XEvent &ev) { make_current (); - dLocal (Display *, xdisp); + dLocal (Display *, dpy); if (ev.xany.window == vt && SHOULD_INVOKE (HOOK_X_EVENT) @@ -1407,7 +1407,7 @@ rxvt_term::x_cb (XEvent &ev) } #if ENABLE_EWMH else if (ev.xclient.data.l[0] == xa[XA_NET_WM_PING]) - XSendEvent (xdisp, ev.xclient.window = display->root, + XSendEvent (dpy, ev.xclient.window = display->root, False, SubstructureRedirectMask | SubstructureNotifyMask, &ev); #endif @@ -1465,7 +1465,7 @@ rxvt_term::x_cb (XEvent &ev) case ConfigureNotify: if (ev.xconfigure.window == parent[0]) { - while (XCheckTypedWindowEvent (xdisp, ev.xconfigure.window, ConfigureNotify, &ev)) + while (XCheckTypedWindowEvent (dpy, ev.xconfigure.window, ConfigureNotify, &ev)) ; if (szHint.width != ev.xconfigure.width || szHint.height != ev.xconfigure.height) @@ -1533,11 +1533,11 @@ rxvt_term::x_cb (XEvent &ev) do scr_expose (ev.xexpose.x, ev.xexpose.y, ev.xexpose.width, ev.xexpose.height, False); - while (XCheckTypedWindowEvent (xdisp, vt, ev.xany.type, &ev)); + while (XCheckTypedWindowEvent (dpy, vt, ev.xany.type, &ev)); ev.xany.type = ev.xany.type == Expose ? GraphicsExpose : Expose; - while (XCheckTypedWindowEvent (xdisp, vt, ev.xany.type, &ev)) + while (XCheckTypedWindowEvent (dpy, vt, ev.xany.type, &ev)) scr_expose (ev.xexpose.x, ev.xexpose.y, ev.xexpose.width, ev.xexpose.height, False); @@ -1547,9 +1547,9 @@ rxvt_term::x_cb (XEvent &ev) { XEvent unused_event; - while (XCheckTypedWindowEvent (xdisp, ev.xany.window, Expose, &unused_event)) + while (XCheckTypedWindowEvent (dpy, ev.xany.window, Expose, &unused_event)) ; - while (XCheckTypedWindowEvent (xdisp, ev.xany.window, GraphicsExpose, &unused_event)) + while (XCheckTypedWindowEvent (dpy, ev.xany.window, GraphicsExpose, &unused_event)) ; if (isScrollbarWindow (ev.xany.window)) @@ -1560,7 +1560,7 @@ rxvt_term::x_cb (XEvent &ev) #ifdef TRANSPARENT if (am_transparent && ev.xany.window == parent[0]) - XClearWindow (xdisp, ev.xany.window); + XClearWindow (dpy, ev.xany.window); #endif } break; @@ -1580,10 +1580,10 @@ rxvt_term::x_cb (XEvent &ev) ; // nop else if (ev.xbutton.state & (Button1Mask | Button3Mask)) { - while (XCheckTypedWindowEvent (xdisp, vt, MotionNotify, &ev)) + while (XCheckTypedWindowEvent (dpy, vt, MotionNotify, &ev)) ; - XQueryPointer (xdisp, vt, + XQueryPointer (dpy, vt, &unused_root, &unused_child, &unused_root_x, &unused_root_y, &ev.xbutton.x, &ev.xbutton.y, @@ -1657,11 +1657,11 @@ rxvt_term::x_cb (XEvent &ev) } else if (isScrollbarWindow (ev.xany.window) && scrollbar_isMotion ()) { - while (XCheckTypedWindowEvent (xdisp, scrollBar.win, + while (XCheckTypedWindowEvent (dpy, scrollBar.win, MotionNotify, &ev)) ; - XQueryPointer (xdisp, scrollBar.win, + XQueryPointer (dpy, scrollBar.win, &unused_root, &unused_child, &unused_root_x, &unused_root_y, &ev.xbutton.x, &ev.xbutton.y, @@ -2432,17 +2432,17 @@ rxvt_term::check_our_parents () if (!OPTION (Opt_transparent)) return pchanged; /* Don't try any more */ - XGetWindowAttributes (xdisp, display->root, &wrootattr); + XGetWindowAttributes (dpy, display->root, &wrootattr); rootdepth = wrootattr.depth; - XGetWindowAttributes (xdisp, parent[0], &wattr); + XGetWindowAttributes (dpy, parent[0], &wattr); if (rootdepth != wattr.depth) { if (am_transparent) { pchanged = 1; - XSetWindowBackground (xdisp, vt, pix_colors_focused[Color_bg]); + XSetWindowBackground (dpy, vt, pix_colors_focused[Color_bg]); am_transparent = am_pixmap_trans = 0; } @@ -2450,7 +2450,7 @@ rxvt_term::check_our_parents () } /* Get all X ops out of the queue so that our information is up-to-date. */ - XSync (xdisp, False); + XSync (dpy, False); /* * Make the frame window set by the window manager have @@ -2458,13 +2458,13 @@ rxvt_term::check_our_parents () * windows for each client, so we have to take care about that. */ i = (xa[XA_XROOTPMAP_ID] - && XGetWindowProperty (xdisp, display->root, xa[XA_XROOTPMAP_ID], + && XGetWindowProperty (dpy, display->root, xa[XA_XROOTPMAP_ID], 0L, 1L, False, XA_PIXMAP, &atype, &aformat, &nitems, &bytes_after, &prop) == Success); if (!i || prop == NULL) i = (xa[XA_ESETROOT_PMAP_ID] - && XGetWindowProperty (xdisp, display->root, xa[XA_ESETROOT_PMAP_ID], + && XGetWindowProperty (dpy, display->root, xa[XA_ESETROOT_PMAP_ID], 0L, 1L, False, XA_PIXMAP, &atype, &aformat, &nitems, &bytes_after, &prop) == Success); @@ -2493,7 +2493,7 @@ rxvt_term::check_our_parents () GC gc; XGCValues gcvalue; - XTranslateCoordinates (xdisp, parent[0], display->root, + XTranslateCoordinates (dpy, parent[0], display->root, 0, 0, &sx, &sy, &cr); nw = (unsigned int)szHint.width; nh = (unsigned int)szHint.height; @@ -2516,9 +2516,9 @@ rxvt_term::check_our_parents () min_it (nw, (unsigned int) (wrootattr.width - sx)); min_it (nh, (unsigned int) (wrootattr.height - sy)); - XSync (xdisp, False); + XSync (dpy, False); allowedxerror = -1; - image = XGetImage (xdisp, rootpixmap, sx, sy, nw, nh, AllPlanes, ZPixmap); + image = XGetImage (dpy, rootpixmap, sx, sy, nw, nh, AllPlanes, ZPixmap); /* XXX: handle BadMatch - usually because we're outside the pixmap */ /* XXX: may need a delay here? */ @@ -2531,7 +2531,7 @@ rxvt_term::check_our_parents () pchanged = 1; if (pixmap != None) { - XFreePixmap (xdisp, pixmap); + XFreePixmap (dpy, pixmap); pixmap = None; } } @@ -2541,7 +2541,7 @@ rxvt_term::check_our_parents () else { if (pixmap != None) - XFreePixmap (xdisp, pixmap); + XFreePixmap (dpy, pixmap); #if TINTING if (ISSET_PIXCOLOR (Color_tint)) @@ -2555,14 +2555,14 @@ rxvt_term::check_our_parents () } #endif - pixmap = XCreatePixmap (xdisp, vt, szHint.width, szHint.height, image->depth); - gc = XCreateGC (xdisp, vt, 0UL, &gcvalue); - XPutImage (xdisp, pixmap, gc, image, 0, 0, + pixmap = XCreatePixmap (dpy, vt, szHint.width, szHint.height, image->depth); + gc = XCreateGC (dpy, vt, 0UL, &gcvalue); + XPutImage (dpy, pixmap, gc, image, 0, 0, nx, ny, image->width, image->height); - XFreeGC (xdisp, gc); + XFreeGC (dpy, gc); XDestroyImage (image); - XSetWindowBackgroundPixmap (xdisp, parent[0], pixmap); - XClearWindow (xdisp, parent[0]); + XSetWindowBackgroundPixmap (dpy, parent[0], pixmap); + XClearWindow (dpy, parent[0]); if (!am_transparent || !am_pixmap_trans) pchanged = 1; @@ -2572,7 +2572,7 @@ rxvt_term::check_our_parents () } if (am_pixmap_trans) - XSetWindowBackgroundPixmap (xdisp, vt, ParentRelative); + XSetWindowBackgroundPixmap (dpy, vt, ParentRelative); else { unsigned int n; @@ -2582,7 +2582,7 @@ rxvt_term::check_our_parents () for (i = 1; i < (int) (sizeof (parent) / sizeof (Window)); i++) { oldp = parent[i]; - XQueryTree (xdisp, parent[i - 1], &root, &parent[i], &list, &n); + XQueryTree (dpy, parent[i - 1], &root, &parent[i], &list, &n); XFree (list); if (parent[i] == display->root) @@ -2602,7 +2602,7 @@ rxvt_term::check_our_parents () if (pchanged) for (; n < (unsigned int)i; n++) { - XGetWindowAttributes (xdisp, parent[n], &wattr); + XGetWindowAttributes (dpy, parent[n], &wattr); if (wattr.depth != rootdepth || wattr.c_class == InputOnly) { @@ -2613,8 +2613,8 @@ rxvt_term::check_our_parents () if (n > (sizeof (parent) / sizeof (parent[0]))) { - XSetWindowBackground (xdisp, parent[0], pix_colors_focused[Color_border]); - XSetWindowBackground (xdisp, vt, pix_colors_focused[Color_bg]); + XSetWindowBackground (dpy, parent[0], pix_colors_focused[Color_border]); + XSetWindowBackground (dpy, vt, pix_colors_focused[Color_bg]); am_transparent = 0; /* XXX: also turn off Opt_transparent? */ } @@ -2622,11 +2622,11 @@ rxvt_term::check_our_parents () { for (n = 0; n < (unsigned int)i; n++) { - XSetWindowBackgroundPixmap (xdisp, parent[n], ParentRelative); - XClearWindow (xdisp, parent[n]); + XSetWindowBackgroundPixmap (dpy, parent[n], ParentRelative); + XClearWindow (dpy, parent[n]); } - XSetWindowBackgroundPixmap (xdisp, vt, ParentRelative); + XSetWindowBackgroundPixmap (dpy, vt, ParentRelative); am_transparent = 1; } @@ -2636,7 +2636,7 @@ rxvt_term::check_our_parents () if (scrollBar.win) { - XSetWindowBackgroundPixmap (xdisp, scrollBar.win, ParentRelative); + XSetWindowBackgroundPixmap (dpy, scrollBar.win, ParentRelative); scrollBar.setIdle (); scrollbar_show (0); } @@ -3537,7 +3537,7 @@ rxvt_term::process_window_ops (const int *args, unsigned int nargs) XWindowAttributes wattr; Window wdummy; - dLocal (Display *, xdisp); + dLocal (Display *, dpy); if (nargs == 0) return; @@ -3548,22 +3548,22 @@ rxvt_term::process_window_ops (const int *args, unsigned int nargs) * commands */ case 1: /* deiconify window */ - XMapWindow (xdisp, parent[0]); + XMapWindow (dpy, parent[0]); break; case 2: /* iconify window */ - XIconifyWindow (xdisp, parent[0], display->screen); + XIconifyWindow (dpy, parent[0], display->screen); break; case 3: /* set position (pixels) */ - XMoveWindow (xdisp, parent[0], args[1], args[2]); + XMoveWindow (dpy, parent[0], args[1], args[2]); break; case 4: /* set size (pixels) */ set_widthheight ((unsigned int)args[2], (unsigned int)args[1]); break; case 5: /* raise window */ - XRaiseWindow (xdisp, parent[0]); + XRaiseWindow (dpy, parent[0]); break; case 6: /* lower window */ - XLowerWindow (xdisp, parent[0]); + XLowerWindow (dpy, parent[0]); break; case 7: /* refresh window */ scr_touch (true); @@ -3584,18 +3584,18 @@ rxvt_term::process_window_ops (const int *args, unsigned int nargs) * reports - some output format copied from XTerm */ case 11: /* report window state */ - XGetWindowAttributes (xdisp, parent[0], &wattr); + XGetWindowAttributes (dpy, parent[0], &wattr); tt_printf ("\033[%dt", wattr.map_state == IsViewable ? 1 : 2); break; case 13: /* report window position */ - XGetWindowAttributes (xdisp, parent[0], &wattr); - XTranslateCoordinates (xdisp, parent[0], wattr.root, + XGetWindowAttributes (dpy, parent[0], &wattr); + XTranslateCoordinates (dpy, parent[0], wattr.root, -wattr.border_width, -wattr.border_width, &x, &y, &wdummy); tt_printf ("\033[3;%d;%dt", x, y); break; case 14: /* report window size (pixels) */ - XGetWindowAttributes (xdisp, parent[0], &wattr); + XGetWindowAttributes (dpy, parent[0], &wattr); tt_printf ("\033[4;%d;%dt", wattr.height, wattr.width); break; case 18: /* report text area size (chars) */ @@ -3607,7 +3607,7 @@ rxvt_term::process_window_ops (const int *args, unsigned int nargs) case 20: /* report icon label */ { char *s; - XGetIconName (xdisp, parent[0], &s); + XGetIconName (dpy, parent[0], &s); tt_printf ("\033]L%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */ XFree (s); } @@ -3615,7 +3615,7 @@ rxvt_term::process_window_ops (const int *args, unsigned int nargs) case 21: /* report window title */ { char *s; - XFetchName (xdisp, parent[0], &s); + XFetchName (dpy, parent[0], &s); tt_printf ("\033]l%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */ XFree (s); } @@ -3751,7 +3751,7 @@ rxvt_term::process_xterm_seq (int op, const char *str, char resp) bool query = str[0] == '?' && !str[1]; int saveop = op; - dLocal (Display *, xdisp); + dLocal (Display *, dpy); assert (str != NULL); switch (op) @@ -3777,7 +3777,7 @@ rxvt_term::process_xterm_seq (int op, const char *str, char resp) const char *str = ""; if (prop - && XGetWindowProperty (xdisp, parent[0], + && XGetWindowProperty (dpy, parent[0], prop, 0, 1<<16, 0, AnyPropertyType, &actual_type, &actual_format, &nitems, &bytes_after, &value) == Success @@ -3799,7 +3799,7 @@ rxvt_term::process_xterm_seq (int op, const char *str, char resp) set_utf8_property (display->atom (str), eq + 1); } else - XDeleteProperty (xdisp, parent[0], + XDeleteProperty (dpy, parent[0], display->atom (str)); } break; diff --git a/src/init.C b/src/init.C index 0a6ef233..c4ff9a7f 100644 --- a/src/init.C +++ b/src/init.C @@ -490,7 +490,7 @@ rxvt_term::init_env () if (val == NULL) #endif /* DISPLAY_IS_IP */ - val = XDisplayString (xdisp); + val = XDisplayString (dpy); if (rs[Rs_display_name] == NULL) rs[Rs_display_name] = val; /* use broken `:0' value */ @@ -807,7 +807,7 @@ rxvt_term::get_ourmods () && strcasecmp (rsmod, "mod1") >= 0 && strcasecmp (rsmod, "mod5") <= 0) requestedmeta = rsmod[3] - '0'; - map = XGetModifierMapping (xdisp); + map = XGetModifierMapping (dpy); kc = map->modifiermap; for (i = 1; i < 6; i++) @@ -819,7 +819,7 @@ rxvt_term::get_ourmods () if (kc[k] == 0) break; - switch (XKeycodeToKeysym (xdisp, kc[k], 0)) + switch (XKeycodeToKeysym (dpy, kc[k], 0)) { case XK_Num_Lock: ModNumLockMask = modmasks[i - 1]; @@ -885,7 +885,7 @@ rxvt_term::create_windows (int argc, const char *const *argv) XSetWindowAttributes attributes; Window top, parent; - dLocal (Display *, xdisp); + dLocal (Display *, dpy); /* grab colors before netscape does */ Get_Colours (); @@ -900,7 +900,7 @@ rxvt_term::create_windows (int argc, const char *const *argv) #if ENABLE_FRILLS if (OPTION (Opt_borderLess)) { - if (XInternAtom (xdisp, "_MOTIF_WM_INFO", True) == None) + if (XInternAtom (dpy, "_MOTIF_WM_INFO", True) == None) { /* print_warning("Window Manager does not support MWM hints. Bypassing window manager control for borderless window.\n");*/ attributes.override_redirect = true; @@ -923,7 +923,7 @@ rxvt_term::create_windows (int argc, const char *const *argv) parent = strtol (rs[Rs_embed], 0, 0); - if (!XGetWindowAttributes (xdisp, parent, &wattr)) + if (!XGetWindowAttributes (dpy, parent, &wattr)) rxvt_fatal ("invalid window-id specified with -embed, aborting.\n"); window_calc (wattr.width, wattr.height); @@ -937,7 +937,7 @@ rxvt_term::create_windows (int argc, const char *const *argv) attributes.border_pixel = pix_colors_focused [Color_border]; attributes.colormap = cmap; - top = XCreateWindow (xdisp, parent, + top = XCreateWindow (dpy, parent, szHint.x, szHint.y, szHint.width, szHint.height, ext_bwidth, @@ -961,12 +961,12 @@ rxvt_term::create_windows (int argc, const char *const *argv) wmHint.initial_state = OPTION (Opt_iconic) ? IconicState : NormalState; wmHint.window_group = top; - XmbSetWMProperties (xdisp, top, NULL, NULL, (char **)argv, argc, + XmbSetWMProperties (dpy, top, NULL, NULL, (char **)argv, argc, &szHint, &wmHint, &classHint); #if ENABLE_FRILLS if (mwmhints.flags) - XChangeProperty (xdisp, top, xa[XA_MOTIF_WM_HINTS], xa[XA_MOTIF_WM_HINTS], 32, + XChangeProperty (dpy, top, xa[XA_MOTIF_WM_HINTS], xa[XA_MOTIF_WM_HINTS], 32, PropModeReplace, (unsigned char *)&mwmhints, PROP_MWM_HINTS_ELEMENTS); #endif @@ -977,24 +977,24 @@ rxvt_term::create_windows (int argc, const char *const *argv) #endif }; - XSetWMProtocols (xdisp, top, protocols, sizeof (protocols) / sizeof (protocols[0])); + XSetWMProtocols (dpy, top, protocols, sizeof (protocols) / sizeof (protocols[0])); #if ENABLE_FRILLS if (rs[Rs_transient_for]) - XSetTransientForHint (xdisp, top, (Window)strtol (rs[Rs_transient_for], 0, 0)); + XSetTransientForHint (dpy, top, (Window)strtol (rs[Rs_transient_for], 0, 0)); #endif #if ENABLE_EWMH long pid = getpid (); - XChangeProperty (xdisp, top, + XChangeProperty (dpy, top, xa[XA_NET_WM_PID], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&pid, 1); // _NET_WM_WINDOW_TYPE is NORMAL, which is the default #endif - XSelectInput (xdisp, top, + XSelectInput (dpy, top, KeyPressMask #if (MOUSE_WHEEL && MOUSE_SLIP_WHEELING) || ENABLE_FRILLS || ISO_14755 | KeyReleaseMask @@ -1005,15 +1005,15 @@ rxvt_term::create_windows (int argc, const char *const *argv) termwin_ev.start (display, top); /* vt cursor: Black-on-White is standard, but this is more popular */ - TermWin_cursor = XCreateFontCursor (xdisp, XC_xterm); + TermWin_cursor = XCreateFontCursor (dpy, XC_xterm); #ifdef HAVE_SCROLLBARS /* cursor scrollBar: Black-on-White */ - leftptr_cursor = XCreateFontCursor (xdisp, XC_left_ptr); + leftptr_cursor = XCreateFontCursor (dpy, XC_left_ptr); #endif /* the vt window */ - vt = XCreateSimpleWindow (xdisp, top, + vt = XCreateSimpleWindow (dpy, top, window_vt_x, window_vt_y, width, height, 0, @@ -1021,7 +1021,7 @@ rxvt_term::create_windows (int argc, const char *const *argv) pix_colors_focused[Color_bg]); attributes.bit_gravity = NorthWestGravity; - XChangeWindowAttributes (xdisp, vt, CWBitGravity, &attributes); + XChangeWindowAttributes (dpy, vt, CWBitGravity, &attributes); vt_emask = ExposureMask | ButtonPressMask | ButtonReleaseMask | PropertyChangeMask; @@ -1056,7 +1056,7 @@ rxvt_term::create_windows (int argc, const char *const *argv) gcvalue.background = pix_colors[Color_bg]; gcvalue.graphics_exposures = 1; - gc = XCreateGC (xdisp, vt, + gc = XCreateGC (dpy, vt, GCForeground | GCBackground | GCGraphicsExposures, &gcvalue); @@ -1064,11 +1064,11 @@ rxvt_term::create_windows (int argc, const char *const *argv) #ifdef RXVT_SCROLLBAR gcvalue.foreground = pix_colors[Color_topShadow]; - topShadowGC = XCreateGC (xdisp, vt, GCForeground, &gcvalue); + topShadowGC = XCreateGC (dpy, vt, GCForeground, &gcvalue); gcvalue.foreground = pix_colors[Color_bottomShadow]; - botShadowGC = XCreateGC (xdisp, vt, GCForeground, &gcvalue); + botShadowGC = XCreateGC (dpy, vt, GCForeground, &gcvalue); gcvalue.foreground = pix_colors[ (depth <= 2 ? Color_fg : Color_scroll)]; - scrollbarGC = XCreateGC (xdisp, vt, GCForeground, &gcvalue); + scrollbarGC = XCreateGC (dpy, vt, GCForeground, &gcvalue); #endif #ifdef OFF_FOCUS_FADING diff --git a/src/main.C b/src/main.C index b2e4c37b..9575f5b8 100644 --- a/src/main.C +++ b/src/main.C @@ -224,35 +224,35 @@ rxvt_term::~rxvt_term () im_destroy (); #endif #ifdef XTERM_SCROLLBAR - if (xscrollbarGC) XFreeGC (xdisp, xscrollbarGC); - if (ShadowGC) XFreeGC (xdisp, ShadowGC); + if (xscrollbarGC) XFreeGC (dpy, xscrollbarGC); + if (ShadowGC) XFreeGC (dpy, ShadowGC); #endif #ifdef PLAIN_SCROLLBAR - if (pscrollbarGC) XFreeGC (xdisp, pscrollbarGC); + if (pscrollbarGC) XFreeGC (dpy, pscrollbarGC); #endif #ifdef NEXT_SCROLLBAR - if (blackGC) XFreeGC (xdisp, blackGC); - if (whiteGC) XFreeGC (xdisp, whiteGC); - if (grayGC) XFreeGC (xdisp, grayGC); - if (darkGC) XFreeGC (xdisp, darkGC); - if (stippleGC) XFreeGC (xdisp, stippleGC); - if (dimple) XFreePixmap (xdisp, dimple); - if (upArrow) XFreePixmap (xdisp, upArrow); - if (downArrow) XFreePixmap (xdisp, downArrow); - if (upArrowHi) XFreePixmap (xdisp, upArrowHi); - if (downArrowHi) XFreePixmap (xdisp, downArrowHi); + if (blackGC) XFreeGC (dpy, blackGC); + if (whiteGC) XFreeGC (dpy, whiteGC); + if (grayGC) XFreeGC (dpy, grayGC); + if (darkGC) XFreeGC (dpy, darkGC); + if (stippleGC) XFreeGC (dpy, stippleGC); + if (dimple) XFreePixmap (dpy, dimple); + if (upArrow) XFreePixmap (dpy, upArrow); + if (downArrow) XFreePixmap (dpy, downArrow); + if (upArrowHi) XFreePixmap (dpy, upArrowHi); + if (downArrowHi) XFreePixmap (dpy, downArrowHi); #endif #ifdef RXVT_SCROLLBAR - if (topShadowGC) XFreeGC (xdisp, topShadowGC); - if (botShadowGC) XFreeGC (xdisp, botShadowGC); - if (scrollbarGC) XFreeGC (xdisp, scrollbarGC); + if (topShadowGC) XFreeGC (dpy, topShadowGC); + if (botShadowGC) XFreeGC (dpy, botShadowGC); + if (scrollbarGC) XFreeGC (dpy, scrollbarGC); #endif - if (gc) XFreeGC (xdisp, gc); + if (gc) XFreeGC (dpy, gc); delete drawable; // destroy all windows if (parent[0]) - XDestroyWindow (xdisp, parent[0]); + XDestroyWindow (dpy, parent[0]); for (int i = 0; i < TOTAL_COLORS; i++) if (ISSET_PIXCOLOR (i)) @@ -490,7 +490,7 @@ rxvt_term::init (int argc, const char *const *argv, stringvec *envv) scr_reset (); // initialize screen #if 0 - XSynchronize (xdisp, True); + XSynchronize (dpy, True); #endif #ifdef HAVE_SCROLLBARS @@ -500,7 +500,7 @@ rxvt_term::init (int argc, const char *const *argv, stringvec *envv) #ifdef TRANSPARENT if (OPTION (Opt_transparent)) { - XSelectInput (xdisp, display->root, PropertyChangeMask); + XSelectInput (dpy, display->root, PropertyChangeMask); check_our_parents (); rootwin_ev.start (display, display->root); } @@ -524,13 +524,13 @@ rxvt_term::init (int argc, const char *const *argv, stringvec *envv) { long info[2] = { 0, XEMBED_MAPPED }; - XChangeProperty (xdisp, parent[0], xa[XA_XEMBED_INFO], xa[XA_XEMBED_INFO], + XChangeProperty (dpy, parent[0], xa[XA_XEMBED_INFO], xa[XA_XEMBED_INFO], 32, PropModeReplace, (unsigned char *)&info, 2); } #endif - XMapWindow (xdisp, vt); - XMapWindow (xdisp, parent[0]); + XMapWindow (dpy, vt); + XMapWindow (dpy, parent[0]); return true; } @@ -737,10 +737,10 @@ rxvt_term::window_calc (unsigned int newwidth, unsigned int newheight) window_sb_x = szHint.width - sb_w; if (recalc_x) - szHint.x += DisplayWidth (xdisp, display->screen) - szHint.width - 2 * ext_bwidth; + szHint.x += DisplayWidth (dpy, display->screen) - szHint.width - 2 * ext_bwidth; if (recalc_y) - szHint.y += DisplayHeight (xdisp, display->screen) - szHint.height - 2 * ext_bwidth; + szHint.y += DisplayHeight (dpy, display->screen) - szHint.height - 2 * ext_bwidth; ncol = width / fwidth; nrow = height / fheight; @@ -853,7 +853,7 @@ rxvt_term::set_fonts () void rxvt_term::set_string_property (Atom prop, const char *str, int len) { - XChangeProperty (xdisp, parent[0], + XChangeProperty (dpy, parent[0], prop, XA_STRING, 8, PropModeReplace, (const unsigned char *)str, len >= 0 ? len : strlen (str)); } @@ -863,7 +863,7 @@ void rxvt_term::set_utf8_property (Atom prop, const char *str, int len) wchar_t *ws = rxvt_mbstowcs (str, len); char *s = rxvt_wcstoutf8 (ws); - XChangeProperty (xdisp, parent[0], + XChangeProperty (dpy, parent[0], prop, xa[XA_UTF8_STRING], 8, PropModeReplace, (const unsigned char *)s, strlen (s)); @@ -970,7 +970,7 @@ rxvt_term::recolour_cursor () ? pix_colors_focused[Color_pointer_bg] : pix_colors_focused[Color_bg]).get (bg); - XRecolorCursor (xdisp, TermWin_cursor, &fg, &bg); + XRecolorCursor (dpy, TermWin_cursor, &fg, &bg); } /*----------------------------------------------------------------------*/ @@ -1035,7 +1035,7 @@ rxvt_term::resize_all_windows (unsigned int newwidth, unsigned int newheight, in int old_height = szHint.height; window_calc (newwidth, newheight); - XSetWMNormalHints (xdisp, parent[0], &szHint); + XSetWMNormalHints (dpy, parent[0], &szHint); if (!ignoreparent) { @@ -1049,9 +1049,9 @@ rxvt_term::resize_all_windows (unsigned int newwidth, unsigned int newheight, in unsigned int unused_w1, unused_h1, unused_b1, unused_d1; Window unused_cr; - XTranslateCoordinates (xdisp, parent[0], display->root, + XTranslateCoordinates (dpy, parent[0], display->root, 0, 0, &x, &y, &unused_cr); - XGetGeometry (xdisp, parent[0], &unused_cr, &x1, &y1, + XGetGeometry (dpy, parent[0], &unused_cr, &x1, &y1, &unused_w1, &unused_h1, &unused_b1, &unused_d1); /* * if display->root isn't the parent window, a WM will probably have offset @@ -1063,8 +1063,8 @@ rxvt_term::resize_all_windows (unsigned int newwidth, unsigned int newheight, in y -= y1; } - x1 = (DisplayWidth (xdisp, display->screen) - old_width ) / 2; - y1 = (DisplayHeight (xdisp, display->screen) - old_height) / 2; + x1 = (DisplayWidth (dpy, display->screen) - old_width ) / 2; + y1 = (DisplayHeight (dpy, display->screen) - old_height) / 2; dx = old_width - szHint.width; dy = old_height - szHint.height; @@ -1078,10 +1078,10 @@ rxvt_term::resize_all_windows (unsigned int newwidth, unsigned int newheight, in else if (y == y1) /* exact center */ dy /= 2; - XMoveResizeWindow (xdisp, parent[0], x + dx, y + dy, + XMoveResizeWindow (dpy, parent[0], x + dx, y + dy, szHint.width, szHint.height); #else - XResizeWindow (xdisp, parent[0], szHint.width, szHint.height); + XResizeWindow (dpy, parent[0], szHint.width, szHint.height); #endif } @@ -1091,13 +1091,13 @@ rxvt_term::resize_all_windows (unsigned int newwidth, unsigned int newheight, in { if (scrollBar.state) { - XMoveResizeWindow (xdisp, scrollBar.win, + XMoveResizeWindow (dpy, scrollBar.win, window_sb_x, 0, scrollbar_TotalWidth (), szHint.height); resize_scrollbar (); } - XMoveResizeWindow (xdisp, vt, + XMoveResizeWindow (dpy, vt, window_vt_x, window_vt_y, width, height); @@ -1134,7 +1134,7 @@ rxvt_term::set_widthheight (unsigned int newwidth, unsigned int newheight) if (newwidth == 0 || newheight == 0) { - XGetWindowAttributes (xdisp, display->root, &wattr); + XGetWindowAttributes (dpy, display->root, &wattr); if (newwidth == 0) newwidth = wattr.width - szHint.base_width; @@ -1206,8 +1206,8 @@ rxvt_term::IMisRunning () if ((p = strchr (server + 1, '@')) != NULL) /* first one only */ *p = '\0'; - atom = XInternAtom (xdisp, server, False); - win = XGetSelectionOwner (xdisp, atom); + atom = XInternAtom (dpy, server, False); + win = XGetSelectionOwner (dpy, atom); if (win != None) return True; @@ -1441,7 +1441,7 @@ foundpet: fheight + 1, fheight - 1, fheight - 2, fheight + 2); - fs = XCreateFontSet (xdisp, rs[Rs_imFont] ? rs[Rs_imFont] : pat, + fs = XCreateFontSet (dpy, rs[Rs_imFont] ? rs[Rs_imFont] : pat, &missing_charset_list, &missing_charset_count, &def_string); if (missing_charset_list) @@ -1527,7 +1527,7 @@ foundpet: if (preedit_attr) XFree (preedit_attr); if (status_attr) XFree (status_attr); - if (fs) XFreeFontSet (xdisp, fs); + if (fs) XFreeFontSet (dpy, fs); if (Input_Context == NULL) {