Bug 387486 - kwin hangs when trying to start on another seat other than seat0
Summary: kwin hangs when trying to start on another seat other than seat0
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: libinput (show other bugs)
Version: git master
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-01 04:19 UTC by bluescreenavenger
Modified: 2018-08-31 11:54 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
mgraesslin: Wayland+
mgraesslin: X11-


Attachments
The stack trace of kwin hanging when running on seat1 (non seat0) (10.04 KB, text/plain)
2017-12-01 04:19 UTC, bluescreenavenger
Details
Hashed up workaround (1.75 KB, patch)
2017-12-13 04:44 UTC, bluescreenavenger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bluescreenavenger 2017-12-01 04:19:23 UTC
Created attachment 109142 [details]
The stack trace of kwin hanging when running on seat1 (non seat0)

Hi

I have a logind started session where my seat is not seat0 (it's seat1 for the example)
I am trying to start Kwin in the same way that I can get it to start on seat1 (same variables and everything the same arguments) from within this session. ( $XDG_SEAT=seat1 , $(loginctl seat-status |head -1) == seat1 )


There doesn't seem to be a way to specify the seat on the command line, and maybe I am missing a variable. ...It could be that it is trying to use devices on seat0, or connect to seat0, but that's just my guess based on what a few other Wayland display servers tried to do when I tried to start it on seat1 

I have the stack trace attached.

It seems to hang VERY early, before it logs anything, and doesn't seem to do anything to the display. ...I was able to get the stack trace by attaching gdb to the process from a terminal running in seat0
Comment 1 Martin Flöser 2017-12-01 05:23:26 UTC
KWin only supports seat0: https://cgit.kde.org/kwin.git/tree/libinput/connection.cpp#n137
Comment 2 bluescreenavenger 2017-12-03 05:27:01 UTC
I should have opened this as wishlist first... ...As an experiment, I tried to replace the "seat0" with getenv("XDG_SEAT") and it does the same thing. Something must hang earlier... I am trying to find out how to find that out
Comment 3 Martin Flöser 2017-12-03 08:16:08 UTC
My assumption is that we need to use the seat associated with the logind session.
Comment 4 bluescreenavenger 2017-12-04 03:36:07 UTC
That's my assumption as well... ...let me know if you need me to try anything
Comment 5 bluescreenavenger 2017-12-13 04:44:49 UTC
Created attachment 109349 [details]
Hashed up workaround
Comment 6 bluescreenavenger 2017-12-13 04:48:42 UTC
I was able to hash up a workaround. With this kwin actually starts on non-seat0, and the input devices work. But it's probably not good enough to be merged obviously.
Comment 7 Christoph Feck 2017-12-20 16:37:08 UTC
Please submit patches via https://phabricator.kde.org/differential/diff/create/
Comment 8 bluescreenavenger 2017-12-24 17:45:33 UTC
That patch, ...I don't think it can be final... Two issues I come across, the devices in seat0 by default aren't found by 
udev_enumerate_add_match_property 

unless they are explicitly configured in a udev config file for seat0... ...and boot_vga devices will not be in all seats...

...and I'm still matching with getenv(XDG_SEAT)... I might be able to get around that, by changing logind.cpp, but that means this probably will have to be a series, I think?
Comment 9 bluescreenavenger 2017-12-29 05:04:24 UTC
I tried with arcanist, but I created two revisions that were not sent properly> How do I make arcanist send 6 separate commits
Comment 10 Christoph Feck 2018-01-10 20:57:17 UTC
I suggest to ask for help in a developer forum instead of this bug tracker. If everything else fails, just upload the (each) patch using the link from comment #7.

https://community.kde.org/Get_Involved
Comment 11 bluescreenavenger 2018-01-11 01:38:09 UTC
Yeah. I asked earlier, I think on the #kwin IRC, IIRC, and I was suggested to split them out there as well. It was less than 10 smallish diffs, so it was OK to do manually. I was able to submit 
D9552
D9553
D9557
As well as
D9572
D9574
Comment 12 bluescreenavenger 2018-02-22 13:14:45 UTC
Let me know if there is something I need to change in the submissions I mentioned. They will fix this...
Comment 13 bluescreenavenger 2018-05-02 01:07:12 UTC
I guess this is almost done. For the drm backend it is, but for the framebuffer backend, all it needs is D9572 upstream. (which I hope my changes for that one are good)
Comment 14 bluescreenavenger 2018-08-31 11:33:54 UTC
I think this is resolved, my patches were merged. D9572 was the last one. Do I just mark it as resolved?
Comment 15 David Edmundson 2018-08-31 11:54:37 UTC
thanks for the patches