]> git.sur5r.net Git - i3/i3/blobdiff - src/xinerama.c
Merge branch 'next'
[i3/i3] / src / xinerama.c
index 369e8ab7311f31066165727fa1d0cb31f5f7ac62..7e5b5aebb4acb60e64379ceed47ed17c0428f42e 100644 (file)
@@ -1,21 +1,20 @@
+#undef I3__FILE__
+#define I3__FILE__ "xinerama.c"
 /*
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- *
- * © 2009-2010 Michael Stapelberg and contributors
- *
- * See file LICENSE for license information.
+ * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * This is LEGACY code (we support RandR, which can do much more than
  * Xinerama), but necessary for the poor users of the nVidia binary
- * driver which does not support RandR in 2010 *sigh*.
+ * driver which does not support RandR in 2011 *sigh*.
  *
  */
+#include "all.h"
 
 #include <xcb/xinerama.h>
 
-#include "all.h"
 
 static int num_screens;
 
@@ -59,7 +58,7 @@ static void query_screens(xcb_connection_t *conn) {
             s->rect.height = min(s->rect.height, screen_info[screen].height);
         } else {
             s = scalloc(sizeof(Output));
-            asprintf(&(s->name), "xinerama-%d", num_screens);
+            sasprintf(&(s->name), "xinerama-%d", num_screens);
             DLOG("Created new Xinerama screen %s (%p)\n", s->name, s);
             s->active = true;
             s->rect.x = screen_info[screen].x_org;
@@ -70,6 +69,8 @@ static void query_screens(xcb_connection_t *conn) {
             if (s->rect.x == 0 && s->rect.y == 0)
                     TAILQ_INSERT_HEAD(&outputs, s, outputs);
             else TAILQ_INSERT_TAIL(&outputs, s, outputs);
+            output_init_con(s);
+            init_ws_for_output(s, output_get_content(s->con));
             num_screens++;
         }
 
@@ -91,7 +92,7 @@ static void query_screens(xcb_connection_t *conn) {
  * information to setup workspaces for each screen.
  *
  */
-void xinerama_init() {
+void xinerama_init(void) {
     if (!xcb_get_extension_data(conn, &xcb_xinerama_id)->present) {
         DLOG("Xinerama extension not found, disabling.\n");
         disable_randr(conn);