sawfish r4373 - in trunk: . man src



Author: chrisb
Date: Sun Jan 18 20:12:19 2009
New Revision: 4373
URL: http://svn.gnome.org/viewvc/sawfish?rev=4373&view=rev

Log:
src/events.c: Iconify before repyfying (as requested by WM_HINTS) [Ian Zimmerman]


Modified:
   trunk/ChangeLog
   trunk/man/news.texi
   trunk/src/events.c

Modified: trunk/man/news.texi
==============================================================================
--- trunk/man/news.texi	(original)
+++ trunk/man/news.texi	Sun Jan 18 20:12:19 2009
@@ -32,6 +32,8 @@
 @item Fixed an "unknown remote error" that might appear [Alexey I. Froloff]
 
 @item Make "make uninstall" work again [Christopher Bratusek]
+
+ item Iconify before repyfying (as requested by WM_HINTS) [Ian Zimmerman]
 @end itemize
 
 @item New features:

Modified: trunk/src/events.c
==============================================================================
--- trunk/src/events.c	(original)
+++ trunk/src/events.c	Sun Jan 18 20:12:19 2009
@@ -747,19 +747,29 @@
     Lisp_Window *w = find_window_by_id (id);
     if (w == 0)
     {
-        /* Also adds the frame. */
+        /* The reason for doing this before the add is to give matchers
+         * a chance to do their thing and reverse the iconification,
+         * if the user desires.  There's a minor downside: rep doesn't
+         * know about this, so any hooks that might be operative for
+         * iconification don't get run, and there's no iconify sound.
+         * But it can be argued that this is the Right Thing anyway,
+         * since the hint was set outside of rep's watch too. */
+
+        XWMHints* wmhints = XGetWMHints(dpy, id);
+
+	if (wmhints && (wmhints->flags & StateHint) && wmhints->initial_state == IconicState)
+            XIconifyWindow(dpy, id, screen_num);
+        
+	if (wmhints)
+            XFree(wmhints);
+        
+	/* Also adds the frame. */
 	w = add_window (id);
 	if (w == 0)
 	{
 	    fprintf (stderr, "warning: failed to allocate a window\n");
 	    return;
 	}
-	if (w->wmhints && w->wmhints->flags & StateHint
-	    && w->wmhints->initial_state == IconicState)
-	{
-	    rep_call_lisp1 (module_symbol_value (rep_VAL (&iconify_mod),
-						 Qiconify_window), rep_VAL(w));
-	}
     }
     else
     {



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