Commit Graph

11965 Commits

Author SHA1 Message Date
Florian Müllner
7b1544a7a2 closeDialog: Disable unredirection while showing
The dialog won't be visible when unredirection is in place (for example
while a fullscreen window is focused), so disable unredirection while
the dialog is up.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/298
2019-01-24 16:47:33 +01:00
Florian Müllner
a0f1ac87e9 messageTray: Fix sloppy backport
Commit 8111286463 was cherry-picked without accounting for the
screen/display API difference between 3-30 and 3-28.
2019-01-24 16:47:33 +01:00
Florian Müllner
1045b35c8b ibusManager: Don't pass undefined callback to ibus
Since commit 551e827841, we don't always pass a callback parameter.
However passing it on as undefined to ibus doesn't work, as gjs doesn't
accept that as a valid callback value and throw an error. As a result,
we can end up with no layout selected in the keyboard menu and an "empty"
indicator. Fix this by explicitly passing null if no callback has been
provided.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/293


(cherry picked from commit 74bb9e6249)
2019-01-21 16:28:20 +00:00
Georges Basile Stavracas Neto
24cdcc56da st-bin: Destroy child in ClutterActor:destroy vfunc
According to Clutter documentation, "[…] actors implementing the
ClutterContainer interface should override the default implementation
of the class handler of this signal and call clutter_actor_destroy()
on their  children."

StBin was doing that in GObject:dispose() instead. Move the child
destruction to a new ClutterActor:destroy() vfunc override.


(cherry picked from commit b719744e75)
2019-01-16 00:05:59 +00:00
Takao Fujiwara
1b28cdfbf4 keyboard: Do not call KeyboardManager.holdKeyboard() with set-content-type
When gnome-shell receives the signal of 'set-content-type' from ibus,
gnome-shell calls KeyboardManager.holdKeyboard() and
KeyboardManager.releaseKeyboard() and the functions change the current
input focus in GNOME Xorg and it could result in closing a popup window
which has a password entry by focusing on the entry.
The solution is to stop to call the APIs on 'set-content-type' signal.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/391


(cherry picked from commit 551e827841)
2019-01-15 15:24:40 +00:00
Florian Müllner
a73294312f altSwitcher: Fix error when all alternatives are disabled
While we do consider the case that we don't have a child to show for the
visibility, we are still trying to move the click action unconditionally.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/783

(cherry picked from commit e77463b875)
2019-01-11 11:30:27 +00:00
Florian Müllner
5e7a7e31a1 messageTray: Re-enable unredirection when banner is destroyed
The intention of commit 4dc20398 was to disable unredirection while
banners are shown, but the ::done-displaying signal currently used for
re-enabling unredirection is only emitted under some circumstances, so
it's possible that unredirection is left disabled indefinitely, whoops.

Fix this by tying disabling unredirection explicitly to the lifetime
of the banner actor.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/799

(cherry picked from commit e5ce3d541e)
2019-01-11 11:30:27 +00:00
Florian Müllner
8111286463 messageTray: Disable unredirection while showing banners
We don't usually show notification banners while the monitor is in
fullscreen, but when we do - the notification is urgent - we should
actually show the banner, even if the top-most window is unredirected.
To achieve that, disable unredirection while the banner is showing.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/430

(cherry picked from commit 4dc2039859)
2019-01-11 11:30:26 +00:00
Will Thompson
06c6ecc15b workspacesView: initialize self._restackedNotifyId
This attribute was previously only assigned in show(). hide() compares
this attribute to 0. If hide() is called before show() is first called,
the comparison would give the correct result (undefined > 0 is false)
but log a warning:

    JS WARNING: [resource:///org/gnome/shell/ui/workspacesView.js 529]:
    reference to undefined property "_restackedNotifyId"

Initialize this attribute in _init(), alongside _scrollEventId and
_keyPressEventId which are also used in hide().

(cherry picked from commit b2fabd9356)
2019-01-11 11:30:26 +00:00
Will Thompson
36f9dcd2bd endSessionDialog: squash "reference to undefined property" warning
dialogContent is set to one of the elements of the list DialogContent,
but not all of those have a checkBoxText property. When logging out (as
opposed to shutting down), this causes a warning:

    JS WARNING: [resource:///org/gnome/shell/ui/endSessionDialog.js
    763]: reference to undefined property "checkBoxText"

(The line number corresponds to this line in 3.28.3.)

The warning is apparently not triggered if the undefined property is
used as part of a boolean expression:

    gjs> var x = {};
    gjs> x.a;
    typein:2:1 strict warning: reference to undefined property "a"
    gjs> if (x.b) { log('oh no'); }
    gjs> x.c || ''
    ""
_setCheckBoxLabel() just checks the truthiness of its 'text' argument,
and the empty string is false-y, so passing '' rather than undefined has
no functional effect.

(cherry picked from commit 0892b5dcdb)
2019-01-11 11:30:26 +00:00
Andrea Azzarone
219118e633 viewSelector: Don't unfocus other modals on reset
Don't drop the key focus on Clutter's side if anything but the overview has
pushed a modal (e.g. system modals when activated using the overview).

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/618

(cherry picked from commit fffe58f829)
2019-01-11 11:30:26 +00:00
Florian Müllner
1e929357e0 panel: Also ignore hidden windows for proximity
We currently only ignore minimized windows, not windows that are
hidden for other reasons - namely on wayland windows are initially
hidden until they are placed.

This fixes a flicker in the transparent top bar on wayland when the
"position" of an unplaced window wrongly suggests the window is
overlapping the top bar.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/693

(cherry-picked from commit a0dc8dc7ef)
2019-01-11 11:30:26 +00:00
Marco Trevisan (Treviño)
e7463e38ca notificationDaemon: support file:// or icon theme names for image-path
While this sounds counter-intuitive, the image-path hint value might also
be used with URIs or icon names.

As per freedesktop standard:
  The "app_icon" parameter and "image-path" hint should be either an URI
  (file:// is the only URI schema supported right now) or a name in a
  freedesktop.org-compliant icon theme (not a GTK+ stock ID).

Thus the image-path hint should also be parsed as it happens for the
app_icon.

Reuse same logic, by falling back on _iconForNotificationData with the
hint value.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/285

(cherry picked from commit 33b8537bf5)
2019-01-11 11:30:26 +00:00
Andrea Azzarone
420c1cbfd1 dash: destroy items's child before tooltip
Destroy the DashItemContainer's child from the same handler as the tooltip. This
will prevent invalid reads when the item is destroyed while its quicklist is
still open.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/781

(cherry picked from commit ff2fbf5ae4)
2019-01-11 11:30:26 +00:00
Cosimo Cecchi
d53bd98532 StWidget: don't forget to invalidate the paint state if not on stage
If the actor is not on the stage yet (i.e. does not have a theme
node), but has a paint state cached, we currently fail to invalidate
it, which will lead to the actor painting with old contents once it
gets onto the stage.

This commit fixes the issue by changing our invalidation strategy;
previously we were looking at the widget's own theme node to determine
if it should be invalidated or not.
Now we look at the theme nodes of our cached paint states. When the
widget is mapped on stage, those are the same as the widget's own
theme node, but when the widget is not on the stage, we'll still be
able to invalidate them.

As part of this, we move the invalidation API to StThemeNodePaintState,
which is a more natural place for our use case.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/314

(cherry picked from commit 6743c18fdf)
2019-01-11 11:30:26 +00:00
Cosimo Cecchi
128a501b9a StTextureCache: use right event to detect file changes
StTextureCache installs file monitors that invalidate caches when
contents of the underlying file change.
At the moment, the cache uses the Gio.FileMonitorEvent.CHANGED event
type to make that determination.

However, that is suboptimal for at least two reasons:
- while a file is being written to disk, many CHANGED events will be
  emitted in sequence. That will cause needless cache invalidations,
  and we will risk loading the file before it's fully loaded.
- if an existing file is replaced, e.g. with g_file_replace(), we may
  not get a CHANGED event but a CREATED one instead, so the cache ends
  up never getting invalidated.

The good news is that in both of those cases GFileMonitor will send a
CHANGES_DONE_HINT event after changes have settled, or after the file
is replaced.

This commit fixes both cases by switching from the CHANGED event to
CHANGES_DONE_HINT to determine that a file has in fact changed.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/286

(cherry picked from commit ca3f4cfb41)
2019-01-11 11:30:26 +00:00
Florian Müllner
b29e243fec st: Avoid integer overflow on unpremultiply
When computing the effective border color, we operate on colors with
premultiplied alpha to simplify the calculations, then unpremultiply
the result. However we miss a bounds check in the last check, so any
color component can overflow the allowed maximum of 0xff and shift the
result in unexpected ways.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/305

(cherry picked from commit 925a25da17)
2019-01-11 11:30:26 +00:00
Jonas Ådahl
fa2ddcc52f dnd: Repick target actor if destroyed mid iteration
The picked target actor may be destroyed (e.g. hover style change
resulting in the ClutterTexture to be destroyed). If we don't handle
this, GJS will abort when it sees the exception caused by Javascript
code trying to access the destroyed target actor.

To handle it, listen on the 'destroy' signal on the target actor, and
repick, so a valid actor is passed to the next motion callback.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/632

(cherry picked from commit 4259676f6e)
2019-01-11 11:30:26 +00:00
Marco Trevisan (Treviño)
fbf194f6a1 st-button: Ignore pointer emulated touch events
In X11, pointer emulated touch events are replicated with normal PRESS, RELEASE
pair events which are generated by the server. Thus for a single tap we get:
 - TOUCH_BEGIN -> TOUCH_END, PRESS -> RELEASE

This will cause st-button to send two "clicked" signals, instead of just one,
breaking extensions (like dash-to-dock) that show buttons in the main stage
which will be checked two times or that will receive the same signal two times.


(cherry picked from commit 4c11d15a07)
2018-11-26 21:22:10 +00:00
Daniel van Vugt
5610a2435d iconGrid: Defer and group animation cleanup
The `reactive` property of icon actors was being restored 24 times over
the course of the spring animation, all at slightly different times as
each icon finished animating at different times.

The problem is that toggling `reactive` on an `StWidget` incurs a style
change of the `insensitive` pseudo class, and style changes would quickly
queue relayouts incurring full stage reallocation. This occurred many times
during a spring animation hogging the CPU and limiting the frame rate.

The solution is defer and batch the cleanup for all icons until after the
last icon has finished animating. This way the CPU impact of the style
change and stage relayout isn't felt during the animation so the frame
rate remains higher and smoother. The overall CPU usage of the animation
is also reduced as the remaining relayouts are much more likely to be
grouped into a single frame.

Icon spring animation performance on an i7-7700:
Before: 83% CPU and 47 FPS
After : 78% CPU and 54 FPS
which is about a 22% increase in performance per clock (FPS/CPU).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/253


(cherry picked from commit a5e6dd52d2)
2018-11-20 19:52:16 +00:00
Florian Müllner
a5b36fc7f4 osdWindow: Disconnect signals on destroy
Since we started to show OSD windows on all monitors, OSD windows are
destroyed when the corresponding monitor is disconnected. We shouldn't
leave any signal handlers around in that case - they prevent the object
from being garbage collected, and trigger warnings for accessing proper-
ties of invalidated GObjects.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/602
2018-10-30 13:13:50 +01:00
Marek Černocký
923d80bba8 Updated Czech translation 2018-10-07 14:32:30 +02:00
Florian Müllner
9e196d2765 workspace: Avoid setting an undefined width
Since commit c04289853f the `width` parameter may be undefined, but
it is still set unconditionally, whoops.
2018-09-04 17:30:56 +02:00
Florian Müllner
94897492be calendar: chain up to parent on _onDestroy
(cherry picked from commit 5bca4a884e)
2018-09-03 23:39:40 +00:00
Marco Trevisan (Treviño)
6baf82eb83 messageList: stop syncing if closeButton has been destroyed
The _sync function for Message only updates the close button visibility,
so we can safely stop doing that if the close button get get destroyed earlier
(as it happens when clicking on it).

https://bugzilla.gnome.org/show_bug.cgi?id=791233


(cherry picked from commit 87da623d86)
2018-09-03 23:38:47 +00:00
Marco Trevisan (Treviño)
65d27aaa43 automountManager: remove allowAutorun expire timeout on volume removal
If the volume is removed before AUTORUN_EXPIRE_TIMEOUT_SECS seconds, we can stop
the timeout earlier as there's nothing to unset, while the volume instance
won't be valid anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=791233


(cherry picked from commit 9c41736a81)
2018-09-03 23:38:17 +00:00
Marco Trevisan (Treviño)
176aaa4a97 extensionSystem: Unset stylesheet file reference when unloaded
We must remove the GFile reference from the representing object when an
extension has been unloaded as this won't be used anymore later (e.g. as cached
ref).


(cherry picked from commit 72f5802be9)
2018-09-03 23:36:00 +00:00
Marco Trevisan (Treviño)
5ae5811155 js/main: Throw error if no valid default stylesheet is found
Throw an error using an informative message in case a mode uses a stylesheet
that can't be loaded, instead of crashing later because the theming can't be
properly computed, and thus the minimum size of the actors.


(cherry picked from commit 30cb2127a1)
2018-09-03 23:35:30 +00:00
Marco Trevisan (Treviño)
e027af9548 extensionSystem: Unload stylesheet if extension is not loaded
We should not keep any reference to an extension custom stylesheet in case we
got an error while enabling that


(cherry picked from commit 3aea290adc)
2018-09-03 23:34:54 +00:00
Marco Trevisan (Treviño)
73649a0d6a extensionSystem: Don't load an extension with invalid stylesheet
We currently assign the stylesheet to an extension whenever the file exists,
regardless of whether it actually loaded successfully or not.
And thus we load an extension that ships a stylesheet even if that file can't
be used.

There is no point in trying to load an extension if its stylesheet wasn't
loaded in the first place, so make sure this happens only on success.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/188


(cherry picked from commit 5b3ff7184e)
2018-09-03 23:34:26 +00:00
Iain Lane
7dbcd26619 network: Don't assume the active connection has been processed first
`NMConnectionDevice._sync()` is responsible for setting up the active
connection that we'll end up displaying. It expects the active
connection to already be in a map `_connectionItems`. If it isn't in
there, we get a null dereference and the indicator can get into a weird
state where it doesn't display devices / connections properly.

Let's change this expectation. If there is an active connection,
`_deviceAdded()` will eventually get to it and call `_sync()` to set up
the active connection state. We make `_sync()` tolerate there being no
active connection when it's called.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/140


(cherry picked from commit 5d61e2563d)
2018-09-03 23:34:07 +00:00
verdre
f30ec4a4c8 workspace: Don't initially hide the title of window overlays
To be able to read the properties of the title correctly during the
first relayout of the overlay, the title, just like the border, can't be
hidden. Otherwise the title can be misaligned some pixels to the left
sometimes.

This slighty worsens the issue that windows moved to a separate
workspace using DND will show an overlay when the workspace is shown in
the overview even though no window is pointed at. Before this commit,
only the border would be visible for windows moved to another workspace,
now the title also is.
2018-09-04 01:18:00 +02:00
verdre
c04289853f workspace: Avoid setting overlay title width
Avoid setting the width of the overlay title ourselves to keep the
default width of -1, this way StLabel will change its width by itself as
soon as the text is updated.

The width only needs to be changed if the window title changes, and we
don't animate it in this case anyway so there's no need to pass a width
to _animateOverlayActor().

Setting the title width to the preferred width on relayout is impossible
because get_preferred_width() will always return the width we set the
label to before. If the width is not set to -1, there's no way to get
the new preferred width without calculating it ourselves from the
underlying ClutterText instance.

https://bugzilla.gnome.org/show_bug.cgi?id=787260
2018-09-04 01:18:00 +02:00
Marco Trevisan (Treviño)
b72b773d87 search: Ignore search provider results metas if search is cancelled
When a search has been cancelled, it is expected that providers don't
return the requested number of results, so don't log a warning in that
case.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/205
2018-09-04 01:12:24 +02:00
Marco Trevisan (Treviño)
da7cd2807f search: Cancel search provider operations on clear
Ensure that the search provider operations (just getResultMetas requests
in the current implementation) in progress are properly cancelled when we
clear the UI, otherwise returned results might still be added when not
needed.

This is triggered for each provider by the SearchResults reset.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/205
2018-09-04 01:12:12 +02:00
Marco Trevisan (Treviño)
20373ba64e viewSelector: Cancel search on overview hidden
Currently when the overview is hidden, any pending search is kept alive,
not only at remote search provider level (as per issue #183), but even
the shell providers proxies continue to get and process data. This happens
even if this is not needed anymore, while the UI reset is performed only
next time that the overview is shown (causing some more computation
presentation time).

In order to stop this to happen, when the overview is hidden, we have to
unset the search entry to an empty value as this would make SearchResults
to have empty terms list and that would make the proxies cancellable to
be triggered (without causing any further search to start).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/205
2018-09-04 01:12:04 +02:00
Ray Strode
025f6eb68e objectManager: correct other invalid index code in onNameVanished
The object manager tries to synthesize interface removal
events if the bus name of a remote object drops off the bus.

The code had bad typos in it, though: it reuses the `i`
index variable in its inner loop, where it should be using
the `j` index variable.

This commit corrects the i/j confusion.
2018-09-04 01:11:40 +02:00
Ray Strode
dc5df5c4c9 objectManager: correct invalid index code in onNameVanished
The object manager tries to synthesize interface removal
events if the bus name of a remote object drops off the bus.

The code has a bad typo in it, though: it confuses `objectPaths`
(the list of all object paths) and `objectPath` (the object
currently being processed this iteration of the loop).

That leads to a failure to synthesize the interface removal
events, and spew in the log.

This commit corrects the objectPath/objectPaths confusion.
2018-09-04 01:11:40 +02:00
Marco Trevisan (Treviño)
81db908339 layoutManager: Return null monitor if focusIndex is invalid
https://bugzilla.gnome.org/show_bug.cgi?id=788882


(cherry picked from commit 996dd74157)
2018-08-31 14:40:35 +00:00
Marco Trevisan (Treviño)
706a2259b8 windowManager: Don't animate unmanaged windows on (un)minimization
(cherry picked from commit 878946962d)
2018-08-31 14:40:01 +00:00
Sam Spilsbury
e94af71430 keyboard: Handle case where keyboardMonitor is unset
This may be the case where keyboardIndex is -1, which may be the
case where either the keyboard monitor hasn't been set yet, or
the keyboard is being unmanaged and meta_window_get_monitor
returns -1

https://bugzilla.gnome.org/show_bug.cgi?id=788882


(cherry picked from commit 19e864ed3b)
2018-08-31 14:39:12 +00:00
Sam Spilsbury
a662e7bb87 windowMenu: Check if monitorIndex is valid before using it
Calling meta_window_get_monitor on an unmanaged window may return
-1, so we need to check the return value.

https://bugzilla.gnome.org/show_bug.cgi?id=788882


(cherry picked from commit c9bf72c5c4)
2018-08-31 14:38:54 +00:00
Florian Müllner
0b82388c49 overviewControls: Sync hover after drag operations
During global grabs, actors miss enter and leave events required
for correct hover tracking. This can cause the workspace switcher
to get stuck while slid out, so ensure the actor's hover state is
synced after drag operations.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/161


(cherry picked from commit 328c63bf64)
2018-08-31 14:28:11 +00:00
Carlos Garnacho
b359b937e9 layout: Mark chrome container as NO_LAYOUT
Showing and hiding children does not affect the allocation of the uiGroup
nor its other children. We can avoid full relayout/redraw in those
situations.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/197


(cherry picked from commit 73d8c82640)
2018-08-31 14:27:15 +00:00
Carlos Garnacho
98fb7c33f2 windowManager: Declare variables
Fixes warnings from GJS.


(cherry picked from commit 2f76951658)
2018-08-31 14:22:21 +00:00
Jasper St. Pierre
4dfc2e0fd1 st-texture-cache: Obey cache policy in st_texture_cache_load
https://bugzilla.gnome.org/show_bug.cgi?id=663461


(cherry picked from commit 50e849a186)
2018-08-31 14:15:30 +00:00
Carlos Garnacho
9152d3a286 st-box-layout: Queue relayout on adjustment changes
The actor allocation doesn't change per-se, but apply_transform()
will practically transform it. In order to have the paint volume
update accordingly, queue a relayout.


(cherry picked from commit ab4c72d758)
2018-08-31 14:11:58 +00:00
Carlos Garnacho
ba33a05dd2 st: Clip StEntry to allocation
The default get_paint_volume() implementation will do the union
of children, and the child ClutterText paint volume may expand
beyond StEntry size when text overflows.

We actually want all content to be clipped to the StEntry, so
implement get_paint_volume() and tell it so.


(cherry picked from commit 86a520b880)
2018-08-31 14:11:05 +00:00
Carlos Garnacho
ddb309815c st: Make StScrollables' paint volume reflect the unconstrained view
And constrain it in StScrollView instead (instead of falling back to an
infinite paint volume, as the actor as paint/pick impls, but no
corresponding get_paint_volume one).

Fixes artifacts with the AppView (and possibly other places) when paint
volumes are aggressively cached.


(cherry picked from commit 4bf033a885)
2018-08-31 14:08:57 +00:00
Florian Müllner
6a796675bd keyboard: Handle no-window case in FocusTracker
For windows, the cursor location needs to be adjusted by the frame
offsets. However we cannot assume that there is a window, as the
shell itself can have the key focus.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/414


(cherry picked from commit 0dee82fb9f)
2018-08-31 13:48:21 +00:00