Re: [hatari-devel] Little regression in hatari GUI filesystem in fullscreen mode ?

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

On 18.3.2024 22.40, Thomas Huth wrote:
On 17.3.2024 22.17, Laurent Sallafranque wrote:
- sometimes, the slidebar "jumps" and is upper (or lower) than the mouse
cursor, but it works and it resync when the cursor reach the top or the
bottom of the bar.

Laurent, depending on how your monitor, Hatari resolution and SDL2 scaling match, this issue could be explained by the issue discussed below.


- In windowed mode, clicking on the arrow at top or bottom of the
slidebar does move the slidebar continuously ; whereas in full screen, I
have to click N times to move the slidebar (the "Autoclick" doesn't work
in fullscreen.

I can reproduce it.  It does not seem to be related the other issue, as
it does not happen with scaled window, only with fullscreen.

Thomas, any comments on this issue, or my patch to the other one?

I think your other patch is fine.

Thomas, there's still the question of whether SDL2 Mac and Windows backends also behave this brokenly?

There does not seem to be any SDL2 documentation on this behavior, and while Google finds few reports of this issue, there are no definite answers. There were some nearly decade old indications that SDL2 version of that time might behave differently in this respect on different OSes...


But with regards to this problem: Ouch, that seems to be a very ugly one.
If I get that right, SDL_GetMouseState() seems to provide us with the
*absolute* desktop mouse coordinates, not the ones relative to our drawing
area (like we seem to get in the SDL_MOUSEBUTTONDOWN event later). So we
likely have to substract the width of the left (or height of the upper)
black border in fullscreen from the mouse coordinates.

I don't think it's the absolute desktop coords, its absolute window coords. SDL2 just does not take into account its black borders its, like it does with the mouse events.

(The odd / broken thing is how fullscreen affects mouse event scaling of SDL2, but not its mouse state scaling.)


>That's getting very,
very ugly, especially since I haven't found a good way to determine the
size of that border yet. Thus no clue yet how to solve that properly ...
any suggestions?

None of the APIs listed here:
https://wiki.libsdl.org/SDL2/SDL_GetWindowSize

gave the full window size.


However, while it's very ugly to do assumptions on SDL behavior (instead of it scaling the events automatically, or at least providing function for that), I think we could in fullscreen assume desktop size for SDL2 window:
https://wiki.libsdl.org/SDL2/SDL_GetDesktopDisplayMode

What do you think?


	- Eero



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/