labwc icon indicating copy to clipboard operation
labwc copied to clipboard

Prevent dragging the window when clicking on a SSD button

Open Consolatis opened this issue 2 years ago • 7 comments

Replaces #289

Consolatis avatar Jul 16 '22 22:07 Consolatis

Are you talking about when you click on one of the buttons (min, max, close) and the window moves slightly instead of the button action?

It seems the trigger point for button action is a very small part of what the icon covers, not sure why that is. I've had to click several times, moving a pixel or two each time till the button activates.

droc12345 avatar Jul 24 '22 21:07 droc12345

The trigger point for a button should be the whole button (that half-transparent overlay that shows up when hovering over a button). The reason for that window movement when clicking on a button is that if there is even a slight movement of the mouse between the press and release of the mouse button it will count as movement instead of as click.

So we need to decouple these two as in if the press is on a button, a following mouse move event is simply ignored / doesn't cause window movement until we get the release.

I expect this issue will get triggered way more often for people that use a high DPI mouse.

Consolatis avatar Jul 24 '22 21:07 Consolatis

Well, I'm using a 4k monitor along with a hidpi mouse lol so that may be part of it.

I do see the semi-transparent overlay, but I can only click on part of it, and have the action work, I usually wind up moving the mouse a time or two, till I find the "right click spot".

Could it possibly be a cursor position problem, where the cursor thinks it's at this point, but the display is at a slightly different area?

The reason I ask, I use firefox and at times when I click on the bookmark drop down, when I move the mouse over sub categories, nothing happens, as if there is nothing in that category, but if I move the mouse around a few inches and go back to that spot the sub category does appear.

Edit to add: I'll add that since I'm on a 4k monitor, I do use both GDK_SCALE and GDK_DPI_SCALE to make things readable, I suppose that could be part of the problems I see, re cursor positioning.

droc12345 avatar Jul 24 '22 21:07 droc12345

Does it work better if you use wlr-randr --output whatever --scale=2 instead of the GDK_ settings?

Consolatis avatar Jul 24 '22 22:07 Consolatis

I did try display scaling, early on when I was starting with wayland, but I found that I got better visual results by adjusting toolkit size instead of display scaling. The aiming problem I just deal with it, it's not that big a deal in the scheme of things, as I'm learning where the sweet spot is on the icons.

droc12345 avatar Jul 24 '22 22:07 droc12345

I am not sure if what you are experiencing is a different (unknown) bug in labwc, it shouldn't make any difference for a SSD button where you click on it, any point on the whole half-transparent overlay should behave the same in regard to registering button clicks.

If that is not the case, there might indeed be something fishy going on.

Consolatis avatar Jul 24 '22 22:07 Consolatis

As an FYI, I pulled the latest labwc git and wlroots git and my pointer problems have abated quite a bit. This is with looking at what the pointer does in firefox and other apps in general.

This combination compiles clean (on my system, well I did update libdrm to 2.4.112 because of wlroots) commit c22a991b2c3749c335b9826cd311851a001159c2 - labwc commit 30bf8a4303bc5df3cb87b7e6555592dbf8d95cf1 - wlroots

There have been updates to the hires area, so that's probably what's made it better, for me.

droc12345 avatar Jul 30 '22 14:07 droc12345