There are three array properties, considering type:
1. float *float_array
2. int *int_array
3. void *array
Drop using array. This was inteded to be used when type is matrix and
count > 1, however some functions use it and others use
float_array. Fix this using always float_array, this starts to make all funcs
consistent handling the properties.
There's a mem leak when destroying the boxed value, only freeing the array
prop. Free the corresponding array considering the boxed value type to fix it.
_cogl_boxed_value_set_x func is still inconsistent, the next commits
will solve it.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3965>
Colorspace transformation matrices were hardcoded considering only known
colorspaces like bt709 or bt2020.
Now that a colorspace can be defined from its primaries, allow getting the
colorspace transformation matrix from them and drop the hardcoding.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3948>
This is because next commits will generate the colorspace
mapping matrix from the colorspace primaries and won't be required
to define any color space mapping matrix.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3948>
The single pixel buffer allows setting colors with 32 bpc.
Attempt to use pixel formats that allow higher precision than BGRA_8888.
First attempt to use half float format, fallback to ABGR_2101010 and
finally fallback to BGRA_8888.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3913>
lease_disappeared() was calling meta_drm_lease_disappeared() and
set_connectors_as_available().
meta_drm_lease_disappeared() emits the "revoked" signal, connected to
on_lease_revoked(), which marks the leased connectors as available by
calling set_connectors_as_available().
Therefore, calling set_connectors_as_available() again from
lease_disappeared() is redundant.
Remove the redundant call to set_connectors_as_available() and drop two
unused functions.
Fixes: fc44437876 ("wayland/drm-lease: Withdrawn leased connectors")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3675
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4029>
Because for `COGL_DRIVER_GL3`, `_cogl_context_get_gl_extensions` needs to
know that the GL version *really* is >= 3.0 before it calls `glGetStringi`
which didn't exist prior to GL 3.0 or ES 3.0.
This was causing crashes on Xilinx Mali implementations that only support
ES 2.0 (hence `glGetStringi` == NULL), but were being forced to call
that function before the GL version check which should tell you the
function isn't supported.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4019>
The NULL check was inverted, meaning we'd grab with no leader device.
That meant updates coming from the what-should-have-been leader device
getting lost because incorrectly being classified as non-leader of
the grab.
Fix this by only allowing to grab if we have a device, and always mark
the current tool device as the grab leader.
Fixes: e4004a7c4f ("wayland: Use the tool's current_tablet device instead of caching it")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4033>
GLES 2.0 does not have RGB8 and RGBA8 as sized internal formats. There
is OES_rgb8_rgba8 which adds RGB8 and RGBA8 but only for
RenderbufferStorageOES and not for TexImage2D which I wrongly assumed.
It seems like there is currently no GLES2 extension which adds RGB8 and
RGBA8 to TexImage2D so we have no choice but to fall back to unsized
internal formats in those cases as long as we don't want to drop GLES2
support.
This should be fine in practice and we should get our 8bpc textures.
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3680
Fixes: 7f943613a8 ("cogl: Use sized internal renderable formats")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4036>
meta_wayland_color_management_dispose func is only called when the compositor
is shutting down, in that case the wl_globals are already automatically removed.
meta_wayland_color_management_dispose calls wl_global_remove again,
this makes a SIGSEGV when color_management is enabled and mutter is being
shut down.
Stop calling wl_global_remove to fix it.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4032>
XPending() will do a recvmsg() syscall if there are no items in the queue.
In most cases, this is unnecessary because we know that there is data to be
read of the connection or there are items already read which simply need
to be processed.
Discovering both of those conditions can be done without recvmsg() in the
hot paths.
Before this path, every iteration of the main loop had the potential to
submit a recvmsg() syscall. This reduces that overhead drastically.
XFlush() on the other-hand knows if it needs to write data or not and will
do no IO in the case the buffer is empty.
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3653
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4006>
We only need to wake up the other side of the GAsyncQueue if we transition
from 0 to 1 item in the queue. Otherwise, we can be certain that the other
side has received a wakeup and will eventually flush the queue.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4007>
The wrong type resulted in a crash when returning from the function,
because g_slist_free was called instead of g_free for the old_struts
list data pointers.
Fixes: e005d035c0 ("boxes: Define cleanup function for MetaStrut and use auto-pointers")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4028>
Track toplevels being saved, and save state some time after. This
will make session state somewhat remembered on shell crashes, as
long as there was time to snapshot the data in disk.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3825>
Allow saving the session gvdb file in the background, with as little
overhead in the main thread as possible. We still need to serialize
all created/deserialized MetaSessionState to a GVDB hashtable there,
in order to avoid these being poked from the async task thread.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3825>
The xdg_session_manager_v1 global interface is the generator
of xdg_session_v1 objects for clients. These will notify of an
unique ID that can be used for future instantiations.
Once a xdg_session_v1 object is obtained, toplevels can be added
to be managed by it, and clients may get a hint about whether the
toplevel was restored to a saved state.
Changes by Carlos Garnacho: Integrate with MetaSessionManager core
object. Flesh out event emission of xdg_session_v1 and
xdg_toplevel_session_v1 objects, handle sessions being
replaced/deleted.
Changes by Sebastian Wick:
* make lifetimes of xdg_sessions entirely determined by the wayland and
handle its destruction via the signal
* fix session destruction vs deletion
* do not drop refcount of replaced session state temporarily to make
sure the replacing session keeps the state
* disconnect signals of destroyed and replaced sessions
* disconnect window-unmanaging signal handler for
MetaWaylandXdgToplevelSession
* call wl_resource_destroy in xdg_toplevel_session_remove to make it a
destructor
* handle session being destroyed before topevel-sessions
* handle the toplevel going away before the topevel-sessions
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3825>
This object is a windowing-specific implementation of MetaSessionState,
allowing to save window state for toplevel surfaces of a Wayland client
using the xdg_session_management_v1 protocol.
This object is detached from windowing logic itself, and will be
integrated in later commits.
Changes from Carlos Garnacho: Integrate state serialization with
MetaSessionState and MetaSessionManager.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3825>
Make this core object own the MetaSessionManager, for the window management
code to access.
At this level, we will be able to integrate with systemd notification
system, and use systemd fdstore to keep the mapped memory warm for
us for the case of soft reboot. This is at the moment not implemented
here.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3825>
This core object will be the manager of "client sessions", allowing
the windowing-specific paths to generate MetaSessionState objects to
track their clients.
This object is unused at the moment, and will be integrated in later
commits.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3825>
This is an abstract base class to implement a "client session",
carrying the accounting of the windows, and allowing to serialize/read
their state into a Gvdb table.
Since different windowing backends may require slightly different
data to be saved for each window, this is meant to have windowing-specific
implementations.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3825>
A nick property is a bit similar to the nick of a GObject property, in
that it's a shorter version of the name. It's intended to be used to
store state on the file system, where the state depends on the desktop
environment being used. E.g. gnome-shell sets the name "GNOME Shell",
which is, if no nick is explicitly set, transformed into the nick
"gnome-shell", which will be used for file paths.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3825>