diff options
author | bjs <bjs@pkgsrc.org> | 2007-12-19 05:43:27 +0000 |
---|---|---|
committer | bjs <bjs@pkgsrc.org> | 2007-12-19 05:43:27 +0000 |
commit | 3f1dd4ea9fe6da3e88a28ff8951ed58bce8198d7 (patch) | |
tree | 92de4ad8f5e11f5622dca2100bd1d9eb5f9224d9 /x11/xcompmgr | |
parent | 3c45262ecd9d28574959a046e1fbe9ecc47a988e (diff) | |
download | pkgsrc-3f1dd4ea9fe6da3e88a28ff8951ed58bce8198d7.tar.gz |
Add some fixes from GIT and bump revision. Tested with
xorg-server-1.4.0.90 + Mesa-7.0.2 by me. Mesa's coming, I promise. ;)
While here, PKG_SKIP_REASON -> PKG_FAIL_REASON, add various preprocessor
definitions to XCOMPMGR_DEFS for the user to play with (sane defaults
have been tested).
Changes include:
Constified some variables.
Include getopt.h for getopt(). (in pkgsrc, this uses USE_FEATURES)
Fixed a bunch of warnings.
Bug #9762: Fix opacity changes on unmapped windows.
Diffstat (limited to 'x11/xcompmgr')
-rw-r--r-- | x11/xcompmgr/DESCR | 4 | ||||
-rw-r--r-- | x11/xcompmgr/Makefile | 18 | ||||
-rw-r--r-- | x11/xcompmgr/distinfo | 3 | ||||
-rw-r--r-- | x11/xcompmgr/patches/patch-aa | 263 |
4 files changed, 285 insertions, 3 deletions
diff --git a/x11/xcompmgr/DESCR b/x11/xcompmgr/DESCR index bf8de66899d..bf121f45d10 100644 --- a/x11/xcompmgr/DESCR +++ b/x11/xcompmgr/DESCR @@ -1,3 +1,7 @@ xcompmgr is a sample compositing manager for X servers supporting the XFIXES, DAMAGE, and COMPOSITE extensions. It enables basic eye-candy effects. + +NOTE: Running it with -FfCc gives nice-looking results. Do not try this +without switching from XAA to EXA acceleration! The composite +extension is virtually unusable with XAA. diff --git a/x11/xcompmgr/Makefile b/x11/xcompmgr/Makefile index c7689cf30dc..ab1a4c9181a 100644 --- a/x11/xcompmgr/Makefile +++ b/x11/xcompmgr/Makefile @@ -1,7 +1,8 @@ -# $NetBSD: Makefile,v 1.20 2007/07/13 18:01:16 drochner Exp $ +# $NetBSD: Makefile,v 1.21 2007/12/19 05:43:30 bjs Exp $ # DISTNAME= xcompmgr-1.1.3 +PKGREVISION= 1 CATEGORIES= x11 MASTER_SITES= http://xapps.freedesktop.org/release/ @@ -13,12 +14,25 @@ PKG_DESTDIR_SUPPORT= user-destdir USE_TOOLS+= pkg-config GNU_CONFIGURE= yes +USE_FEATURES= getopt_long + +### XXX You may play around with these if you like; they're simply +### the #defines from xcompmgr.c placed here for your convenience. +# +XCOMPMGR_DEFS+= -DREPAINT_MONITOR=0 # default: 0 (?) +XCOMPMGR_DEFS+= -DCAN_DO_USABLE=1 # default: 0 (damage notification) +XCOMPMGR_DEFS+= -DDEBUG_REPAINT=0 # default: 0 (debugging) +XCOMPMGR_DEFS+= -DDEBUG_REPAINT=0 # default: 0 (debugging) +XCOMPMGR_DEFS+= -DSHADOWS=1 # default: 1 (shadow support) +XCOMPMGR_DEFS+= -DSHARP_SHADOW=0 # default 0 (?) + +CPPFLAGS+= ${XCOMPMGR_DEFS} .include "../../mk/bsd.prefs.mk" .if defined(X11_TYPE) && !empty(X11_TYPE:MXFree86) || \ defined(X11_TYPE) && !empty(X11_TYPE:Mnative) || !defined(X11_TYPE) -PKG_SKIP_REASON+= "This package is exclusively for X.org." +PKG_FAIL_REASON+= "This package is exclusively for X.org." .endif .include "../../x11/compositeproto/buildlink3.mk" diff --git a/x11/xcompmgr/distinfo b/x11/xcompmgr/distinfo index f06557724e8..7815c886912 100644 --- a/x11/xcompmgr/distinfo +++ b/x11/xcompmgr/distinfo @@ -1,5 +1,6 @@ -$NetBSD: distinfo,v 1.4 2007/07/13 18:01:16 drochner Exp $ +$NetBSD: distinfo,v 1.5 2007/12/19 05:43:30 bjs Exp $ SHA1 (xcompmgr-1.1.3.tar.gz) = d7600dbec8fe812f5a46772c67731dca83c7bf83 RMD160 (xcompmgr-1.1.3.tar.gz) = 65c7c045a0c1361b0dfa346cdc73439ad0db0f2c Size (xcompmgr-1.1.3.tar.gz) = 79840 bytes +SHA1 (patch-aa) = 1f12076c066922363b65744263605c257b1911e4 diff --git a/x11/xcompmgr/patches/patch-aa b/x11/xcompmgr/patches/patch-aa new file mode 100644 index 00000000000..237a1b47f73 --- /dev/null +++ b/x11/xcompmgr/patches/patch-aa @@ -0,0 +1,263 @@ +$NetBSD: patch-aa,v 1.1 2007/12/19 05:43:30 bjs Exp $ + +--- xcompmgr.c.orig 2005-10-06 20:08:02.000000000 -0400 ++++ xcompmgr.c +@@ -36,6 +36,13 @@ + #include <sys/time.h> + #include <time.h> + #include <unistd.h> ++#if defined(HAVE_NBCOMPAT_H) ++#include <nbcompat/config.h> ++#include <nbcompat/cdefs.h> ++#include <nbcompat/getopt.h> ++#else ++#include <getopt.h> ++#endif + #include <X11/Xlib.h> + #include <X11/Xutil.h> + #include <X11/Xatom.h> +@@ -47,7 +54,9 @@ + #define HAS_NAME_WINDOW_PIXMAP 1 + #endif + ++#ifndef CAN_DO_USABLE + #define CAN_DO_USABLE 0 ++#endif + + typedef struct _ignore { + struct _ignore *next; +@@ -153,12 +162,22 @@ conv *gaussianMap; + + #define TRANS_OPACITY 0.75 + ++#ifndef DEBUG_REPAINT + #define DEBUG_REPAINT 0 ++#endif ++#ifndef DEBUG_EVENTS + #define DEBUG_EVENTS 0 ++#endif ++#ifndef MONITOR_REPAINT + #define MONITOR_REPAINT 0 ++#endif + ++#ifndef SHADOWS + #define SHADOWS 1 ++#endif ++#ifndef SHARP_SHADOW + #define SHARP_SHADOW 0 ++#endif + + typedef enum _compMode { + CompSimple, /* looks like a regular X server */ +@@ -320,7 +339,7 @@ void + run_fades (Display *dpy) + { + int now = get_time_in_milliseconds(); +- fade *f, *next; ++ fade *next = fades; + int steps; + Bool need_dequeue; + +@@ -330,8 +349,10 @@ run_fades (Display *dpy) + if (fade_time - now > 0) + return; + steps = 1 + (now - fade_time) / fade_delta; +- for (next = fades; f = next; ) ++ ++ while (next) + { ++ fade *f = next; + win *w = f->w; + next = f->next; + f->cur += f->step * steps; +@@ -625,9 +646,7 @@ shadow_picture (Display *dpy, double opa + { + XImage *shadowImage; + Pixmap shadowPixmap; +- Pixmap finalPixmap; + Picture shadowPicture; +- Picture finalPicture; + GC gc; + + shadowImage = make_shadow (dpy, opacity, width, height); +@@ -753,7 +772,7 @@ find_win (Display *dpy, Window id) + return 0; + } + +-static char *backgroundProps[] = { ++static const char *backgroundProps[] = { + "_XROOTPMAP_ID", + "_XSETROOT_ID", + 0, +@@ -1165,11 +1184,13 @@ repair_win (Display *dpy, win *w) + w->damaged = 1; + } + ++static unsigned int ++get_opacity_prop (Display *dpy, win *w, unsigned int def); ++ + static void + map_win (Display *dpy, Window id, unsigned long sequence, Bool fade) + { + win *w = find_win (dpy, id); +- Drawable back; + + if (!w) + return; +@@ -1179,6 +1200,10 @@ map_win (Display *dpy, Window id, unsign + /* This needs to be here or else we lose transparency messages */ + XSelectInput (dpy, id, PropertyChangeMask); + ++ /* This needs to be here since we don't get PropertyNotify when unmapped */ ++ w->opacity = get_opacity_prop (dpy, w, OPAQUE); ++ determine_mode (dpy, w); ++ + #if CAN_DO_USABLE + w->damage_bounds.x = w->damage_bounds.y = 0; + w->damage_bounds.width = w->damage_bounds.height = 0; +@@ -1332,7 +1357,6 @@ determine_mode(Display *dpy, win *w) + { + int mode; + XRenderPictFormat *format; +- unsigned int default_opacity; + + /* if trans prop == -1 fall back on previous tests*/ + +@@ -1467,10 +1491,7 @@ add_win (Display *dpy, Window id, Window + new->borderClip = None; + new->prev_trans = 0; + +- /* moved mode setting to one place */ +- new->opacity = get_opacity_prop (dpy, new, OPAQUE); + new->windowType = determine_wintype (dpy, new->id); +- determine_mode (dpy, new); + + new->next = *p; + *p = new; +@@ -1512,7 +1533,6 @@ static void + configure_win (Display *dpy, XConfigureEvent *ce) + { + win *w = find_win (dpy, ce->window); +- Window above; + XserverRegion damage = None; + + if (!w) +@@ -1599,7 +1619,7 @@ finish_destroy_win (Display *dpy, Window + for (prev = &list; (w = *prev); prev = &w->next) + if (w->id == id) + { +- if (!gone) ++ if (gone) + finish_unmap_win (dpy, w); + *prev = w->next; + if (w->picture) +@@ -1734,7 +1754,7 @@ static int + error (Display *dpy, XErrorEvent *ev) + { + int o; +- char *name = 0; ++ const char *name = 0; + + if (should_ignore (dpy, ev->serial)) + return 0; +@@ -1766,7 +1786,7 @@ error (Display *dpy, XErrorEvent *ev) + default: break; + } + +- printf ("error %d request %d minor %d serial %d\n", ++ printf ("error %d request %d minor %d serial %lu\n", + ev->error_code, ev->request_code, ev->minor_code, ev->serial); + + /* abort (); this is just annoying to most people */ +@@ -1781,7 +1801,7 @@ expose_root (Display *dpy, Window root, + add_damage (dpy, region); + } + +- ++#if DEBUG_EVENTS + static int + ev_serial (XEvent *ev) + { +@@ -1790,7 +1810,6 @@ ev_serial (XEvent *ev) + return NextRequest (ev->xany.display); + } + +- + static char * + ev_name (XEvent *ev) + { +@@ -1834,11 +1853,12 @@ ev_window (XEvent *ev) + return 0; + } + } ++#endif + + void + usage (char *program) + { +- fprintf (stderr, "%s v1.1.2\n", program); ++ fprintf (stderr, "%s v1.1.3\n", program); + fprintf (stderr, "usage: %s [options]\n", program); + fprintf (stderr, "Options\n"); + fprintf (stderr, " -d display\n Specifies which display should be managed.\n"); +@@ -1861,15 +1881,21 @@ usage (char *program) + } + + static void +-give_me_a_name (void) ++register_cm (void) + { + Window w; ++ Atom a; + + w = XCreateSimpleWindow (dpy, RootWindow (dpy, 0), 0, 0, 1, 1, 0, None, + None); + + Xutf8SetWMProperties (dpy, w, "xcompmgr", "xcompmgr", NULL, 0, NULL, NULL, + NULL); ++ ++ /* FIXME: Don't hard code the screen number */ ++ a = XInternAtom (dpy, "_NET_WM_CM_S0", False); ++ ++ XSetSelectionOwner (dpy, a, w, 0); + } + + int +@@ -1878,19 +1904,13 @@ main (int argc, char **argv) + XEvent ev; + Window root_return, parent_return; + Window *children; +- Pixmap transPixmap; +- Pixmap blackPixmap; + unsigned int nchildren; + int i; + XRenderPictureAttributes pa; +- XRenderColor c; + XRectangle *expose_rects = 0; + int size_expose = 0; + int n_expose = 0; + struct pollfd ufd; +- int n; +- int last_update; +- int now; + int p; + int composite_major, composite_minor; + char *display = 0; +@@ -1999,7 +2019,7 @@ main (int argc, char **argv) + exit (1); + } + +- give_me_a_name(); ++ register_cm(); + + /* get atoms */ + opacityAtom = XInternAtom (dpy, OPACITY_PROP, False); +@@ -2071,7 +2091,7 @@ main (int argc, char **argv) + } + + XNextEvent (dpy, &ev); +- if (ev.type & 0x7f != KeymapNotify) ++ if ((ev.type & 0x7f) != KeymapNotify) + discard_ignore (dpy, ev.xany.serial); + #if DEBUG_EVENTS + printf ("event %10.10s serial 0x%08x window 0x%08x\n", |