? autom4te.cache
? metacity.spec
? scroll.patch
? stamp-h1
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/metacity/ChangeLog,v
retrieving revision 1.433
diff -u -r1.433 ChangeLog
--- ChangeLog	2002/09/04 12:19:05	1.433
+++ ChangeLog	2002/09/06 01:54:44
@@ -1,3 +1,9 @@
+2002-09-05  Sean Middleditch <elanthis@awesomeplay.com>
+
+	* src/frames.c (meta_frames_scroll_event): added the feature to
+	shade/unshade windows on mouse wheel scroll up/down on the window
+	title
+
 2002-09-04  Marius Andreiana <mandreiana@yahoo.com>
 
 	* configure.in: added 'ro' to ALL_LINGUAS
Index: src/frames.c
===================================================================
RCS file: /cvs/gnome/metacity/src/frames.c,v
retrieving revision 1.63
diff -u -r1.63 frames.c
--- src/frames.c	2002/09/04 02:21:26	1.63
+++ src/frames.c	2002/09/06 01:54:48
@@ -45,6 +45,8 @@
 
 static gboolean meta_frames_button_press_event    (GtkWidget           *widget,
                                                    GdkEventButton      *event);
+static gboolean meta_frames_scroll_event          (GtkWidget           *widget,
+                                                   GdkEventScroll      *event);
 static gboolean meta_frames_button_release_event  (GtkWidget           *widget,
                                                    GdkEventButton      *event);
 static gboolean meta_frames_motion_notify_event   (GtkWidget           *widget,
@@ -134,6 +136,7 @@
   widget_class->expose_event = meta_frames_expose_event;
   widget_class->destroy_event = meta_frames_destroy_event;  
   widget_class->button_press_event = meta_frames_button_press_event;
+  widget_class->scroll_event = meta_frames_scroll_event;
   widget_class->button_release_event = meta_frames_button_release_event;
   widget_class->motion_notify_event = meta_frames_motion_notify_event;
   widget_class->enter_notify_event = meta_frames_enter_notify_event;
@@ -1198,6 +1201,92 @@
                                   event->y_root,
                                   event->button,
                                   event->time);
+    }
+  
+  return TRUE;
+}
+
+static gboolean
+meta_frames_scroll_event (GtkWidget      *widget,
+                                GdkEventScroll *event)
+{
+  MetaUIFrame *frame;
+  MetaFrames *frames;
+  MetaFrameControl control;
+  
+  frames = META_FRAMES (widget);
+
+  /* Remember that the display may have already done something with this event.
+   * If so there's probably a GrabOp in effect.
+   */
+  
+  frame = meta_frames_lookup_window (frames, GDK_WINDOW_XID (event->window));
+  if (frame == NULL)
+    return FALSE;
+
+  clear_tip (frames);
+  
+  control = get_control (frames, frame, event->x, event->y);
+
+#if 0 /* do we want this? */
+  /* raise/focus on click, even if click was on client area */
+  if (event->button == 1 &&
+      !(control == META_FRAME_CONTROL_MINIMIZE ||
+        control == META_FRAME_CONTROL_DELETE))
+    {
+      meta_core_user_raise (gdk_display,
+                            frame->xwindow);
+      meta_topic (META_DEBUG_FOCUS,
+                  "Focusing window with frame 0x%lx due to button 1 press\n",
+                  frame->xwindow);
+      meta_core_user_focus (gdk_display,
+                            frame->xwindow,
+                            event->time);      
+    }
+#endif
+
+  /* don't do the rest of this if on client area */
+  if (control == META_FRAME_CONTROL_CLIENT_AREA)
+    return FALSE; /* not on the frame, just passed through from client */
+  
+  /* We want to shade even if we have a GrabOp, since we'll have a move grab
+   * if we double click the titlebar.
+   */
+  if (control == META_FRAME_CONTROL_TITLE &&
+      event->direction == GDK_SCROLL_UP)
+    {
+      MetaFrameFlags flags;
+      
+      flags = meta_core_get_frame_flags (gdk_display, frame->xwindow);
+
+      if (flags & META_FRAME_ALLOWS_SHADE)
+        {
+          if ((flags & META_FRAME_SHADED) == 0)
+            meta_core_shade (gdk_display,
+                             frame->xwindow);
+        }
+
+      return TRUE;
+    }
+  
+  /* We want to shade even if we have a GrabOp, since we'll have a move grab
+   * if we double click the titlebar.
+   */
+  if (control == META_FRAME_CONTROL_TITLE &&
+      event->direction == GDK_SCROLL_DOWN)
+    {
+      MetaFrameFlags flags;
+      
+      flags = meta_core_get_frame_flags (gdk_display, frame->xwindow);
+
+      if (flags & META_FRAME_ALLOWS_SHADE)
+        {
+          if (flags & META_FRAME_SHADED)
+            meta_core_unshade (gdk_display,
+                               frame->xwindow);
+        }
+
+      return TRUE;
     }
   
   return TRUE;
