Each workspace has a window that will be focused when switching to that
workspace. Add a function to retrieve that window.
This is only relevant for click-to-focus focus mode, since with the two
other modes no window will be focused upon switching, and will only gain
focus when hovered.
This will be used in the next commit to make this window appear focused.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/850>
This was introduced by accident in commit 1467b6b02a
y-inverted textures in combination with shape masks appear to
be only commonly used with EGLstreams. However, as we draw the
shape mask ourselves, we don't want to apply the y-invert to it
as testified by the left over `cogl_pipeline_set_layer_matrix()`.
Note that we still allow to apply viemports and buffer transforms,
as the Xwayland mode setting emulation may use it (in fact only
the former, but it probably does not hurt to leave the later as well).
Closes https://gitlab.gnome.org/GNOME/mutter/-/issues/1792
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1937>
Monitor configuration check tests can be very complex and in case of
failures we can't easily catch where a failure happened without entering
in debug mode, something that isn't always an option in CI or external
builders.
So add more debug statements in configuration check functions and use
macros to ensure that we print the caller function and location on more
complex check functions.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/522>
Primary monitor is just the same of the other monitors, but it has a
primary monitor flag. Since the computation of the scaling isn't
dependent anymore on the computed configuration we can now generate the
primary monitor config together with the others.
However, we've to ensure that the primary monitor is the first of the
configs list in order to properly compute the positioning.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/522>
Compute the monitor scaling in a separated function using the primary
monitor (not its config) and pass it to the creation function instead.
This will allow removing the special logic for the primary monitor.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/522>
Factorize the creation of a configuration inside one function that looks for
the primary monitor and the other monitors using the matching rules and
dispose them according to the chosen policy (checking if the result is valid
when using the suggested positioning).
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/522>
Add a find_monitors function that allows to search for monitors that match
the MonitorMatchRule filter and use this to look for the primary monitor and
the other monitors that need to match the requested filter in order to be
configured.
Having just one function doing this kind of checks reduces the possibility
of unexpected results.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/522>
Verify that the suggested monitor configuration contains only adjacent monitors,
and that if this is not the case we fallback to the linear configuration.
This can happen in case of multi-DPI setup, so add a test checking this too.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/522>
It could happen that monitors suggest to use coordinates that don't take
in consideration the scaling applied to one monitor, and such the
generated configuration is not valid because not all the monitors are
adjacent.
So enforce this check before accepting a suggested configuration as it
is.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/522>
We may need to check if rectangles region has adjacent neighbors and
so if there are no gaps in between monitors.
This can be done by checking if each monitor is adjacent to any other in
the same region.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/522>
This code sneaked unconditionally, even though we can disable
tracing code with -Dprofiler=false. Add some COGL_HAS_TRACING
checks so that this code is also optionally built.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1951>
This code sneaked unconditionally, even though we can disable
tracing code with -Dprofiler=false. Add some COGL_HAS_TRACING
checks so that this code is also optionally built.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1951>
This code sneaked unconditionally, even though we can disable
tracing code with -Dprofiler=false. Add some COGL_HAS_TRACING
checks so that this code is also optionally built.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1951>
Will be used to trace a lot more, and with more details, and thus may
have a larger impact on what is actually measured. This potential impact
is the reason for enabling only when needed.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1700>
A trace "anchor" is a trace head (CoglTraceHead) that is placed in a
certain scope (e.g. function scope), but then only triggered in another
scope, e.g. a condition.
This makes it possible to have optional trace instrumentation, that is
enabled only given e.g. a debug flag.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1700>
The failure to allocate was not properly handled, causing crashes later
on due to the offscreen being NULL.
#0 cogl_gl_framebuffer_bind (target=36160, gl_framebuffer=0x0)
#1 _cogl_driver_gl_flush_framebuffer_state (...)
#2 cogl_context_flush_framebuffer_state (read_buffer=0x55f48f386780, draw_buffer=0x55f48f386780, ...)
#3 cogl_framebuffer_clear4f (framebuffer=0x55f48f386780, ...)
#4 clutter_layer_node_pre_draw (...)
#5 clutter_paint_node_paint (...)
...
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1942>
When a selection owner advertises a mime type, but does not provide the
content upon a request for the mime type content, the requesting side
might wait indefinitely on the content.
To avoid this situation, add a timeout source, which will cancel the
selection transfer request after a certain timeout (15 seconds) passed.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1874>
Currently, if g-r-d closes the read end of the pipe for a
SelectionRead() operation, due to realizing that the application, that
should provide the mime type content, does not provide any content,
mutter won't notice that and still assumes that the read() operation
on the pipe in g-r-d is still happening, as mutter never writes to the
pipe in that situation and therefore cannot realize that the pipe is
already closed.
The effect of this is, that if g-r-d aborts a read() operation and
requests a new read() operation via SelectionRead(), mutter will deny
the request since it assumes that the previous read() operation is
still ongoing.
Fix this behaviour by also checking the pipe fd in mutter before
denying a SelectionRead() request.
https://gitlab.gnome.org/GNOME/gnome-remote-desktop/-/issues/60
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1874>