On some hardware combinations the display can be known, then unknown again. Meaining that
when the update monitors function is called it will have a value, then be called again
setting this.primaryMonitor to null. If the timing is just right gnome shell will
loadBackground, then by the time the animation is ready the monitor will be gone,
thus methods will be called on a null value. This adds more checks for a valid
primary monitor, and wont play the animation until the system is idle AND has a valid
priamry monitor.
Fixes: #5003
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2144>
T_() is a convenience shortcut for looking up a string from the
locale defined by LC_TIME, but it isn't recognized as a gettext
keyword. To do that, we also have to wrap the string in N_() or
NC_().
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2246>
It existed to fade out/in `nautilus-desktop` for the overview, but it only
ever worked for X11 sessions (`Meta.WindowType.DESKTOP`) and
`nautilus-desktop` no longer exists anyway.
While I had suggested extending it in the past (!1395), that work was
never finished and since then the DING extension has implemented its
own visibility toggling. There seems little value in keeping the old
fade logic around in gnome-shell. Removing it actually fixes a bug with
DING (https://launchpad.net/bugs/1965072).
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2244>
Creating these default folders still doesn't work. After some
investigation I found that's because the template we use for
the path when creating the `child` `Gio.Settings` instance
results in a double slash - it comes out as e.g.
/org/gnome/desktop/app-folders//folders/Utilities/ . dconf does
not gracefully handle this as many other things that handle
paths do, it considers it a programmer error. It results in
error messages like:
dconf_changeset_set: assertion 'dconf_is_path (path, NULL)' failed
which is slightly confusing. Anyway, we fix it by removing a
slash from the template.
Signed-off-by: Adam Williamson <awilliam@redhat.com>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2242>
Since the ClutterGrab rework, grabbing properly emits crossing events.
StButtons take a ClutterGrab as soon as they are pressed, so pressing
the close StButton of the WindowPreview takes a grab and causes a
LEAVE+key-focus-out event getting sent to the WindowPreview. This in
turn makes us hide our overlay (which the StButton is part of). We
automatically ungrab ClutterGrabs when hiding actors, so the StButtons
grab now gets released again, key-focus and hover state are updated
again and we emit an ENTER event to the WindowPreview. The preview now
tries show its overlay again and things explode because we re-enter the
mapping machinery.
For the LEAVE event we can break this cycle by detecting the GRAB_NOTIFY
crossing event of our own StButton and not reacting to that.
We should do the same for the key-focus-out event, but these don't pass
context information like a GRAB_NOTIFY flag yet, so just check the
current grab actor here.
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3165
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2231>
Commit ba23279f1f was aimed at fixing a
bug where the layout is frozen so early that we don't have an existing
one to re-use, because no allocation cycle happened yet. It tried to fix
that by forcing the creation of a layout when needsLayout === true,
this turned out to be a bit too much, as it also forced creating a new
layout when the layout was frozen after closing a window (which would
set needsLayout to true).
To fix this regression and still avoid reintroducing the bug the
previous commit fixed, tighten the check a bit and only force creating
the new layout when there's no allocation yet. This makes freezing the
layout after closing a window work again.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2236>
The magnifier uses a PointerWatcher (which is based on a simple timeout
source) to update the zoom region based on the current mouse cursor
position 60 times a second. When updating the zoom region, it would also
hide mutters cursor using meta_cursor_tracker_set_pointer_visible().
Since a few months, mutter has decoupled the handling of input events
from the monitor refresh rate though, which means it's no longer
guaranteed that the cursor changes only 60 times a second (on higher
refresh rate monitors it actually never was). This means mutter might
show the cursor more often than 60 times a second, while we hide it only
60 times a second, leading to a flickering second cursor.
To fix this, implement the cursor-hiding by listening to
MetaCursorTrackers visibility-changed signal, and immediately hiding the
cursor again when it's shown.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2234>
We want to use the current event time for activating the workspace, and
this time is only available when calling global.get_current_time() or
Clutter.get_current_event_time() from the context of an event handler.
So instead of trying to get that time when the animation has finished
from the onComplete() handler, get it before and store it as a variable
to use in the onComplete() handler later.
This fixes an error message when switching workspaces using the swipe
gesture where MetaWorkspace complains about the 0-timestamp we pass it.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2233>
In testing on Fedora, gnome-shell crashes here:
JS ERROR: TypeError: DEFAULT_FOLDERS[folder] is undefined
This needs to be a "for of" loop, not a "for in" loop, because
`folders` is an array of the hash's keys, not the hash itself.
Signed-off-by: Adam Williamson <awilliam@redhat.com>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2238>
In a very un-StButton fashion, OSK keys are not interested in
altering the current focus state, as otherwise pressing those
will trigger a grab that will alter key focus, so the generated
key or IM state events will not be handled by the actor that
originally had the focus as long as the OSK key is pressed.
Despite being StButtons, OSK keys do already perform their own
press/release handling with internal state tracking, so it is
not a big stretch to simply consume the events, and update the
:active pseudo-class manually.
This makes OSK keys still look and behave as usual, but without
any grabbing shenanigans that might affect the focus state. This
makes all OSK keys work again.
Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4986
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2237>
In the case of bringing up the OSK while there is a grab (like, every
GNOME Shell entry), we used to special case event capturing so events
directed to the OSK would be let through.
When Clutter.Grab came around, events would be propagated only within
the actor hierarchy that holds the grab, which rendered this special
case just as useless as the OSK while a grab was hold. Since it wouldn't
be part of the grab hierarchy, clicking on the OSK would do nothing.
In order to let the OSK handle events, double down on the special case
and let it forward the event directly to the actor under the device,
instead of trying to let it through somehow. Since the actor under the
device are usually OSK buttons in this case, we don't need further
propagation to make it work, which makes the OSK functional again while
the shell holds a grab.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2237>
The screencast portal supports recording a single window,
and presents a list of open windows when that option is
selected. To allow updating that list when windows are
opened or closed, add a new "WindowsChanged" signal that
the portal can listen to.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2229>
The transition from the overview freezes the workspace layout at the
start of the animation, which means that the calculated window slots
remain the same while the workspace itslef grows. This causes the
windows to appear slightly shrunk in comparison to the workspace and
shifted to the top left. This is especially noticeable during the
beginning of the animation when there is more weight on the slots than
the original window position and if there are not that many open
windows.
Unfreezing the layout for this transition is not possible, because it
would cause issues with newly opened windows abruptly changing the
layout when the animation happens after starting a new app.
This change instead tries to scale the frozen layout to the current
workspace size. While this is not entirely correct, because this scales
the spacing between the slots as well, it is still more accurate than
the completely unscaled slots.
Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4616
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1980>
We currently assume that any '::destroy' signal on a GObject type
has the semantics of the ClutterActor/GtkWidget signal, and should
therefore result in all signals being disconnected.
But we already have a case where the assumption doesn't hold: ShellWM
uses '::destroy' for the closing animation of windows, and the ShellWM
object itself remains very valid after the emission.
So rather than making assumptions about '::destroy', check objects
against a list of destroyable types that are explicitly registered
as such.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2226>
On some touchpads/laptops, the swipe gesture to open the overview can be
performed so fast, that it starts and ends in between two frames. Now
when this happens, and the gesture ended with too little movement to
confidently say the user intended to open the overview, we'll close the
overview again.
While closing the overview, we freeze the layout of the Workspace in
order to avoid changes to windows messing with the animation. This means
that in the case described above, we freeze the layout even before the
first frame of the opening animation happens. No frames being drawn also
means no allocations happening, and since we create this._layout in
vfunc_allocate(), this means that on the first allocation cycle of the
overview we'll see this._layoutFrozen = true, but will also not have
a this._layout nor this._windowSlots.
This creates an annoying visual glitch where for a split second all
the windows disappear (overview is visible but no WindowPreviews get
allocated).
To fix this, force creating a layout on the first allocation cycle, even
if the layout is currently frozen.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2203>
In the panel we listen for button presses on the panel in order to start
a drag op of the adjacent maximized window. With the recent changes
removing the source detail of events from Clutter, we now can no longer
access buttonEvent.source, but instead need to use
ClutterStage.get_event_actor().
Since that function expects us to pass a ClutterEvent and not a
ClutterButtonEvent, let's listen for the "button-press-event" signal
instead of connecting to vfunc_button_press_event(). This will give us a
ClutterEvent we can work with.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2225>
While we don't want to position overview elements according to
the work area, it does apply in the session when the overview
is hidden. That is, we should take it into account for the HIDDEN
state, so that transitions from and to the overview are correct.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2223>
The work area is really the space that is available to application
windows. Applying it to the overview is therefore questionable,
in particular given that
- X11 clients that affect struts aren't shown
- elements added by extensions have other means
to affect the overview layout
Not applying the work area to the overview also makes ignoring
actors' visibility for struts acceptable again: Assuming that
strut actors are only hidden when the monitor is in fullscreen,
freezing the work area instead of updating it for windows that
are fully obscured by a fullscreen windows makes perfect sense.
This reverts commits 81a1e294f8 and 2b074882f4.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2223>