summaryrefslogtreecommitdiff
path: root/app/cwm
diff options
context:
space:
mode:
Diffstat (limited to 'app/cwm')
-rw-r--r--app/cwm/calmwm.c17
-rw-r--r--app/cwm/calmwm.h3
-rw-r--r--app/cwm/screen.c10
-rw-r--r--app/cwm/xevents.c3
4 files changed, 16 insertions, 17 deletions
diff --git a/app/cwm/calmwm.c b/app/cwm/calmwm.c
index 77af7a8f1..53f189618 100644
--- a/app/cwm/calmwm.c
+++ b/app/cwm/calmwm.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: calmwm.c,v 1.62 2012/07/05 17:35:13 okan Exp $
+ * $OpenBSD: calmwm.c,v 1.63 2012/07/06 14:18:00 okan Exp $
*/
#include <sys/param.h>
@@ -97,7 +97,7 @@ main(int argc, char **argv)
static void
dpy_init(const char *dpyname)
{
- int i;
+ int i, fake;
XSetErrorHandler(x_errorhandler);
@@ -110,6 +110,9 @@ dpy_init(const char *dpyname)
XSync(X_Dpy, False);
XSetErrorHandler(x_errorhandler);
+ if (XineramaQueryExtension(X_Dpy, &fake, &fake) == 1 &&
+ ((HasXinerama = XineramaIsActive(X_Dpy)) == 1))
+ HasXinerama = 1;
HasRandr = XRRQueryExtension(X_Dpy, &Randr_ev, &i);
}
@@ -157,7 +160,6 @@ x_setupscreen(struct screen_ctx *sc, u_int which)
Window *wins, w0, w1;
XWindowAttributes winattr;
XSetWindowAttributes rootattr;
- int fake;
u_int nwins, i;
sc->which = which;
@@ -201,17 +203,8 @@ x_setupscreen(struct screen_ctx *sc, u_int which)
screen_updatestackingorder(sc);
- if (XineramaQueryExtension(X_Dpy, &fake, &fake) == 1 &&
- ((HasXinerama = XineramaIsActive(X_Dpy)) == 1))
- HasXinerama = 1;
if (HasRandr)
XRRSelectInput(X_Dpy, sc->rootwin, RRScreenChangeNotifyMask);
- /*
- * initial setup of xinerama screens, if we're using RandR then we'll
- * redo this whenever the screen changes since a CTRC may have been
- * added or removed
- */
- screen_init_xinerama(sc);
XSync(X_Dpy, False);
}
diff --git a/app/cwm/calmwm.h b/app/cwm/calmwm.h
index db595fe41..3383663c2 100644
--- a/app/cwm/calmwm.h
+++ b/app/cwm/calmwm.h
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: calmwm.h,v 1.148 2012/07/05 17:35:13 okan Exp $
+ * $OpenBSD: calmwm.h,v 1.149 2012/07/06 14:18:00 okan Exp $
*/
#ifndef _CALMWM_H_
@@ -360,7 +360,6 @@ void search_print_client(struct menu *, int);
XineramaScreenInfo *screen_find_xinerama(struct screen_ctx *, int, int);
struct screen_ctx *screen_fromroot(Window);
-void screen_init_xinerama(struct screen_ctx *);
void screen_update_geometry(struct screen_ctx *);
void screen_updatestackingorder(struct screen_ctx *);
diff --git a/app/cwm/screen.c b/app/cwm/screen.c
index 71c337270..def241d4c 100644
--- a/app/cwm/screen.c
+++ b/app/cwm/screen.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: screen.c,v 1.30 2012/07/05 17:35:13 okan Exp $
+ * $OpenBSD: screen.c,v 1.31 2012/07/06 14:18:00 okan Exp $
*/
#include <sys/param.h>
@@ -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);
}
diff --git a/app/cwm/xevents.c b/app/cwm/xevents.c
index 4c2c84842..9480c7de6 100644
--- a/app/cwm/xevents.c
+++ b/app/cwm/xevents.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: xevents.c,v 1.62 2012/07/05 17:35:13 okan Exp $
+ * $OpenBSD: xevents.c,v 1.63 2012/07/06 14:18:00 okan Exp $
*/
/*
@@ -366,7 +366,6 @@ xev_handle_randr(XEvent *ee)
if (sc->which == (u_int)i) {
XRRUpdateConfiguration(ee);
screen_update_geometry(sc);
- screen_init_xinerama(sc);
}
}
}