Qt 6.4.x on iPhone with notch: Mouse coordinates and save area
-
Hi,
while porting an application from Android to IOS I found out, that the reported mouse coordinates doesn't match the save area. The mouse coordinate 0,0 is the top left pixel of the save area minus the notch size. Is this wilful?
I ask this because on Android it behaves different. There I must not take care about any notch sizes although this exists on Android devices too.For anybody encountering the same problem, I have a solution for this. If you assume the upper left corner in the save area is pixel 0,0 then you mus subtract the size of the notch from it. Here is a small objective-c code example of how to get the notch size (area on top and bottom of screen when in portrait mode or left, right and bottom if in landscape mode):
int getCurrentOrientation() { UIDevice *device = [UIDevice currentDevice]; if (!device) return -1; return [device orientation]; }
Look at Apple developper/orientation for the meaning of the resulting values.
Calll the above method after your application received the active status signal.