Hi all,
I want to set a fixed position for windows on startup. My scenario uses the floating_window_layouter just like run/mixer_gui_qt_test. According to gems/src/app/floating_window_layouter/README, this should be as easy as adding a policy line to the layouters config. In the mixer_gui_qt_test I added:
<start name="layouter"> <binary name="floating_window_layouter"/> <resource name="RAM" quantum="4M"/> <config> <policy label_prefix="mixer_gui_qt" xpos="300" ypos="300"/> </config> <route> ...
Unexpectedly, when I run it the window is created as position (0,0). What's the right way to set the position of a window?
Also, I was wondering whether there is a way to set the dimension of a Qt window without changing the application?
Thanks!
Cheers, Alex
Hi Alex,
<start name="layouter"> <binary name="floating_window_layouter"/> <resource name="RAM" quantum="4M"/> <config> <policy label_prefix="mixer_gui_qt" xpos="300" ypos="300"/> </config> <route> ...
Unexpectedly, when I run it the window is created as position (0,0). What's the right way to set the position of a window?
thanks for bringing up this issue. This is indeed a silly bug in the window layouter. I just fixed it in [1].
[1] https://github.com/genodelabs/genode/commit/b2b21270d74feb402097a57591ad04b6...
Also, I was wondering whether there is a way to set the dimension of a Qt window without changing the application?
This is not possible out of the box. One idea to achieve that would be adding 'width' and 'height' attributes to the layouter's policy, following the pattern of 'xpos' and 'ypos'. But instead of immediately setting the window to the specified size, the layouter would set the 'requested_size' of the window. Internally, this would be handled like if user manually attempted to drag the border of the window to the specified size. The actual size will be set only if the application actually responds to the resize request. This is just an idea. I have not tried this out.
Cheers Norman
Hi Norman,
thanks for fixing, the positioning works as expected now. I changed my apps to request the desired width/height for now, but I guess extending the layouter to support that would be a sensible future enhancement.
Cheers, Alex
On 05.09.2017 16:04, Norman Feske wrote:
thanks for bringing up this issue. This is indeed a silly bug in the window layouter. I just fixed it in [1].
[1] https://github.com/genodelabs/genode/commit/b2b21270d74feb402097a57591ad04b6...
Also, I was wondering whether there is a way to set the dimension of a Qt window without changing the application?
This is not possible out of the box. One idea to achieve that would be adding 'width' and 'height' attributes to the layouter's policy, following the pattern of 'xpos' and 'ypos'. But instead of immediately setting the window to the specified size, the layouter would set the 'requested_size' of the window. Internally, this would be handled like if user manually attempted to drag the border of the window to the specified size. The actual size will be set only if the application actually responds to the resize request. This is just an idea. I have not tried this out.