summary refs log tree commit diff
path: root/screen.c
diff options
context:
space:
mode:
authoroga <oga>2008-09-22 14:15:03 +0000
committeroga <oga>2008-09-22 14:15:03 +0000
commit61601991b5151be7500cf7581b303b7f12ddb905 (patch)
treee5947cccefbe32d49130a7a8c80c7d808853988b /screen.c
parenta0082c58a4a95d05f452cfa3da7eaf4e1eb17dba (diff)
downloadcwm-61601991b5151be7500cf7581b303b7f12ddb905.tar.gz
cwm-61601991b5151be7500cf7581b303b7f12ddb905.tar.xz
cwm-61601991b5151be7500cf7581b303b7f12ddb905.zip
Display the current window title not a previous one in the case of
``show all'' in the window search dialogue. Noticed and diff from Tim
van der Molen, thanks!
Diffstat (limited to 'screen.c')
-rw-r--r--screen.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/screen.c b/screen.c
index c03003d..70ee0db 100644
--- a/screen.c
+++ b/screen.c
@@ -67,3 +67,28 @@ screen_updatestackingorder(void)
 
 	XFree(wins);
 }
+
+void
+screen_init_xinerama(struct screen_ctx *sc)
+{
+	XineramaScreenInfo *info;
+	int no, fake;
+
+	if (HasXinerama == 0 || XineramaIsActive(X_Dpy) == 0) {
+		HasXinerama = 0;
+		sc->xinerama_no = 0;
+	}
+		
+	info = XineramaQueryScreens(X_Dpy, &no);
+	if (info == NULL) {
+		/*is xinerama is actually off, instead of a malloc failure? */
+		if (sc->xinerama == NULL)
+			HasXinerama = NULL;
+		return;
+	}
+
+	if (sc->xinerama != NULL)
+		XFree(sc->xinerama);
+	sc->xinerama = info;
+	sc->xinerama_no = no;
+}