-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes for Wayland on FreeBSD #116
Conversation
Otherwise, keyboard input would touch the console, and e.g. pressing Enter would crash Weston
a56c98f
to
ea4a569
Compare
src/ck-sysdeps-unix.c
Outdated
| @@ -308,6 +308,13 @@ ck_get_a_console_fd (void) | |||
| } | |||
| #endif | |||
|
|
|||
| #if defined(__FreeBSD__) | |||
| fd = ck_open_a_console ("/dev/ttyv0"); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's rationale for this change? Doesn't /dev/console work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function uses /dev/console as fallback, but prefers a VT specifically (on other platforms already, FreeBSD just was missing).
CK is usually spawned by the D-Bus daemon for the system bus, who would guarantee that /dev/console is a VT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, ck_get_a_console_fd should return a fd for a virtual terminal?
In this case, why don't we try all possible ttyv's? When writing this code 1 I found out that if no one is logged in at /dev/ttyv0, you can't open() it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't seem necessary, it just works like this so far.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I'm debugging https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221452#c36 it seems related. Maybe you have some insights?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea how the x11 support works and I haven't tried any display managers yet.
With just two wayfires the switching works, the currently active session is always active e.g.
Session1:
unix-user = '1001'
realname = 'Greg'
seat = 'Seat1'
session-type = 'unspecified'
session-class = 'user'
session-state = 'active'
active = TRUE
x11-display = ''
x11-display-device = ''
display-device = '/dev/ttyv0'
remote-host-name = ''
is-local = TRUE
on-since = '2021-10-22T10:00:23.671559Z'
login-session-id = ''
XDG_RUNTIME_DIR = '/var/run/user/1001'
VTNr = '1'
Session2:
unix-user = '1001'
realname = 'Greg'
seat = 'Seat1'
session-type = 'unspecified'
session-class = 'user'
session-state = 'online'
active = FALSE
x11-display = ''
x11-display-device = ''
display-device = '/dev/ttyv1'
remote-host-name = ''
is-local = TRUE
on-since = '2021-10-22T12:56:56.714321Z'
login-session-id = ''
XDG_RUNTIME_DIR = '/var/run/user/1001'
VTNr = '2'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to this PR, using /dev/console seems more correct: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221452#c39
Should I commit the change proposed in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, everything works fine, I have removed the commit from this PR.
Only got a NULL here on FreeBSD/aarch64, for some reason
42b8c93
to
5debe34
Compare
|
@rnagy @ajacoutot We're running these patches on FreeBSD for years now. Can this PR be merged in, please? |
| @@ -1482,6 +1486,16 @@ ck_session_setup_vt_signal (CkSession *session, | |||
| return; | |||
| } | |||
|
|
|||
| #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be made feature dependent maybe instead of OS dependent?
/dev/dri/card0is a symlink to../drm/0on FreeBSD. When CK2 tries to determine the device type, the path gets resolved, and so it's notcard0. Also the subsystem is not set by libudev-devd./dev/*device doesn't die until udev consumers have detached it, because/devis controlled by udev — in our case, it's controlled bydevfsin the kernel) Let's check if the device died on re-attaching.