Skip to content
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

Linux: remove misleading C++-style default values #253

Merged
merged 2 commits into from Dec 11, 2022
Merged

Linux: remove misleading C++-style default values #253

merged 2 commits into from Dec 11, 2022

Conversation

jpnurmi
Copy link
Contributor

@jpnurmi jpnurmi commented Dec 10, 2022

Even if window_manager_plugin.cc is compiled as C++, C++-style inline initialization of struct members doesn't work for _WindowManagerPlugin because the instance is not created by the C++ operator new but alloc'd and zero-filled by the GObject type system.

GObject explicitly guarantees that all class and instance members (except the fields pointing to the parents) to be set to zero.

https://docs.gtk.org/gobject/concepts.html#object-instantiation

Initial values can be set in window_manager_plugin_init() if needed.

jpnurmi and others added 2 commits December 10, 2022 10:33
Even if `window_manager_plugin.cc` is compiled as C++, C++-style inline
initialization of struct members doesn't work for `_WindowManagerPlugin`
because the instance is not created by the C++ operator new but alloc'd
and zero-filled by the GObject type system.

> GObject explicitly guarantees that all class and instance members
> (except the fields pointing to the parents) to be set to zero.

https://docs.gtk.org/gobject/concepts.html#object-instantiation

Initial values can be set in `window_manager_plugin_init()` if needed.
@lijy91 lijy91 merged commit f1fb25a into leanflutter:main Dec 11, 2022
@jpnurmi jpnurmi deleted the linux-type-init branch December 11, 2022 09:05
obiwanzenobi pushed a commit to obiwanzenobi/window_manager that referenced this pull request May 25, 2023
Even if `window_manager_plugin.cc` is compiled as C++, C++-style inline
initialization of struct members doesn't work for `_WindowManagerPlugin`
because the instance is not created by the C++ operator new but alloc'd
and zero-filled by the GObject type system.

> GObject explicitly guarantees that all class and instance members
> (except the fields pointing to the parents) to be set to zero.

https://docs.gtk.org/gobject/concepts.html#object-instantiation

Initial values can be set in `window_manager_plugin_init()` if needed.

Co-authored-by: LiJianying <lijy91@foxmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants