Fix bug https://bugs.freedesktop.org/show_bug.cgi?id=86889 by emitting session signals on TTY switches so that the weston backends can handle VT switching when not called from weston-launch

Submitted by nerdopolis on Dec. 7, 2014, 3:15 p.m.

Details

Message ID 1417965329-18641-1-git-send-email-bluescreen_avenger@verizon.net
State Superseded
Headers show

Not browsing as part of any series.

Commit Message

nerdopolis Dec. 7, 2014, 3:15 p.m.
---
 src/logind-util.c | 6 ++++++
 1 file changed, 6 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/logind-util.c b/src/logind-util.c
index 6a1b498..4308bb6 100644
--- a/src/logind-util.c
+++ b/src/logind-util.c
@@ -695,9 +695,15 @@  signal_event(int fd, uint32_t mask, void *data)
 	switch (sig.ssi_signo) {
 	case SIGUSR1:
 		ioctl(wl->vt, VT_RELDISP, 1);
+		wl->compositor->session_active=0;
+		wl_signal_emit(&wl->compositor->session_signal,
+		       wl->compositor);
 		break;
 	case SIGUSR2:
 		ioctl(wl->vt, VT_RELDISP, VT_ACKACQ);
+		wl->compositor->session_active=1;
+		wl_signal_emit(&wl->compositor->session_signal,
+		       wl->compositor);
 		break;
 	}
 

Comments

On Sun, 07 Dec 2014 10:15:29 -0500
nerdopolis <bluescreen_avenger@verizon.net> wrote:

> ---
>  src/logind-util.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/src/logind-util.c b/src/logind-util.c
> index 6a1b498..4308bb6 100644
> --- a/src/logind-util.c
> +++ b/src/logind-util.c
> @@ -695,9 +695,15 @@ signal_event(int fd, uint32_t mask, void *data)
>  	switch (sig.ssi_signo) {
>  	case SIGUSR1:
>  		ioctl(wl->vt, VT_RELDISP, 1);
> +		wl->compositor->session_active=0;
> +		wl_signal_emit(&wl->compositor->session_signal,
> +		       wl->compositor);
>  		break;
>  	case SIGUSR2:
>  		ioctl(wl->vt, VT_RELDISP, VT_ACKACQ);
> +		wl->compositor->session_active=1;
> +		wl_signal_emit(&wl->compositor->session_signal,
> +		       wl->compositor);
>  		break;
>  	}
>  

Hi,

reading the commit
http://cgit.freedesktop.org/wayland/weston/commit/?id=aedc7732ebd9bc7b4f51ee247ea857ffec6260a7
I'm not too sure this patch is right.

David, would you mind taking a look?

It's supposed to fix
https://bugs.freedesktop.org/show_bug.cgi?id=86889

Btw. looks like there is some more hilarity wrt. VT switching:
https://bugs.freedesktop.org/show_bug.cgi?id=87322


Thanks,
pq