Skip to content
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

Double visible mouse pointer #64

Closed
milisarge opened this issue Jun 14, 2024 · 18 comments
Closed

Double visible mouse pointer #64

milisarge opened this issue Jun 14, 2024 · 18 comments

Comments

@milisarge
Copy link

As you see in video after logout from Louvre, when i enter again to my Labwc session, it shows two pointer of a mouse.

@ehopperdietzel
Copy link
Member

ehopperdietzel commented Jun 14, 2024

Hmm it looks like Labwc is not setting the harware cursor plane and is rendering it instead, DRM resources like cursor planes are controlled by the active compositor, since Labwc is not using it, the one set by Louvre remains, so its kinda a Labwc "bug".

To fix this, you could try hiding the cursor before leaving the Louvre session:

Louvre Views Seat.cpp

void Seat::enabledChanged()
{
    if (!enabled()) // When the user switches to another session
    {
        cursor()->setVisible(false);
        return;
    }

   ...
}

If that doesn't work, you could disable the cursor plane for each initialized output:

Louvre Views Output.cpp

void Output::initializeGL()
{
    cursor()->enableHwCompositing(this, false);

   ...
}

This means Louvre will render the cursor using OpenGL which is slower but you should not notice much difference.

@milisarge
Copy link
Author

milisarge commented Jun 15, 2024

both of ways don't work, still there are two visible pointers

by the way, i reproduces the bug with Wayfire also then it is mostly related with Wlroots

@milisarge
Copy link
Author

After discussion with Labwc guys, we noticed that it is Qemu bug for now, i resolved it with -vga virtio -display sdl,show-cursor=off

@ehopperdietzel
Copy link
Member

Ok, thanks for letting me know, so does this happen when switching between other compositors as well? And what are you building? It looks interesting

@milisarge
Copy link
Author

I am the maintainer of Milis Linux project, so far now, we have been using wlroots based compositors as WM, so have not noticed such a bug in switching between them. Well, we are trying to setup a composition of desktop environment and Louvre is the new base as alternative of Wlroots.

@ehopperdietzel
Copy link
Member

ehopperdietzel commented Jun 15, 2024

Nice! I see it has its own package manager and init system, that must be a lot of work! Can it be tested on real hardware, I mean like a live CD version? And does it support other languages apart from Turkish?

we have been using wlroots based compositors as WM, so have not noticed such a bug in switching between them

There is one last option, maybe setting the SRM_FORCE_LEGACY_API=0 env could fix it. It basically enables the new DRM Atomic API if supported which I guess wlroots compositors may be using.

@milisarge
Copy link
Author

Yes, it has been used as daily Linux system since 2016 with different versions, current version is 2.3 and you can test it, Qemu is one of my test environment so i am testing first with it, English the other language option for the present.

SRM_FORCE_LEGACY_API=0 env solved Labwc side so no twice pointer but the pointer disappeared at Louvre side. video

@ehopperdietzel
Copy link
Member

Yes, it has been used as daily Linux system since 2016 with different versions, current version is 2.3 and you can test it, Qemu is one of my test environment so i am testing first with it, English the other language option for the present.

Perfect! I'll give it a try and then let you know how it went.

SRM_FORCE_LEGACY_API=0 env solved Labwc side so no twice pointer but the pointer disappeared at Louvre side. video

Hmm, glad you noticed it. That must be an SRM bug, so I definitely need to take a look at that.

@ehopperdietzel
Copy link
Member

I tested Milis, and it works perfectly, great work! I only had problems with my Wi-Fi card, but that happens in almost every distro since it requires proprietary drivers. Also, neither Labwc nor Wayfire set the scale factor of HiDPI displays to 2 by default, which is just a small detail and I'm sure it can be easily configured.

Additionally, I think I fixed the cursor issue in SRM. The changes are in the devel branch if you want to test them. I think I wasn't properly handling cases where the first Atomic commit failed.

@milisarge
Copy link
Author

you can scale display from settings

i updated the Louvre with SRM-devel, but still pointer disappears at Louvre.

@ehopperdietzel
Copy link
Member

you can scale display from settings

Yes, I experimented with that. I just wanted to suggest that from a user perspective, it would be nice if the default scale could be set to 1.75 or 2 on HiDPI displays (e.g. DPI >= 200), as everything appears too small with a scale factor of 1. By the way, I plan to add the same protocol for controlling outputs to Louvre soon so that the panel will also work with Louvre compositors.

i updated the Louvre with SRM-devel, but still pointer disappears at Louvre.

Hmm :( I'll need to check that again. At least on real hardware, it seems to work fine, but I haven't tested it inside Qemu. Thanks, by the way, for testing it.

@ehopperdietzel
Copy link
Member

Hi again @milisarge, I attempted to implement hiding cursor planes before session switching. However, it appears that libseat drops DRM permissions to the compositor either before or simultaneously with notifying the TTY switch, preventing Louvre from hiding it. Nonetheless, I have updated SRM so that the cursor should now be restored when using the atomic API (SRM_FORCE_LEGACY_API=0).

@milisarge
Copy link
Author

milisarge commented Sep 6, 2024

i updated Louvre to 2.8.0 and compatible SRM with it. It seems fixed (SRM_FORCE_LEGACY_API=1).

Edit: sorry i just noticed, when i back to Labwc then double pointer issue occurs.

@milisarge
Copy link
Author

But i catched double pointer issue when i start the wf-recorder process.

louvre-double-pointer-wfrecorder.mp4

@ehopperdietzel
Copy link
Member

But i catched double pointer issue when i start the wf-recorder process.

Is that happening only inside QEMU?

@milisarge
Copy link
Author

yes, i am testing on QEMU not tried on physical yet

@ehopperdietzel
Copy link
Member

I've just added the SRM_DISABLE_CURSOR env, setting it to 1 should fix it.

@milisarge
Copy link
Author

finally, it is solved, works like charm :) thanks for your effort

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants