Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

clicking using trackpoint is a pain on some screens #476

Open
pony-montana opened this issue Sep 6, 2023 · 7 comments
Open

clicking using trackpoint is a pain on some screens #476

pony-montana opened this issue Sep 6, 2023 · 7 comments
Labels
A: bug Something isn't working

Comments

@pony-montana
Copy link

pony-montana commented Sep 6, 2023

Info

dwl version: here https://github.com/pony-montana/simple-dwl is based on lastest master commit + some patches
wlroots version: 0.16.2

Description

Using trackpoint and clicking mouse-integrated-buttons (left button in particular) on my thinkpad x200 result in a painful experience on some screens.

The problem is: when I click, the screen registers some micro-movements from trackpoint input; so clicking doesnt produce effects (or, in some screens, it produce the effect of "keep-clicked-and-drag").

Only if I click the left button when I'm not touching the trackpoint all goes fine. But this result in a pretty slow user experience, not the way a trackpoint is intended to be used.

In particular, I found this problem in some qt-screens (navigation menus in electrum bitcoin wallet) and in firefox options.
For example, clicking on web-content and on the main firefox interface works fine. The problem comes only on some screen, when I click on menus that sovrappose to the main screen.
This problem is not present when I click on dwl-bar for example.

@pony-montana pony-montana added the A: bug Something isn't working label Sep 6, 2023
@sevz17
Copy link
Collaborator

sevz17 commented Sep 7, 2023

Hmm, maybe related?

@sevz17
Copy link
Collaborator

sevz17 commented Sep 7, 2023

Can you reproduce in sway (or in another non-minimal compositor)?

@pony-montana
Copy link
Author

pony-montana commented Sep 7, 2023

Using sway I don't have this issue (on the same machine, with all the same libraries and same environment).
So I think that there are problems with compositing. On screens where I have problems I feel like it "reacts to trackpoint inputs de-focusing from the thing that is on-focus in that moment" where it would need just to move the cursor on the screen and nothing else.

@pony-montana
Copy link
Author

The problem is also present on plain dwl last main commit and plain dwl 4.0.

@sevz17
Copy link
Collaborator

sevz17 commented Sep 12, 2023

Could you test in wlroots-next?, I suspect this happens because a hack I did.

@pony-montana
Copy link
Author

Tested wlroots-next branch with wlroots compiled at last commit and still the issue is present.

I isolated some lines in the code (from main branch) that when are changed the issue is solved (but other non-intended behaviour happens):

in dwl.c, if I remove the lines number 1691 and 1692 in the motionnotify function like that:

dwl.c

if (cursor_mode == CurPressed && !seat->drag) {
		if ((type = toplevel_from_wlr_surface(
				 seat->pointer_state.focused_surface, &w, &l)) >= 0) {
			c = w;
			surface = seat->pointer_state.focused_surface;
/* 	!!!!!!		sx = cursor->x - (type == LayerShell ? l->geom.x : w->geom.x);    !!!!!    line 1961
	!!!!!!		sy = cursor->y - (type == LayerShell ? l->geom.y : w->geom.y);    !!!!!     line 1962    */
		}
	}

Then the issue is solved, but strange new issues happens when keeping leftbutton pressed trying to select text on the screen and the cursor goes out of the focused window (because the function is no-more uptating sx and sy).


Another way (not correlated with the previous) to solve my issue is modifying in this way client.h around the line 100:

client.h

			case WLR_XDG_SURFACE_ROLE_TOPLEVEL:
/*				c = xdg_surface->data;       line 100
				type = c->type;                     line 101
				goto end;                              line 102         */    
                                return -1;      /*<----- !!!NEW ADDED LINE!!! */
			case WLR_XDG_SURFACE_ROLE_NONE:
				return -1;

In this way we solve my issue but we have new strange issues similar to what we obtain with the first method, but not totally identical.

Hoping this will help.

@pony-montana
Copy link
Author

pony-montana commented Sep 12, 2023

The problem as I try to understand it is that the surfaces where this misbehaviour happens seems to not be recognized by compositor and differentiated from the layer they are on top (the surfaces I talk about are nor popup nor they are on the same level of the base surface of the window).

p.s. the chanche I say something wrog are very high, hoping that someone more expert will find something useful in my noob digressions :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants