about summary refs log tree commit diff
path: root/screen.c
diff options
context:
space:
mode:
authorokan <okan>2012-07-06 14:18:00 +0000
committerokan <okan>2012-07-06 14:18:00 +0000
commitcb893d0aa96e0a3e86cbd1094206871b10d92cd0 (patch)
tree827460ad7b1986d1880c7c2497a6a4f2358eef38 /screen.c
parent315f25f7aba3eb416757465a55b487289d8f8c27 (diff)
downloadcwm-cb893d0aa96e0a3e86cbd1094206871b10d92cd0.tar.gz
cwm-cb893d0aa96e0a3e86cbd1094206871b10d92cd0.tar.xz
cwm-cb893d0aa96e0a3e86cbd1094206871b10d92cd0.zip
querying for Xinerama should be done per display, not per screen, so
move chuck to display init; allows some shuffling to occur limiting
screen_init_xinerama()'s scope while keeping order intact.
Diffstat (limited to 'screen.c')
-rw-r--r--screen.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/screen.c b/screen.c
index 2285257..dd7eb0e 100644
--- a/screen.c
+++ b/screen.c
@@ -30,6 +30,8 @@
 
 #include "calmwm.h"
 
+static void	 screen_init_xinerama(struct screen_ctx *);
+
 struct screen_ctx *
 screen_fromroot(Window rootwin)
 {
@@ -65,6 +67,10 @@ screen_updatestackingorder(struct screen_ctx *sc)
 	XFree(wins);
 }
 
+/*
+ * If we're using RandR then we'll redo this whenever the screen
+ * changes since a CTRC may have been added or removed
+ */
 void
 screen_init_xinerama(struct screen_ctx *sc)
 {
@@ -114,6 +120,8 @@ screen_update_geometry(struct screen_ctx *sc)
 	sc->xmax = DisplayWidth(X_Dpy, sc->which);
 	sc->ymax = DisplayHeight(X_Dpy, sc->which);
 
+	screen_init_xinerama(sc);
+
 	xu_ewmh_net_desktop_geometry(sc);
 	xu_ewmh_net_workarea(sc);
 }