Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Developer
allan175
Posts: 11
Registered: ‎11-07-2012
My Device: Playbook, Z10, Q10

Z10/Q10 orientation problem

While porting our Z10 version of our games to the Q10 I've come across an odd/annoying issue with the orientation on the Q10.

 

In the bar descriptor for the Q10 build I set the app to be fixed in portrait mode (the Z10 version was landscape):-

<initialWindow>
   <systemChrome>none</systemChrome>
   <transparent>false</transparent>
   <autoOrients>false</autoOrients>
   <aspectRatio>portrait</aspectRatio>
</initialWindow>

 

And, for the Z10, when I created the rendering context/window I set the orientation like this:-

  screen_set_window_property_iv(qnx_screenWindow, SCREEN_PROPERTY_ROTATION, &angle);

 

That worked fine on the Z10 but setting the angle to 0 and having it in portrait doesn't work on the Q10, I need to set the orientation every frame or else it reverts back to being rotated 90 degrees clockwise. I also have to set the navigator orientation or else it is displaying properly but I can only minimise the app by sliding from the left side of the screen (rather than from the bottom).

This is the case until the phone goes to sleep, when I wake it up the app is still running and the navigator is acting correctly again (swipe from the bottom works).

 

Do I really have to do this every frame on the Q10?

  int angle = 0;

  screen_set_window_property_iv(qnx_screenWindow, SCREEN_PROPERTY_ROTATION, &angle);

  navigator_set_window_angle(0);
  navigator_set_orientation_mode(NAVIGATOR_PORTRAIT, NULL);
  navigator_set_orientation(NAVIGATOR_TOP_UP, NULL);

New Developer
allan175
Posts: 11
Registered: ‎11-07-2012
My Device: Playbook, Z10, Q10

Re: Z10/Q10 orientation problem

And even doing this every frame the first frame rendered is at the wrong orientation (rotated 90 degrees clockwise).

Developer
step_jac
Posts: 89
Registered: ‎05-31-2012
My Device: BlackBerry Playbook

Re: Z10/Q10 orientation problem

Hi Allan,

I had a similar issue which was resolved on a later version of the firmware. Which OS version/device are you using?

Best,

Stephane

New Developer
allan175
Posts: 11
Registered: ‎11-07-2012
My Device: Playbook, Z10, Q10

Re: Z10/Q10 orientation problem

I forgot to post a reply! I got this fixed by creating a surface the size of the device (and adjusting the games to fit the new size/aspect ratio).

 

The problem seemed to arise from the fact I was trying to create a rectangular rendering context and the Q10 would automatically put the long side to the left of the screen, even when I explicitly told it I wanted it to stay in portrait mode.

Although after it had gone to sleep and then woke again the contexts were all fine and the right way round. Seems like a system bug but using a 720x720 context fixed it so I just went with that.