i3 / i3

A tiling window manager for X11
https://i3wm.org/
BSD 3-Clause "New" or "Revised" License
9.5k stars 780 forks source link

Append layout only works correctly after i3 restart on multiple monitors #4112

Closed FelixBrakel closed 4 years ago

FelixBrakel commented 4 years ago

I'm submitting a…

[x] Bug
[ ] Feature Request
[ ] Documentation Request
[ ] Other (Please describe in detail)

Current Behavior

With the following command on the bottom of the i3 config file: exec_always --not-startup-id "i3-msg 'workspace $ws1;append_layout /home/felix/layout/layout_home.json'"

And the following layout file:

// vim:ts=4:sw=4:et
{
    // splitv split container with 2 children
    "border": "normal",
    "floating": "auto_off",
    "layout": "splitv",
    "percent": 0.463020833333334,
    "type": "con",
    "nodes": [
        {
            "border": "pixel",
            "current_border_width": 1,
            "floating": "auto_off",
            "geometry": {
               "height": 362,
               "width": 800,
               "x": 0,
               "y": 0
            },
            "name": "~ : weather.sh — Konsole",
            "percent": 0.316468810744262,
            "swallows": [
               {
                "class": "^konsole$",
                "instance": "^konsole$",
                "title": "^\\~\\ \\:\\ weather\\.sh\\ \\—\\ Konsole$"
               // "window_role": "^MainWindow\\#1$"
               }
            ],
            "type": "con"
        },
        {
            // splith split container with 2 children
            "border": "normal",
            "floating": "auto_off",
            "layout": "splith",
            "percent": 0.683531189255738,
            "type": "con",
            "nodes": [
                {
                    "border": "pixel",
                    "current_border_width": 1,
                    "floating": "auto_off",
                    "geometry": {
                       "height": 362,
                       "width": 800,
                       "x": 0,
                       "y": 0
                    },
                    "name": "~ : topydo — Konsole",
                    "percent": 0.330912093435129,
                    "swallows": [
                       {
                        "class": "^konsole$",
                        "instance": "^konsole$",
                        "title": "^\\~\\ \\:\\ topydo\\ \\—\\ Konsole$"
                       // "window_role": "^MainWindow\\#1$"
                       }
                    ],
                    "type": "con"
                },
                {
                    "border": "pixel",
                    "current_border_width": 1,
                    "floating": "auto_off",
                    "geometry": {
                       "height": 362,
                       "width": 800,
                       "x": 0,
                       "y": 0
                    },
                    "name": "~ : gotop — Konsole",
                    "percent": 0.669087906564871,
                    "swallows": [
                       {
                        "class": "^konsole$",
                        "instance": "^konsole$",
                        "title": "^\\~\\ \\:\\ gotop\\ \\—\\ Konsole$"
                       // "window_role": "^MainWindow\\#1$"
                       }
                    ],
                    "type": "con"
                }
            ]
        }
    ]
}

{
    "border": "pixel",
    "current_border_width": 1,
    "floating": "user_off",
    "geometry": {
       "height": 362,
       "width": 800,
       "x": 0,
       "y": 0
    },
    "name": "~ : spt — Konsole",
    "percent": 0.536979166666666,
    "swallows": [
       {
        "class": "^konsole$",
        "instance": "^konsole$",
        "title": "^\\~\\ \\:\\ spt\\ \\—\\ Konsole$"
       // "window_role": "^MainWindow\\#1$"
       }
    ],
    "type": "con"
}

The desktop looks like this on startup:

desktop_layout

After pressing $mod+Shift+r (restart) the layout gets appended correctly: desktop_layout_correct

Expected Behavior

The desktop should look like the second screenshot on startup desktop_layout_correct

Reproduction Instructions

This behavior only appears to be happening with a dual monitor setup. Adding the provided i3-msg command to the i3 config file and setting the path such that it loads the provided layout file should trigger the behavior, although I haven't been able to test it on a different system.

Environment

Output of i3 --moreversion 2>&-:

i3 version:
Binary i3 version:  4.18.1 (2020-04-23) © 2009 Michael Stapelberg and contributors
Running i3 version: 4.18.1 (2020-04-23) (pid 8921)abort…)
Loaded i3 config: /home/felix/.config/i3/config (Last modified: Fri 29 May 2020 03:52:04 PM CEST, 1042 seconds ago)

The i3 binary you just called: /usr/bin/i3
The i3 binary you are running: /usr/bin/i3

Config file
https://pastebin.com/YADFGFtF
Logfile URL:
- Linux Distribution & Version: Arch Linux. Kernel version: 5.6.13
- Are you using a compositor (e.g., xcompmgr or compton): Yes, picom, but I have tested it with picom disabled and the issue still occurs.
i3bot commented 4 years ago

I don’t see a link to logs.i3wm.org. Did you follow https://i3wm.org/docs/debugging.html? (In case you actually provided a link to a logfile, please ignore me.)

orestisfl commented 4 years ago

logs please

FelixBrakel commented 4 years ago

So first off, here is the logfile: logfile

I have done a bit more troubleshooting on my own and I should note that I am using i3 as a window manager for KDE, which is what seems to be causing the problem here. When I run i3 without KDE the layout file gets append properly.

As a side note I had to create the i3 log file using the dev version of i3 because I couldn't get KDE to send the --shmlog-size argument to the window manager.

orestisfl commented 4 years ago

The differences are not super clear from your screenshot but the problem seems to be that your for_window rules match the placeholder windows.