LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File xscreensaver-override_redirect.patch of Package xscreensaver (Project home:zhy20120210:failed_1)

# raises screensaver window over any override_redirect windows 
# while the screen is locked
--- driver/timers.c.orig	2005-11-28 11:14:22.000000000 +0100
+++ driver/timers.c	2008-03-03 14:08:48.467840513 +0100
@@ -922,6 +922,60 @@
 
 	break;
 
+	/* Map-/ConfigureNotify events w/ override redirect flag set 
+	 * usually cause some window to appear above screensaver
+	 * so we raise preventively, unless the event comes from 
+	 * another of our own windows (e.g. one running on a different 
+	 * screen)
+	 */
+	  case MapNotify:
+	if( (si->screen_blanked_p) && event.xmap.override_redirect ) 
+	  {
+		int ii,rr=TRUE;
+		for (ii = 0; ii < si->nscreens; ii++) {
+			if (si->screens[ii].screensaver_window==event.xmap.window) {
+				rr=FALSE;
+				break;
+			}
+		}
+		if (p->debug_p) {
+			fprintf (stderr, "MapNotify w/ override redirect from 0x%x received",event.xmap.window);
+		}
+		if(rr==TRUE) { 
+			if (p->debug_p) { fprintf (stderr, ", raising unconditionally.\n"); }
+			raise_window (si, True, True, True);
+		}
+		else if (p->debug_p) {
+			fprintf (stderr, " - xscreensaver on screen #%u - not raising.\n",
+				si->screens[ii].real_screen_number);
+		}
+	  }
+	break;
+
+	  case ConfigureNotify:
+	if( (si->screen_blanked_p) && event.xconfigure.override_redirect ) 
+	  {
+		int ii,rr=TRUE;
+		for (ii = 0; ii < si->nscreens; ii++) {
+			if(si->screens[ii].screensaver_window==event.xconfigure.window) {
+				rr=FALSE;
+				break;
+			}
+		}
+		if (p->debug_p) {
+			fprintf (stderr, "ConfigureNotify event w/ override redirect from 0x%x received",event.xconfigure.window);
+		}
+		if(rr==TRUE) { 
+			if (p->debug_p) { fprintf (stderr, ", raising unconditionally.\n"); }
+			raise_window (si, True, True, True);
+		}
+		else if (p->debug_p) {
+			fprintf (stderr, " - xscreensaver on screen #%u - not raising.\n",
+				si->screens[ii].real_screen_number);
+		}
+	  }
+	break;
+      
       default:
 
 #ifdef HAVE_MIT_SAVER_EXTENSION