Open rvillemeur opened 6 months ago
Can confirm, have seen this too when trying out Bloc/Toplo examples on Windows
As an easy fix, we could update BlOSWindowHost >> createAttributesFor: aSpace to set a default position which will show the title bar, like:
aSpace knowsPosition ifTrue: [
theAttributes position: aSpace position ] ifFalse: [theAttributes windowCentered: true ].
Which is the same behaviour we currently have when we open Pharo Morphic world
@plantec @labordep what do you think about @rvillemeur 's idea? I think it's a valid behavior to adopt.
I think an alternative can be to sum the title bae height to BlSpace's y, and call the SDL2 function using that sum... then the title bar can't be hidden. I will check. I think this is the SDL2 behavior on Mac platform... you can't open the window without the title bar being visible.
Hi! Yes I confirm this is crappy to always moving the window xD I like this proposition, what is the behavior on multiple screens?
Aha, I knew I fought with this problem: #121 first I wasn't realizing that the title bar was hidden "out of the screen".
I've found an interesting example to think on this problem, that is a low-level example of basic SDL2 window creation and destruction. It shows the usage of the "undefined position", and it opens on the center of the screen both in Mac and Windows. Try it evaluating: SDL2Example new simpleWindow
.
I consider this a point in favor of opening the BlSpace on the center of the screen.
Hi! Yes I confirm this is crappy to always moving the window xD I like this proposition, what is the behavior on multiple screens?
I'll open jn the center of the main screen. This is the same default behavior when you launch a specific pharo image from pharo launcher
On my Windows 10, I observe that 0@0 position, currently the initial position, places the window like this. And I set 0@16 and it starts to be partially inside the screen. And the SDL_Window function to get windows position returns exactly the set value,
https://github.com/pharo-graphics/Bloc/assets/3044265/b5a4286d-11cf-44ca-96f0-0a72fb186d32
This is a tricky way to call that get win position function directly, without any possible wrapping modification, is: (s hostSpace instVarNamed: 'window') validHandle sdl2Window position
)... it returns what you set.
Now in Mac platform this is not the same. I shared in next comment.
In Mac:
https://github.com/pharo-graphics/Bloc/assets/3044265/54c7b3d9-9bed-4529-815f-b26a9f5709ea
When I open a Space window in Windows 10, the top bar is hidden. I need to resize the space to see them. This issue happen on Pharo 11 or 12