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

click shift on 1080x2400 display #43

Open
tkkcc opened this issue Nov 23, 2022 · 7 comments
Open

click shift on 1080x2400 display #43

tkkcc opened this issue Nov 23, 2022 · 7 comments

Comments

@tkkcc
Copy link

tkkcc commented Nov 23, 2022

agtk-egui

Screenrecorder-2022-11-23-20-03-58-695.mp4
@rib
Copy link
Collaborator

rib commented Nov 27, 2022

Oh, odd, I don't think I've seen that when I run the same example - but maybe I was testing agdk-eframe more recently.

Thanks for the report.

This is maybe something that should ideally be tracked as either a Winit or an Egui issue but it's probably fine here for now until we determine what the underlying issue really is - considering I've been working on Winit and Android support in Egui too.

I'm not 100% sure when I'll get around to investigating so please post here if you figure out any more clues from experimenting yourself.

It could also be helpful to know whether you see the same thing with agdk-eframe

I wonder if it relates to how DPI scaling is done, and maybe the input is being scaled by the wrong factor (not consistent with how the visuals are scaled by DPI)

At some point I think the example may have had some hacky 2x multiplier for the DPI because the regular DPI scaling was still resulting in an unusably small UI on mobile phones - maybe I left a constant scale factor for rendering in the example that's not also used for input events.

@tkkcc
Copy link
Author

tkkcc commented Nov 27, 2022

It's tested on a poco f3 phone with official system. no mod no root. DPI is 440:
Screenshot_2022-11-27-22-51-43-409_com liuzh deviceinfo

agdk-eframe has same problem. egui.rs in webbrowser works fine.

I also tried on genymotion emulators but app stops on boot, logcat shows error about egl.

@tkkcc tkkcc closed this as completed Nov 27, 2022
@tkkcc tkkcc reopened this Nov 27, 2022
@tkkcc
Copy link
Author

tkkcc commented Dec 18, 2022

I can reproduce this issue on waydroid on another PC, agdk-eframe with ndk 25.1.8937393 or 24.0.8215888 .

waydroid use 720p 320DPI

~ adb shell wm size
Physical size: 1762x700
Override size: 720x1280
~ adb shell wm density
Physical density: 180
Override density: 320

Cargo.lock

[[package]]
name = "winit"
version = "0.27.2"
source = "git+https://github.com/rib/winit?branch=android-activity#b3ba646fc8b5e1ddcbf8f95f905f0fe809e49a2a"
[[package]]
name = "egui"
version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "egui-winit"
version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "eframe"
version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"

@MarijnS95
Copy link
Member

MarijnS95 commented Dec 19, 2022

Since there doesn't seem to be an issue horizontally, and the distance between touch input and where the app ends up processing it in window moves and textbox interaction (hard to tell from a minimal video), is this perhaps simply the offset of the titlebar not being taken into account?

@rib
Copy link
Collaborator

rib commented Dec 19, 2022

Sounds very plausible yep. I had started looking at updating the winit backend to add support for querying the surface size distinct from the inner size that would be able to account for insets (re: rust-windowing/winit#2308) and maybe that'll end up helping enable egui to consider insets for a titlebar.

@MarijnS95
Copy link
Member

Yeah it looks very much that this isn't the surface size but the whole window/Activity size. Would be great to have a repro project to validate this theory (again: not visible from a video...), though can probably whip one up easily.

@tkkcc
Copy link
Author

tkkcc commented Dec 20, 2022

add getSupportActionBar().hide(); after hideSystemUI(); can solve this. just remove the native bar.

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

3 participants