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

windowmaker patches



some patches to make windowmaker work better.  wondering if other people
have seen these problems and if this fixes them for you too.  patches
originally come from debian. (what a pain it is actually extracting stuff.
as far as i can tell, they only have one big patch per package, with no
changelog, so the only way to find the patch i wanted was diffing two
versions of their patch, which i'd only heard about via word of mouth.)

since a new release of windowmaker doesn't seem likely before 3.4, i think
it'd be nice to roll these fixes in.

actions.c and event.c: fix a bug interacting with gtk2 apps.  this would
appear as focus flickering between two windows, or gtk2 apps stealing
focus.  i saw it all the time with gaim.  this is fixed in windowaker
current.

workspace.c:  sometimes if a window opens on a another workspace, you will
lose focus.  i see this starting opera, where it's set to start on
workspace 2.  suddenly, no app has focus and keyboard shortcuts don't
work, and i have to roll the mouse around in and out of windows until
something gets focus.  this only happens occasionally, but this fix seems
to correct it.  this is not yet corrected in windowmaker cvs.



patch-src_actions_c
--- src/actions.c	Mon Aug 11 15:29:31 2003
+++ src/actions.c	Mon Aug 11 15:31:56 2003
@@ -144,6 +144,14 @@
       old_scr=scr;
     old_focused=old_scr->focused_window;

+    /*
+     * Safeguard: make sure the timestamp is monotonically increasing
+     * (very unlikely that this will be needed, still a safeguard)
+     */
+    if (timestamp <= LastFocusChange)
+	    timestamp = LastFocusChange + 1;
+
+
     LastFocusChange = timestamp;

 /*
@@ -150,8 +158,8 @@
  * This is a hack, because XSetInputFocus() should have a proper
  * timestamp instead of CurrentTime but it seems that some times
  * clients will not receive focus properly that way.
+ */
     if (ignoreTimestamp)
-*/
       timestamp = CurrentTime;

     if (old_focused)


patch-src_event_c
--- src/event.c	Mon Aug 11 15:29:31 2003
+++ src/event.c	Mon Aug 11 15:32:06 2003
@@ -402,7 +402,6 @@
 static void
 saveTimestamp(XEvent *event)
 {
-    LastTimestamp = CurrentTime;

     switch (event->type) {
      case ButtonRelease:

patch-src_workspace_c
--- src/workspace.c	Mon Aug 11 15:29:33 2003
+++ src/workspace.c	Mon Aug 11 15:33:33 2003
@@ -574,10 +574,12 @@
                               &foo, &foo, &foo, &foo, &mask)) {
 		tmp = wWindowFor(win);
 	    }
-	    if (!tmp && wPreferences.focus_mode == WKF_SLOPPY) {
-		wSetFocusTo(scr, foc);
-	    } else {
-		wSetFocusTo(scr, tmp);
+	    if (!tmp) {
+		if (wPreferences.focus_mode == WKF_SLOPPY) {
+		    wSetFocusTo(scr, foc);
+	        } else {
+		    wSetFocusTo(scr, tmp);
+		}
 	    }
 	}
     }



-- 
we don't run washington and no one really does