Window (application) resize and position on weston imx8 apalis

Hi there,

I’m launching 2 instances of cog as a browser inside weston, but the application windows spawns “randomly” on the screen. Is there any way to reorganize the screen? and position the window in a specific X/Y location?

This might not be exactly what you want, but have a look at this SO post: gtk3 - Moving (repositioning) a Child Window or Dialog in Gtk / Gtkmm - Stack Overflow

The reply has the following line:

So whether you can arbitrarily move windows: the answer is no.

Hi there @nandanv ,

Thanks for the response but that’s not seems to be what i’m looking for (at least the way i can “see” it)
I don’t want to move the windows/apps around the, i want to make them spawn i’m a logical arranged specific way in a 1080p screen and stay there, instead of spawning “randomly”

A more visual way to explain this:

I have a 1080p screen connected via HDMI to my apalis board, and i want to launch the “com.example.left” with a size of 960x1080 starting at x=0, y=0, and the “com.example.right” with a size of 960x1080 starting at x=960, y=0

Hello @rawmance ,
In your drawing I see that you want to use Weston kiosk shell.
Looking at the description of the shell I see that:

Weston’s kiosk-shell is a simple shell targeted at single-app/kiosk use cases.

That means that it can only display a single app, full-screen. To use multiple apps you would need to use multiple outputs.

As an alternative you could try the IVI shell, but I have no experience on this one.

Best regards,

1 Like

Hi @josep.tx ,

I’m trying to investigate now the ivi-shell, but it seems that there are no “sufficient” examples on how to use this.
I’m trying to figure out what is the best path to achieve this :frowning:

Hello @rawmance ,

I have asked internally about this topic.

Best regards,

1 Like

Oh great news @josep.tx , thanks!

Hello @rawmance ,
Unfortunately I could not find any additional information on this topic. Have you been able to make any progress on your side?

Best regards,

Hi @rawmance ,

What is the status of this one here?

Best Regards

Hi there guys,

Sorry but still no clue how to do that, the ivi-shell documentation vs examples are very rare, (or atleast i can’t find proper) i still keep trying to find a way to apply the solution i need, as changing the complete UI solution isn’t a way :frowning:

Hello @rawmance,

I see that you tagged yocto as your development environment. Does this mean you built a reference multimedia image adding Cog?

I’m launching 2 instances of cog as a browser inside weston, but the application windows spawns “randomly” on the screen.

Could you please list down the steps/procedure with which I could get into this status? Then I could take a look and possibly reproduce the issue and try to solve it from there.

Hi there,

Yes, i’ve built a very simple image: your reference multimedia image, and adding wpe+cog support just to test this scenario.
After that, when running weston i just spawn 2 cog instances via ssh:

export XDG_RUNTIME_DIR=/run/user/`id -u`
cog --gapplication-app-id=com.example.left -P wl
cog --gapplication-app-id=com.example.right -P wl

and then, 2 instance of cog appear on the screen. Ofcourse, on random positions.

Thanks in advance

Hi @rawmance !

I have an update to share with you, although it is most probably not so useful.

It is related to the IVI shell on Weston.

After going to Weston’s source code, I found a example for IVI shell:

Important observation:

  • I went for the branch 10.0 as we have in our Bookworm container the weston 10.0.1.
  • This is not the “final” file. I had to
    • replace @westondatadir@ with /usr/share/weston, and
    • replace @bindir@ with /usr/bin

After modifying the file, I placed it on the module (outside containers) in /home/torizon/weston-ivi/weston.ini

Then, I killed all containers running on the module (e.g. $ docker rm $(docker stop $(docker ps -a -q))) and ran the following command on the module to launch the Weston container using IVI shell:

$ docker run -e ACCEPT_FSL_EULA=1 --rm --name=weston \
--net=host --cap-add CAP_SYS_TTY_CONFIG \
-v /dev:/dev -v /tmp:/tmp -v /run/udev/:/run/udev/ \
-v /home/torizon/weston-ivi/:/etc/xdg/weston/ \
--device-cgroup-rule='c 4:* rmw' --device-cgroup-rule='c 13:* rmw' --device-cgroup-rule='c 199:* rmw' --device-cgroup-rule='c 226:* rmw' \
torizon/weston-vivante:$CT_TAG_WESTON_VIVANTE --tty=/dev/tty7

Some comments:

  • The command above is based on the command from the section Debian With Weston Wayland Compositor of Debian Containers for Torizon | Toradex Developer Center
  • Because of how this container image works (specifically due to dos2unix program) I must bind mount the folder /home/torizon/weston-ivi on top of the folder /etc/xdg/weston instead of mounting only the file weston.ini.
  • I removed the --developer in order to use the weston.ini from /etc/xdg/weston instead of from /etc/xdg/weston-dev

With all this, I had access to the following on HDMI:

And I could launch applications which will stay on half screen, as you need:

A general comment:

  • To launch the applications since the startup of the container, I think you can edit the entry point of the container (there is more than one way to do this), so you can launch your applications.

A potential issue:

  • Quickly looking into IVI shell’s source code, seems like the panel is hard coded. I could not find a way to remove it (maybe it is possible and I just didn’t find a way…).

Let us know if this helps you :slight_smile:

Best regards,


Hi @rawmance !

Did you have time to try the steps I shared above?

Does it help you?

Let us know :slight_smile:

Best regards,