-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[wip] wl: Add CogWlPlatform::resized-window signal #620
[wip] wl: Add CogWlPlatform::resized-window signal #620
Conversation
2881a50
to
6ce79c8
Compare
08362c3
to
007a128
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have doubts about this...
Handling this signal allows to react to changes in the geometry of the window and decouples the CogWlView from the CogWlPlatform internal logic.
This is changing how internal parts of the Wayland platform plug-in interact with each other. As this is all internal, it is okay for the code to rely on internals from some other parts of the code. In this particular situation, we do not need to avoid coupling 🤔️
The view (or the views in the future) is now connected to this signal and reacts according.
This change is motivated towards the progress of being able to have more than one view.
Why is this needed when there is more than one view? You say multiple views motivate the change, but don't explain why in the commit message.
Wouldn't it be enough for each viewport/window to track the list of CogView
s it can display, and notify them about the resizing directly?
Why is a signal concerning a viewport/window attached to the CogPlatform
class? In my mind, it does not belong there, but rather it should be in a belongs in a new CogWlSurfacetype, which contains the
wl_surface` used to display web view contents and all the related functionality.
007a128
to
5db143a
Compare
The cog_wl_platform_resize_window() is moved to the View class as cog_wl_view_resize(). All the cog_wl_view_resize() are triggered inside of cog_wl_platform_configure_geometry() since the resize is a reaction to a change in the geometry of the Window.
The `resized-window` signal is emitted when the window is resized. Handling this signal allows to react to changes in the geometry of the window and decouples the CogWlView from the CogWlPlatform internal logic. The view (or the views in the future) is now connected to this signal and reacts according. This change is motivated towards the progress of being able to have more than one view.
5db143a
to
5b8f78e
Compare
I don't think. Actually the logic remains untouched. Just that now the resize of the window uses the signal mechanism instead of doing explicit calls to the
... this comes from the exploration done here in the PR Extend the Multiple Views support on Wayland. Since we are going to have 1-to-many relationships we are going to transitioned naturally to a events-signal logic to avoid repetitive
Ditto. In the future it will make things easier. It reduces the complexity of the code as it defines well an event and the responsibility to react to the event (this applies from just one View or to a doxens of them). Of course, this change could be done by just calling the Precisely, it is the signal what decouples the Platform from the View in the sense of the Platform notifies that the geometry of the window has changed, but it is not the platform's responsibility to know what to do or how to do the internals (calls to
Yes, I agree, the natural place would be something like the ViewPort/ViewGroup/Stack or even Window ... but right now it is Having said all this if you prefer. I can just just ignore the signal-event change until the ViewPort/ViewGroup/Stack is implemented and just call |
Discarded for now |
The
resized-window
signal is emitted when the window is resized.Handling this signal allows to react to changes in the geometry of the window and decouples the CogWlView from the CogWlPlatform internal logic.
The view (or the views in the future) is now connected to this signal and reacts according.
This change is motivated towards the progress of being able to have more than one view.
DEPENDS ON: #625