Re: decisions about applying patches



On Sun, Jul 29, 2007 at 02:04:17PM +0200, Janek Kozicki wrote:
> 
> Michal can you please send those 4 patches here to the list, along
> with some comment?

The one which is described "Avoid saving poperties for the desktop
window" was posted by Luis Rodrigo Gallardo Cruz on 16 Aug 2006
so I guess this is a part of his "Debian set".

Harald van Dijk posted  on 12 Aug 2006 "Don't grab focus on  KDE
menus".  He asked about sanity of that patch.  It looks to me
reasonably sane but possibly can use more testing especially
from those who are using sawfish with KDE.

Philip Langdale provided on 03 Oct 2006 "make window to draw
properly with transparent pieces" one.

And "some mice have tons of buttons" was posted by Jeremy Bryan
Smith on 10 Oct 2006.

I can say only that they look reasonable to me and I did not
observe anything to blow up.  You need such "monster mice" to
really test the fourth.

Those four are attached.

   Michal
#! /bin/sh /usr/share/dpatch/dpatch-run
## dontSaveDesktopSize.dpatch by  <rodrigo caribdis nul-unu com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Avoid saving poperties for the desktop window (Nautilus' for example)

@DPATCH@
diff -urNad sawfish~/lisp/sawfish/wm/session/save.jl sawfish/lisp/sawfish/wm/session/save.jl
--- sawfish~/lisp/sawfish/wm/session/save.jl	2001-01-28 19:34:37.000000000 -0600
+++ sawfish/lisp/sawfish/wm/session/save.jl	2006-08-03 21:33:36.683410698 -0500
@@ -73,6 +73,7 @@
 		      (user-login-name) (system-name)
 		      sawfish-version (current-time-string))
 	      (map-windows (lambda (w)
-			     (sm-print-alist file (sm-get-window-state w))))
+                             (and (not (desktop-window-p w))
+                              (sm-print-alist file (sm-get-window-state w)))))
 	      t)
 	  (close-file file))))))
--- sawfish/src/events.c.focus	2006-05-31 23:29:03.000000000 -0600
+++ sawfish/src/events.c	2006-12-27 10:58:45.000000000 -0700
@@ -953,13 +953,16 @@ static void
 focus_out (XEvent *ev)
 {
     Lisp_Window *w = find_window_by_id (ev->xfocus.window);
-    if (ev->xfocus.detail == NotifyPointer)
+    if (ev->xfocus.detail == NotifyPointer ||
+	ev->xfocus.mode == NotifyGrab || ev->xfocus.mode == NotifyUngrab)
 	return;
     if (w != 0 && ev->xfocus.detail != NotifyInferior)
     {
 	if (focus_window == w)
 	{
-	    focus_window = 0;
+	    if (ev->xfocus.mode == NotifyNormal || \
+		ev->xfocus.mode == NotifyWhileGrabbed)
+		focus_window = 0;
 	    report_focus_change (w);
 	}
 
--- sawfish/src/frames.c.alpha	2006-05-31 23:29:03.000000000 -0600
+++ sawfish/src/frames.c	2006-12-27 11:15:36.000000000 -0700
@@ -322,6 +322,34 @@ apply_mask (Drawable dest, int x_off, in
     }
 }
 
+/* Replacement for XCopyArea that ensures the alpha value is 0xFF when
+   copying a 24bit drawable. 32bit drawables are assumed to contain a
+   meaningful alpha channel already - and smaller bit depths have no
+   alpha at all. */
+static void
+copy_area_set_alpha(Drawable src, Drawable dest, GC gc,
+		    int src_x, int src_y,
+		    unsigned int width, unsigned int height,
+		    int dest_x, int dest_y)
+{
+    XImage *image = XGetImage (dpy, src, src_x, src_y, width, height,
+			       AllPlanes, ZPixmap);
+    if (image->depth == 24) {
+	unsigned int i;
+
+	for (i = image->byte_order == LSBFirst ? 3 : 0;
+	     i < height * image->bytes_per_line; i +=4) {
+	    image->data[i] = 0xFF;
+	}
+	XPutImage(dpy, dest, gc, image, src_x, src_y, dest_x, dest_y,
+		  width, height);
+    } else {
+	XCopyArea(dpy, src, dest, gc, src_x, src_y, width, height,
+		  dest_x, dest_y);
+    }
+    XDestroyImage(image);
+}
+
 /* Construct the frame window's shape mask from the union of all
    individual shapes (frame parts and the client window, if appropriate).
    If ATOMIC is true, then the frame shape is changed _once_ only, using
@@ -534,7 +562,7 @@ set_frame_part_bg (struct frame_part *fp
 	if (bg != fp->drawn.bg)
 	{
 	    XGCValues gcv;
-	    gcv.foreground = VCOLOR(bg)->pixel;
+	    gcv.foreground = VCOLOR(bg)->pixel | (0xFF << 24);
 	    XChangeGC (dpy, fp->gc, GCForeground, &gcv);
 	    XFillRectangle (dpy, fp->id, fp->gc, 0, 0, fp->width, fp->height);
 	    fp->drawn.bg = bg;
@@ -585,8 +613,8 @@ set_frame_part_bg (struct frame_part *fp
 
 	if (!tiled)
 	{
-	    XCopyArea (dpy, bg_pixmap, fp->id, fp->gc, 0, 0,
-		       fp->width, fp->height, 0, 0);
+	  copy_area_set_alpha(bg_pixmap, fp->id, fp->gc, 0, 0,
+			      fp->width, fp->height, 0, 0);
 	    if (bg_mask != 0)
 	    {
 		XShapeCombineMask (dpy, fp->id, ShapeBounding,
@@ -622,8 +650,8 @@ set_frame_part_bg (struct frame_part *fp
 		int height = image_height (image);
 		while (x < fp->width)
 		{
-		    XCopyArea (dpy, bg_pixmap, fp->id, fp->gc,
-			       0, 0, width, height, x, y);
+		  copy_area_set_alpha (bg_pixmap, fp->id, fp->gc,
+				       0, 0, width, height, x, y);
 		    if (bg_mask != 0)
 		    {
 			XShapeCombineMask (dpy, tem, ShapeBounding,
@@ -792,9 +820,9 @@ set_frame_part_fg (struct frame_part *fp
 		}
 
 		XChangeGC (dpy, fp->gc, gcv_mask, &gcv);
-		XCopyArea (dpy, fg_pixmap, fp->id, fp->gc,
-			   0, 0, MIN(fp->width, width),
-			   MIN(fp->height, height), x, y);
+		copy_area_set_alpha (fg_pixmap, fp->id, fp->gc,
+				     0, 0, MIN(fp->width, width),
+				     MIN(fp->height, height), x, y);
 		if (fg_mask)
 		{
 		    gcv.clip_mask = None;
--- sawfish/src/ChangeLog.alpha	2006-05-31 23:29:02.000000000 -0600
+++ sawfish/src/ChangeLog	2006-12-27 11:06:24.000000000 -0700
@@ -1,3 +1,10 @@
+2006-09-30  Philip Langdale  <philipl overt org>
+
+       * frames.c (set_frame_part_bg, set_frame_part_fg, copy_area_set_alpha):
+       Ensure that the alpha channel is set correctly for frame elements
+       when ARGB visuals are used. Otherwise, they end up being 100%
+       transparent.
+
 2006-05-15  John Harper  <jsh unfactored org>
 
 	* frames.c, events.c: merged changes from Philip Langdale to
--- sawfish/src/keys.h.13buttons	2004-12-06 15:52:30.000000000 -0700
+++ sawfish/src/keys.h	2006-12-27 11:20:28.000000000 -0700
@@ -105,6 +105,38 @@ enum {
 # define Button9Mask (1<<16)
 #endif
 
+#ifndef Button10
+# define Button10 10
+#endif
+#ifndef Button10Mask
+# define Button10Mask (1<<17)
+#endif
+
+#ifndef Button11
+# define Button11 11
+#endif
+#ifndef Button11Mask
+# define Button11Mask (1<<18)
+#endif
+
+
+#ifndef Button12
+# define Button12 12
+#endif
+#ifndef Button12Mask
+# define Button12Mask (1<<19)
+#endif
+
+
+#ifndef Button13
+# define Button13 13
+#endif
+#ifndef Button13Mask
+# define Button13Mask (1<<20)
+#endif
+
+
+
 #if !defined (Button6)
 # define EV_MOD_BUTTON_MASK (Button1Mask | Button2Mask | Button3Mask \
 			     | Button4Mask | Button5Mask)
@@ -119,10 +151,31 @@ enum {
 # define EV_MOD_BUTTON_MASK (Button1Mask | Button2Mask | Button3Mask \
 			     | Button4Mask | Button5Mask | Button6Mask \
                              | Button7Mask | Button8Mask)
-#else
+#elif !defined (Button10)
 # define EV_MOD_BUTTON_MASK (Button1Mask | Button2Mask | Button3Mask \
 			     | Button4Mask | Button5Mask | Button6Mask \
 			     | Button7Mask | Button8Mask | Button9Mask)
+#elif !defined (Button11)
+# define EV_MOD_BUTTON_MASK (Button1Mask | Button2Mask | Button3Mask \
+			     | Button4Mask | Button5Mask | Button6Mask \
+			     | Button7Mask | Button8Mask | Button9Mask \
+			     | Button10Mask)
+#elif !defined (Button12)
+# define EV_MOD_BUTTON_MASK (Button1Mask | Button2Mask | Button3Mask \
+			     | Button4Mask | Button5Mask | Button6Mask \
+			     | Button7Mask | Button8Mask | Button9Mask \
+			     | Button10Mask | Button11Mask)
+#elif !defined (Button13)
+# define EV_MOD_BUTTON_MASK (Button1Mask | Button2Mask | Button3Mask \
+			     | Button4Mask | Button5Mask | Button6Mask \
+			     | Button7Mask | Button8Mask | Button9Mask \
+			     | Button10Mask | Button11Mask | Button12Mask)
+#else
+# define EV_MOD_BUTTON_MASK (Button1Mask | Button2Mask | Button3Mask \
+			     | Button4Mask | Button5Mask | Button6Mask \
+			     | Button7Mask | Button8Mask | Button9Mask \
+			     | Button10Mask | Button11Mask | Button12Mask \
+			     | Button13Mask)
 #endif
 
 
--- sawfish/src/keys.c.13buttons	2006-12-26 15:51:31.000000000 -0700
+++ sawfish/src/keys.c	2006-12-27 11:20:28.000000000 -0700
@@ -97,7 +97,7 @@ DEFSYM(super_keysyms, "super-keysyms");
 static void grab_keymap_event (repv km, long code, long mods, bool grab);
 static void grab_all_keylist_events (repv map, bool grab);
 
-static int all_buttons[9] = { Button1, Button2, Button3, Button4, Button5, Button6, Button7, Button8, Button9 };
+static int all_buttons[13] = { Button1, Button2, Button3, Button4, Button5, Button6, Button7, Button8, Button9, Button10, Button11, Button12, Button13 };
 
 /* locks: currently LockMask, num_lock, and scroll_lock */
 static int total_lock_combs, all_lock_mask;
@@ -275,6 +275,18 @@ translate_event(u_long *code, u_long *mo
 	case Button9:
 	    *mods |= Button9Mask;
 	    break;
+	case Button10:
+	    *mods |= Button10Mask;
+	    break;
+	case Button11:
+	    *mods |= Button11Mask;
+	    break;
+	case Button12:
+	    *mods |= Button12Mask;
+	    break;
+	case Button13:
+	    *mods |= Button13Mask;
+	    break;
 	}
 	ret = TRUE;
 	break;
@@ -350,6 +362,10 @@ translate_event_to_x_button (repv ev, u_
 	    { Button7, Button7Mask },
 	    { Button8, Button8Mask },
 	    { Button9, Button9Mask },
+	    { Button10, Button10Mask },
+	    { Button11, Button11Mask },
+	    { Button12, Button12Mask },
+	    { Button13, Button13Mask },
 	    { 0, 0 }
 	};
 	int i;
@@ -677,6 +693,10 @@ static struct key_def default_mods[] = {
     { "Button7",  Button7Mask },
     { "Button8",  Button8Mask },
     { "Button9",  Button9Mask },
+    { "Button10", Button10Mask},
+    { "Button11", Button11Mask},
+    { "Button12", Button12Mask},
+    { "Button13", Button13Mask},
     { "Any",      EV_MOD_ANY },
     { "Release",  EV_MOD_RELEASE },
     { 0, 0 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]