[dev] [dwm] spawn and monitor placement

From: Martin Kopta <martin_AT_kopta.eu>
Date: Fri, 25 Oct 2013 12:05:36 +0200

Hi, I am still having problems with placement of windows while using two
monitors [1]. I am using latest git version of dwm.

$ git show HEAD | head -n1
commit cdec9782a1789bd5c3a84772fd59abb9da288597

My setup is

xrandr --output LVDS1 --auto --left-of VGA1 --output VGA1 --auto
xrandr --output LVDS1 --primary

Now, whenever I create any new window (either using spawn() [2] or dmenu_run),
the new window is placed on primary monitor. I can change the primary monitor
before creating the window, but changing primary monitor swaps all the existing
windows.

I see dmenu tries to solve this problem with dmenumon which seems to work. When
I have cursor on LVDS1 and launch dmenu, it is created on LDVS1. When I have
cursor on VGA1 and launch dmenu, it is created on VGA1. I would expect any
other window do the same. Is it possible?

[1] http://lists.suckless.org/dev/1306/16168.html
[2] $ sed -n '1571,1584p' dwm.c
    void
    spawn(const Arg *arg) {
            if(arg->v == dmenucmd)
                    dmenumon[0] = '0' + selmon->num;
            if(fork() == 0) {
                    if(dpy)
                            close(ConnectionNumber(dpy));
                    setsid();
                    execvp(((char **)arg->v)[0], (char **)arg->v);
                    fprintf(stderr, "dwm: execvp %s", ((char **)arg->v)[0]);
                    perror(" failed");
                    exit(EXIT_SUCCESS);
            }
    }

Received on Fri Oct 25 2013 - 12:05:36 CEST

This archive was generated by hypermail 2.3.0 : Fri Oct 25 2013 - 12:12:06 CEST