Commit Graph

5990 Commits

Author SHA1 Message Date
Daniel van Vugt
a5e6dd52d2 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
2018-10-30 18:01:05 +00:00
Georges Basile Stavracas Neto
c0b561dd4a
switcherPopup: Bind to the stage, not the monitor
The switcher popup is a large, mostly transparent actor that
should cover all the clickable area of GNOME Shell. In Clutter
terms, it should cover the whole stage.

By binding it to the primary monitor, the Alt+Tab behavior
becomes a bit inconsistent. For example, by not hiding when
clicking at empty spaces at other monitors.

Fix that by binding the SwitcherPopup to the whole stage,
and not only the primary monitor.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/647
2018-10-25 12:33:10 -03:00
Carmen Bianca Bakker
0f542c2e16 Remove padding from date strings
The padding is removed by using %-d instead of %e or %d.

Examples:

"%B %d %Y"  -> "October 04 2018"

"%B %e %Y"  -> "October  4 2018"

"%B %-d %Y" -> "October 4 2018"

https://gitlab.gnome.org/GNOME/gnome-shell/issues/666
2018-10-25 13:05:47 +02:00
Carmen Bianca Bakker
cff9eaf5aa Change a translator comment to be less ambiguous
https://gitlab.gnome.org/GNOME/gnome-shell/issues/666
2018-10-25 13:05:08 +02:00
Sebastian Pinnau
7026a6fd32 automountManager: Add handling of udisks errors for no/wrong passwords
If no password or a wrong password is entered after automounting an
encrypted device, then the password should be reasked. However, this
does not happen because the relevant udisks error messages for this
cases are missing in the exception handler that calls _reaskPassword.

Fix this issue by adding the relevant udisks error strings to the
exception handling in the _onVolumeMounted method.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/640
2018-10-24 00:13:10 +02:00
Florian Müllner
a0dc8dc7ef 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
2018-10-23 16:24:22 +02:00
Florian Müllner
8566ec2ee5 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-22 14:58:50 +00:00
Didier Roche
ae7dd5e2db osdWindow: Ensure we setMaxLevel before setting Level itself
When maxLevel is > 100%, first OSD appearance was capping the current
level to 100%. Consecutives key press were then OK.
Ensure we setMaxLevel before setting Level itself, so that correct cap
value is applied.
2018-10-19 16:18:41 +02:00
Florian Müllner
76117fd306 appFolder: Don't block all shortcuts
App folder popups take a grab when opened, and as we don't pass any
particular pushModal() parameters, all keybindings are blocked. While
this makes sense for most keybindings that would interfere with the
popup interaction, others like volume/brightness keys or screenshots
can be allowed safely.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/648
2018-10-11 20:12:54 +02:00
Andrea Azzarone
8855622666 popupMenu: Handle keypress if numlock is enabled
Add exception to handle a keypress if numlock is enabled as we already do for
capslock. This uses Clutter.ModifierType.MOD2_MASK because at the moment there
is not a more explicit way to refer to the numlock mask.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/550
2018-10-11 07:45:44 +00:00
Georges Basile Stavracas Neto
38c1ebba62
dash: expand and center align DashItemContainer
This is necessary to keep the small actor that shows up
during drag motion center aligned.
2018-10-08 22:43:13 -03:00
Georges Basile Stavracas Neto
557b232c89
panel: Delegate container destruction to PanelMenu.ButtonBox
Instead of taking care of the PanelMenu.ButtonBox.container
destruction by itself, delegate that to the very object that
created it in the first place: PanelMenu.ButtonBox itself.
2018-10-08 22:43:13 -03:00
Georges Basile Stavracas Neto
038f8b6ea5
keyboard: Stop using Shell.GenericContainer
This is the last remaining usage of Shell.GenericContainer
in the codebase, and posed small challenges compared to the
other removals.

A new St.Widget subclass called InputSourceIndicatorContainer
was added as a replacement to the Shell.GenericContainer. It
was needed because GNOME Shell needs to override the regular
size allocation functions, but InputSourceIndicator already
is a St.Widget with its own size allocation overrides.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
2018-10-08 22:43:01 -03:00
Georges Basile Stavracas Neto
b4c674900f
inspector: Stop using Shell.GenericContainer
No alarms and no surprises here.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
2018-10-08 22:43:01 -03:00
Georges Basile Stavracas Neto
3fa19e58ac
boxPointer: Stop using Shell.GenericContainer
An easy removal too.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
2018-10-08 22:43:01 -03:00
Georges Basile Stavracas Neto
f460f2748d
boxPointer: Add compatibility API
Because we're late in the cycle, and don't know how many
extensions actually rely on this API, this commit adds
back the BoxPointer.show() and .hide() functions, with
warning messages to notify consumers that this is going
to be removed.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
2018-10-08 22:43:01 -03:00
Georges Basile Stavracas Neto
8b215b2446
boxPointer: Rename show/hide to open/close
Pretty much like dd4709bb2, BoxPointer's show() and hide()
functions will clash with Clutter.Actor's ones.

In addition to that, on a conceptual level, the current API
is not great, because calling boxPointer.hide() won't result
in boxPointer.actor.visible == false.

For these reasons, rename show() and hide() to open() and
close(). A compatibility layer will be added in a following
commit, warning about the usage of show() and hide().

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
2018-10-08 22:42:53 -03:00
Georges Basile Stavracas Neto
dd225713a1
layoutManager: Subclass GObject.Object
LayoutManager is currently a pure JavaScript class that
relies on the rudimentary Signals.addSignalMethods() to
handle signals. This is an inefficient implementation of
one of the most central classes in GNOME Shell.

In addition to removing Shell.GenericContainer, then,
turn LayoutManager into a proper GObject.Object subclass.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
2018-10-08 22:42:26 -03:00
Georges Basile Stavracas Neto
f4682748fa
layoutManager: Stop using Shell.GenericContainer
This one was remarkably easy to port. In order to make it,
replace the Shell.GenericContainer handlers by a constraint
and simply replace it by a St.Widget.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
2018-10-08 22:42:26 -03:00
Georges Basile Stavracas Neto
b058e89166
workspaceSwitcherPopup: Stop using Shell.GenericContainer
Removing Shell.GenericContainer here was slightly trickier
because it required factoring out a new JavaScript class.

It's nevertheless a straightforward removal.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
2018-10-08 22:42:26 -03:00
Georges Basile Stavracas Neto
ac314cfb05
messageTray: Drop Shell.GenericContainer usage
Nothing particularly outstanding with this class - it was
a straightforward removal and subclassing.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
2018-10-08 22:42:26 -03:00
Georges Basile Stavracas Neto
fc342fe8c5
buttonBox: Drop Shell.GenericContainer usage
Another easy port.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
2018-10-08 22:42:25 -03:00
Georges Basile Stavracas Neto
dd4709bb27
appMenuButton: Rename show/hide to fadeIn/fadeOut
In the next commit, we will turn PanelMenu.ButtonBox into a
St.Widget subclass. As a domino effect, PanelMenu.Button will
become one too, and so will Panel.AppMenuButton.

When that happens, the current show() and hide() functions in
Panel.AppMenuButton will clash with Clutter.Actor's ones.

To avoid that, rename these functions to fadeIn() and fadeOut()
and avoid a name clash.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
2018-10-08 22:42:25 -03:00
Georges Basile Stavracas Neto
e9f4f2e8ae
thumbnailBox: Stop using Shell.GenericContainer
This is another straight port from Shell.GenericContainer.
The important thing to notice is that the calculation is
broken if the StThemeNode helpers (adjust_preferred_* and
adjust_for_*) aren't used.

The downside of this patch is that it removed the skip_paint
from the thumbnails. Keeping it would add an unecessarily
large amount of code.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
2018-10-08 22:42:25 -03:00
Georges Basile Stavracas Neto
197c0eee29
iconGrid: Stop using Shell.GenericContainer
Removing Shell.GenericContainer from the IconGrid class was
challenging because it needs the "skip paint" API from it.
This API was added, too, as a workaround to the inability
to override vfuncs from GJS.

The overrides are largely copy-pasted and translated versions
of the Shell.GenericContainer code.

The IconGrid:key-focus-in signal was renamed to :child-focused
to avoid clashing with ClutterActor:key-focus-in.

In GridSearchResults, the internal IconGrid had it's y_expand
set to false, so it doesn't push other search elements (the
list results mainly) to the bottom of the screen.

Because skip paint wasn't and still isn't a GObject property,
rename it to _skipPaint to reflect that.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
2018-10-08 22:42:25 -03:00
Georges Basile Stavracas Neto
034a723677
iconGrid: Rename ::key-focus-in signal
As part of our quest to obsolete Shell.GenericContainer, IconGrid will
become a Clutter.Actor subclass. As the ::key-focus-in signal would
clash with Clutter.Actor::key-focus-in, rename it to ::child-focused.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
2018-10-08 22:42:25 -03:00
Georges Basile Stavracas Neto
efb3025d8c
dash: Set scale and opacity on parent actor
DashItemContainer currently animates the scale and opacity
of its child when zooming in. This is visible when adding
a new favorite item to the dash; the items will zoom in from
the center.

After the previous commit, however, the zoom animation got
slightly broken, and looked like the icon was coming from
the bottom instead of the center.

Fix that by setting the scale and opacity of DashItemContainer
itself, instead of its child. Remove the unused code after that
too.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
2018-10-08 22:42:24 -03:00
Georges Basile Stavracas Neto
81ec8215a0
baseIcon: Stop using Shell.GenericContainer
Pretty much like the previous patches, this extends St.Bin. The
most interesting aspect of this patch is that most of the sizing
routines of the icons is now delegated to the actors and layout
managers, removing quite a bunch of code.

The 'spacing' theme property is now redirected to StBoxLayout's
spacing property. Also adjust the Dash code to stop forcing a
potentially invalid width in the first icon too.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
2018-10-08 22:42:24 -03:00
Georges Basile Stavracas Neto
4be66ecf01
windowIcon: Subclass St.BoxLayout
Following the previous work, turn WindowIcon into a
St.BoxLayout subclass, and remove the this.actor
field from it.
2018-10-08 22:42:24 -03:00
Georges Basile Stavracas Neto
c6cea277eb
switcherList: Stop using Shell.GenericContainer
This commit removes all the uses of Shell.GenericContainer from
SwitcherPopup.SwitcherList. Compared to the other patches, this
one was specially trickier to get right, and a few invasive
changes needed to be done.

The most noticeable one is that the allocation of the items is
done entirely by St.BoxLayout -- we don't manually allocate them
anymore. To make it work, get_preferred_width() had to calculate
the correct value. It now assumes that:

 * Minimum width: the minimum width of the widest child.
 * Natural width: the minimum width of the StBoxLayout (use it
   instead of the natural width to force the labels to ellipsize
   when too long.)

The AppIcon class became a St.Widget subclass as well, to override
get_preferred_width() and be able to keep the squared shape.

Besides that, add a new SwitcherButton class to reimplement squared
icons without having to resort to hacks in the size allocation
machinery. This class has a single vfunc override to ensure that it
is squared when the SwitcherList is.

The arrows indicating multiple windows are now in this._list
actor to the SwitcherPopup itself, since this._list automatically
manages its own children now.

At last, adapt (but preserve) the hack in CyclerPopup.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
2018-10-08 22:42:24 -03:00
Georges Basile Stavracas Neto
9a47b4b343
switcherList: Remove unused variable
The title is self-explanatory, 'primary' was not being used
anywhere.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
2018-10-08 22:42:24 -03:00
Georges Basile Stavracas Neto
0ec36fc5cf
switcherPopup: Use MonitorConstraint instead of vfunc overrides
Instead of overriding vfunc_get_preferred_width|height(), use the
already available Layout.MonitorConstraint to bind SwitcherPopup
to the primary monitor.
2018-10-08 22:42:23 -03:00
Georges Basile Stavracas Neto
a315e75e95
switcherPopup: Subclass St.Widget
This commit turns SwitcherPopup.SwitcherPopup into a St.Widget
subclass, and gets rid of Shell.GenericContainer usage. Subclasses
were adapted to that too.

This class introduced a new challenge: it overrides show(). As per
discussions, we now call this.visible = true inside show().

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
2018-10-08 22:42:23 -03:00
Georges Basile Stavracas Neto
e82c68accd
switcherPopup: Rename destroy() to fadeAndDestroy()
In the process of purging all usages of Shell.GenericContainer
of GNOME Shell, one specific problematic situation that might
occur is when classes have functions that would clash with any
ClutterActor or StWidget function name.

One of such example is SwitcherPopup.destroy(). Right now, this
class is a pure JavaScript class that wraps a real actor, but
soon this will change, and it'll become a St.Widget subclass.

Another problem with functions that mimic the toolkit ones is
the predictability of them; after calling destroy(), that widget
is expected to not be available anymore. In SwitcherPopup case,
it is still available for a short while. In this case, that's not
a big problem, but the show() and hide() functions in other clases
are more problematic because the actor's visibility does not
follow that.

This commit is a first step in cleaning that up, and changes the
SwitcherPopup.destroy() to fadeAndDestroy().

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
2018-10-08 22:42:23 -03:00
Georges Basile Stavracas Neto
286ffbe2b6
panel: Stop using Shell.GenericContainer
Shell.GenericContainer exposes the size negotiation machinery
through the use of signals. Signals are not specially performant.
One of the reasons is that they acquire a global lock for signal
handlers lookup. GNOME Shell has more than 2,000 actors at any
given point in time, up to 20 levels deep in hierarchy, making
size negotiation and painting non-trivial tasks. Such a critical
section of Clutter's machinery shouldn't rely on signals
whatsoever.

Regardless of that, Shell.GenericContainer is a workaround to
a non-existing issue anymore. It shouldn't be used anyway, and
any performance improvements that removing it can potentially
yield are bonuses to it.

This commit starts this work by removing Shell.GenericContainer
usage from Panel.Panel class. The class now extends St.Widget,
and as such, it has no "this.actor" field set anymore. A couple
of places where this actor field was used are adjuste as well.

It is important to notice that we now allocate the Panel itself
inside vfunc_allocate(). This was previously done before emitting
the signal by Shell.GenericContainer.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
2018-10-08 22:42:23 -03:00
Florian Müllner
501a1aff68 appFavorites: Don't add app explicitly
When adding a favorite, we add the ID to the list of favorites, save the
setting and add the new app to the favorites map. However as writing the
settings value already results in reload() to update the favorites map,
the new app is usually already in the map when we add it.

The only exception is when the ID was found in the RENAMED_DESKTOP_IDS map,
in which case we end up adding both the renamed app and the original one.
Fix this by simply relying on reload() to properly update the map, just like
we already do in _removeFavorite().

https://gitlab.gnome.org/GNOME/gnome-shell/issues/471
2018-10-08 16:22:04 +00:00
Florian Müllner
586a9ff9cd layout: Don't update input region on wayland
We already see all events on wayland, so we can save us the work
of computing the XFixes region there.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/273
2018-10-08 16:03:53 +00:00
Florian Müllner
7190666075 closeDialog: Untrack chrome when window loses focus
On X11, reactive chrome must be added to the input region in order
to work as expected. However that region works independently from
any window stacking, with the result that the unresponsive-app dialog
currently blocks all input in the "covered" area, even in windows
stacked above the unresponsive window.

The correct fix would be to track the unobscured parts of the dialog
and set the input region from that, but that's quite cumbersome. So
instead, only track chrome when the corresponding window is focused
(or the dialog itself of course).

https://gitlab.gnome.org/GNOME/gnome-shell/issues/273
2018-10-08 16:03:53 +00:00
Florian Müllner
e2f6a1980d automountManager: Explicitly track active operations
As a mount operation's UI may be reused (for example after mistyping
the password), we only close the operation once the mount has finished
(successfully or with error).

We therefore need to track ongoing operations, which we currently do
by monkey-patching the corresponding volume object. However while the
underlying GVolume object indeed remains the same through-out the
operation, the JS wrapper object isn't referenced anywhere and may
thus be garbage collected, resulting in a stuck dialog.

Fix this issue by tracking active operations explicitly, so that all
involved objects are referenced until the end of the operation.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/565
2018-10-08 13:18:53 +00:00
Andrea Azzarone
fffe58f829 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
2018-10-04 16:40:46 +00:00
Bastien Nocera
361955dbf9 appFavorites: Add evince to rename list
Evince 3.30 changed the desktop filename. Without this patch,
evince will disappear from the dock.
2018-10-04 17:54:01 +02:00
Andrew Zaborowski
4609cf1912 networkAgent: Ask for wifi secrets in the hints paremeter
The `hints` and `settingName` parameters to the agent call may define
the specific list of secrets NM actually needs from the user.  This
seems to have been the intended use of these two parameters but only
recently did NM with the IWD backend start to use this to request 802.1x
secrets.  So if `hints` is provided, ask user for the specific secrets
listed there and don't even look at what type of EAP method is in use.
Only the three types of secrets actually in use by NM's IWD backend are
supported for now -- they happen to be the same three that
_get8021xSecrets() had already supported.
2018-09-26 00:34:22 +00:00
Carlos Garnacho
11fb91f60f keyboard: Listen to IbusPanelService::focus-in/out to track focus changes
In X11 there's no input panel state requests, so restore the previous behavior
that focused entries would always toggle the OSK on there.
2018-09-25 23:49:42 +00:00
Carlos Garnacho
7ea034c719 keyboard: Filter redundant FocusTracker::position-changed signals
Just emit the signal if it did actually change.
2018-09-25 23:49:42 +00:00
Will Thompson
b2fabd9356
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().
2018-09-25 23:00:53 +01:00
Will Thompson
0892b5dcdb
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.
2018-09-25 21:28:35 +01:00
Adam Williamson
33ffdd6061 Fix connection to wifi APs from user menu (RH #1628263)
In recent Fedora 29, connecting to wifi access points from the
user menu (top-right menu) does not work. Clicking the 'Connect'
button just animates it but does nothing else. The logs show an
error "JS ERROR: Error: Expected type utf8 for Argument
'specific_object' but got type 'undefined'".

Looking into this, it seems the problem is these uses of the
`path` property of an NMAccessPoint. NMAccessPoint inherits
from NMObject, and NMObject *does* have a path property:

https://developer.gnome.org/libnm/stable/NMObject.html#NMObject--path

so at first glance this seems fine. But I poked around a bit
using libnm via Python (which goes via introspection, just like
this JS code does), and found that indeed AccessPoint objects
don't seem to have a `path` property there either.

Looking at the libnm code, this actually makes sense, because
the property is marked "(skip)":

https://github.com/NetworkManager/NetworkManager/blob/master/libnm/nm-object.c#L1291

and the introspection docs suggest that means it should be left
out of introspected output:

https://wiki.gnome.org/Projects/GObjectIntrospection/Annotations#Symbol_visibility

I'm a bit concerned that this was only found recently - whereas
the change to use `.path` in gnome-shell dates from October 2017
(d71af5e5) and the property has been marked (skip) in NM since
at least 2016 - but this all seems to add up. The obvious fix is
to replace use of `.path` with `.get_path()`, which returns the
path and is *not* marked (skip) and so *is* available via
introspection. I tested that this works in Python and also did
a test build of gnome-shell with this change and installed it on
an affected system, it does seem to fix the bug.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2018-09-18 16:15:32 -07:00
Florian Müllner
94423151b2 dbus: Move all interface descriptions into the resource
https://gitlab.gnome.org/GNOME/gnome-shell/issues/537
2018-09-17 07:34:49 +00:00
Andrea Azzarone
179cd0a3c8 keyboard: Remove leftover call to get_current_time 2018-09-14 12:18:38 +02:00
Daniel Drake
fcdac69eea switchMonitor: switch to next config upon initial keypress
In GNOME-3.24, pressing Super+P or a similar function key would cause
a switch to the next available monitor configuration.

However, in GNOME-3.26, this was reimplemented in mutter and gnome-shell
and the behaviour is now different: pressing Super+P and releasing will
cause no change in montor configuration[1]. In this new design you have
to press Super+P and keep holding Super in order to keep the switcher
open, then press P again (or use the arrow keys or mouse) to
select the next one in the list.

This is incompatible with many Asus products such as Asus X530UN, where
pressing the presentation mode media key (Fn+F8) actually generates
the following keypress events from the keyboard controller:

Fn pressed: nothing
F8 pressed: nothing
F8 released: Super press, p press, p release, Super release (quick burst)
Fn released: nothing

With this firmware behaviour it's not possible to hold the keys and have
the dialog come up so that you can select another new mode.

To solve this, when the switcher is opened, select the next available
display config by default, which is more similar to the pre-GNOME-3.26
behaviour. Now pressing Fn+F8 on this laptop will result in the display
mode switch taking place.

[1]: The mentioned desired behaviour will at least happen after
https://gitlab.gnome.org/GNOME/mutter/issues/281 has been fixed

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/208
2018-09-13 16:11:16 +00:00
Florian Müllner
9d6e1a89fc workspaceTracker: Don't keep multiple trailing workspaces
Since we always keep the active workspace until the user switches
to a different one, we may end up with two empty workspaces at
the end. It's not obvious to users why this happens, and there's
indeed no good reason for the behavior - just remove the trailing
workspace in that case.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/536
2018-09-13 13:44:52 +02:00
Carlos Garnacho
b087752b55 windowManager: listen actively to windows being destroyed during WS switch
Prevents gjs from dealing with already dispose()d objects.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/539
2018-09-11 14:32:33 +00:00
Jürg Billeter
2d791a51c0 windowMenu: Port from Meta.ScreenDirection to Meta.DisplayDirection
Meta.ScreenDirection no longer exists. This fixes window menus on
multi-monitor systems.

	JS ERROR: TypeError: Meta.ScreenDirection is undefined
	_buildMenu@resource:///org/gnome/shell/ui/windowMenu.js:135:17
2018-09-11 12:59:07 +02:00
Iain Lane
5d61e2563d 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
2018-09-03 23:31:17 +00:00
Marco Trevisan (Treviño)
72f5802be9 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).
2018-09-03 23:29:01 +00:00
Marco Trevisan (Treviño)
30cb2127a1 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.
2018-09-03 23:29:01 +00:00
Marco Trevisan (Treviño)
3aea290adc 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
2018-09-03 23:29:01 +00:00
Marco Trevisan (Treviño)
5b3ff7184e 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
2018-09-03 23:29:01 +00:00
Marco Trevisan (Treviño)
760406002f 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:00:52 +02:00
Marco Trevisan (Treviño)
c47a740c83 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:00:52 +02:00
Marco Trevisan (Treviño)
0fe5a3c0c4 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:00:52 +02:00
Florian Müllner
5bca4a884e calendar: chain up to parent on _onDestroy 2018-09-03 22:43:21 +00:00
Marco Trevisan (Treviño)
9c41736a81 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
2018-09-03 22:43:21 +00:00
Marco Trevisan (Treviño)
87da623d86 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
2018-09-03 22:43:21 +00:00
Marco Trevisan (Treviño)
3033506f2c dnd: Nullify _dragActor after we've destroyed it, and avoid invalid access
We need to avoid that we use the _dragActor instance after that it has
been destroyed or we'll get errors. We now set it to null when this
happens, protecting any access to that.

Add a DragState enum-like object to keep track of the state
instead of using booleans.

Remove duplicated handler on 'destroy' and just use a generic one.

https://bugzilla.gnome.org/show_bug.cgi?id=791233
2018-09-03 22:43:21 +00:00
Jonas Ådahl
900398406c panel: Keep prefs in sync with shell-shows-app-menu state
Previously mutter listened to Xsettings (via GTK) to get notified
whether the shell showed the app menu. After X11 support was changed in
the direction of being less central, listening to this particular
Xsettings were removed with the intention of having the Shell tell
mutter directly whether it was showing the menu or not.

This commit makes that happen. It still travels through Xsettings (still
via Gtk), as the shell still gets that state from Xsettings, but fixing
this is out of scope for this particular fix.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/276
2018-08-28 23:53:10 +00:00
Marco Trevisan (Treviño)
dbf993300a js: use ES6 template strings for dbus interfaces
Use multiline template strings for dbus interfaces as they're easier to maintain
2018-08-27 19:23:00 +02:00
Daniel van Vugt
f77b3da74f js/ui: Choose some actors to cache on the GPU
Flag some actors that are good candidates for caching in texture memory
(what Clutter calls "offscreen redirect"), thereby mostly eliminating
their repaint overhead.

This isn't exactly groundbreaking, it's how you're meant to use
OpenGL in the first place. But the difficulty is in the design of
Clutter which has some peculiarities making universal caching
inefficient at the moment:

 * Repainting an offscreen actor is measurably slower than repainting
   the same actor if it was uncached. But only by less than 100%,
   so if an actor can avoid changing every frame then caching is usually
   more efficient over that timeframe.

 * The cached painting from a container typically includes its children,
   so you can't cache containers whose children are usually animating at
   full frame rate. That results in a performance loss.
     This could be remedied in future by Clutter explicitly separating a
   container's background painting from its child painting and always
   caching the background (as StWidget tries to in some cases already).

So this commit selects just a few areas where caching has been verified
to be beneficial, and many use cases now see their CPU usage halved:

One small window active...... 10% -> 7% (-30%)
...under a panel menu........ 23% -> 9% (-61%)
One maximized window active.. 12% -> 9% (-25%)
...under a panel menu........ 23% -> 11% (-52%)
...under a shell dialog...... 22% -> 12% (-45%)
...in activities overview.... 32% -> 17% (-47%)
(on an i7-7700)

Also a couple of bugs are fixed by this:

https://bugzilla.gnome.org/show_bug.cgi?id=792634
https://bugzilla.gnome.org/show_bug.cgi?id=792633
2018-08-27 14:16:59 +00:00
Andrea Azzarone
ce4c485f34 windowManager: Ignore auto-repeat activation of toggle keybindigs
Use Meta.KeyBindingFlags.IGNORE_AUTOREPEAT for open-application-menu
and toggle-message-tray keybindings.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/373
2018-08-20 11:14:38 +00:00
Andrea Azzarone
1877a2e00a viewSelector: Ignore auto-repeat activation of toggle keybindigs
Use Meta.KeyBindingFlags.IGNORE_AUTOREPEAT for toggle-application-view
and toggle-application-view keybindings.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/373
2018-08-20 11:14:37 +00:00
Florian Müllner
9a5a4b2206 Revert "workspaceThumbnail: rebuild thumbnails if workareas size changed"
It is unclear what the change was supposed to be fixing, but it
broke animations of workspace additions and removals, as those
events trigger the ::workareas-changed signal.

This reverts commit c29bd46e7a.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/162
2018-08-19 12:41:08 +00:00
Carlos Garnacho
3ab9e9e8ad runDialog: Use ClutterText::activate for enter handling
Instead of consuming the event in front of the input method. Enter
is sometimes overriden by those, so it seems better to let the IM
handle the key event, and react later to it if it got propagated
anyway. That is what ::activate does, so use this signal.

This used to work before ClutterInputMethod/InputFocus because the
IM received the events directly from stage captured events. This
is not the case anymore.

Closes: #440
2018-08-17 18:37:32 +00:00
Florian Müllner
764fbbe052 overview: Restore previous workspace switcher policy
We used to keep the workspace switcher slid out when the user made use
of workspaces. This was changed in commit 2d84975 to give more space
to window previews, but it turned out to make the switcher quite a lot
more difficult to interact with (rather than only being a question of
discoverability). So go back to the previous behavior.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/161
2018-08-14 17:34:57 +00:00
Florian Müllner
328c63bf64 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
2018-08-14 17:34:57 +00:00
Carlos Garnacho
73d8c82640 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
2018-08-14 19:13:30 +02:00
Florian Müllner
afe5703710 networkAgent: Fix another ByteArray => Uint8Array instance
This was missed in commit 7ca418a79a. As we are dealing with
non-\0-terminated data here, go through GBytes this time.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/189
2018-08-06 12:16:59 +00:00
verdre
02d06bb1f3 overview: Use whole stage size for cover pane
We show a cover pane on top of the overview during transitions to
prevent issues caused by clicks and mouseover events when the overview
is not ready. Right now, this pane is only being shown on the primary
monitor, which obviosly allows interactions to happen before the
animations are finished on the secondary monitors.

To fix this, use the size of the whole stage for the cover pane.
2018-08-06 10:18:28 +02:00
Carlos Garnacho
6b610b26f8 keyboard: Refactor code resetting IM on window drags
When a window is dragged, the OSK should get hidden. Just
do this in a nicer way.
2018-08-03 17:02:20 +02:00
Carlos Garnacho
81956e9b84 keyboard: defer position-changed till we have a rect
Emitting it that soon results in JS warnings, as we don't have
everything in place yet. The position-changed signal will be
emitted from other locations as soon as we have it.

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

Closes: #464
2018-08-03 13:12:20 +02:00
verdre
da2fc2c9d3 workspace: Simplify detecting added dialogs after closing a window
When trying to close a window in the overview by clicking the close
button and the window doesn't get closed but a dialog is added to the
window afterwards, we close the overview and show the dialog.

Instead of adding a separate listener for the window-added signal to the
WindowOverlay, let the WindowClones remember that the close button was
pressed and activate themselves if a dialog is added after that.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/180
2018-08-03 00:09:02 +02:00
verdre
52cbc299a7 workspace: Fix infinite loop when finding parent window of dialogs
When a dialog is added to a window while the overview is shown, we get
its parent using get_transient_for() so we can add it to the right
window clone.

If we have multiple layers of dialogs we have to do this recursively
until we find the root ancestor. This case currently results in an
infinite loop: Since parent is always set to the same window, the
while-condition will always be true.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/180
2018-08-03 00:09:02 +02:00
Florian Müllner
d908940ef3 showOSD: Fix handling of defined 'falsy' parameters
For the OSD, all parameters except for the icon are optional - if the
caller doesn't include the 'label' option, the OSD won't show a label
etc.

While this makes sense for an API, it means that we have to be careful
to correctly differentiate an option that was omitted and an option
that has a 'falsy' value like false or 0.

Unfortunately since commit ccaae5d3c we no longer do, with the result
that OSDs meant for the first monitor will show up on all, and a level
of 0 is presented as no level bar instead of an empty one, whoops.

https://bugzilla.gnome.org/show_bug.cgi?id=791669
2018-08-01 13:58:23 +02:00
Florian Müllner
393d7246cc Replace custom override schema with per-desktop override
GSettings now recognizes per-desktop overrides that can be used
to change schemas' default values for a particular desktop. This
is not entirely unlike our existing custom override mechanism in
mutter, except that it is not limited to keys in org.gnome.mutter,
and it doesn't require a separate schema - the latter means that
we (and gnome-teak-tool) no longer have to figure out the correct
schema for the current login session and just use the original one.

https://bugzilla.gnome.org/show_bug.cgi?id=786496
2018-07-31 18:36:26 +00:00
Didier Roche
6217c3b88d volume: Show overamplified icon when in overdrive
Show an overamplified volume icon if volume is louder the max normalized one.
Use a similar logic as gnome-settings-daemon to delimit values, restricted
to output.
The purpose is to help users remember that visiting some websites or
using some apps can get LOUD.

https://bugzilla.gnome.org/show_bug.cgi?id=790280.
2018-07-31 18:14:15 +00:00
Didier Roche
ddd4fd9c24 barLevel: Add "overdrive" capability
Implement for barLevel an overdrive area. This is a zone represented via a
different styling to indicate that you are bypassing the normal zone of
a given level, without reaching yet the maximum limit.

https://bugzilla.gnome.org/show_bug.cgi?id=790280.
2018-07-31 18:14:14 +00:00
Didier Roche
d2a97e7f1d volume: Allow volume above 100%
Depending on hardware and recorded volume level, turning up the speakers
to the maximum volume may not be enough and the user will want to amplify
the volume above 100%. Currently this requires opening the sound Settings
panel which gets cumbersome when required repeatedly.

To support this case better, allow raising the sound volume above 100%
directly from the system menu if the feature is enabled via the
`allow-volume-above-100-percent` key in `org.gnome.desktop.sound`.
2018-07-31 18:14:13 +00:00
Didier Roche
aa75e89216 osdWindow: Allow levels above 100%
Allow osd representing levels that can be more than 100% by accepting
an optional parameter setting that maximum level.
gnome-settings-daemon will use this to indicate volume levels above 100%,
which our own volume indicator will soon support as well.
2018-07-31 18:14:11 +00:00
Didier Roche
3f756dc608 barLevel: Support maxValue higher than 1
Ensure that both barLevel and slider can support a higher maxValue than 1
and computes various positions based on it.
It defaults to 1 if not set.

https://bugzilla.gnome.org/show_bug.cgi?id=790280.
2018-07-31 18:14:10 +00:00
Didier Roche
ed8e89bc19 osdWindow: Reuse BarLevel drawing functionality
Reuse the BarLevel class to get similar drawing behavior as Slider.
Rename theme css impacted properties and ensure that the osdWindow
remains accessible.
Ensure we don't force setting a custom border color like on the OSD.

https://bugzilla.gnome.org/show_bug.cgi?id=790280.
2018-07-31 18:14:10 +00:00
Didier Roche
c90a4e4849 levelBar: Factor out bar drawing
Split drawing logic from Slider to BarLevel subclass.
This changes part of the theme css from -slider- to -barlevel-.

https://bugzilla.gnome.org/show_bug.cgi?id=790280.
2018-07-31 18:14:09 +00:00
Georges Basile Stavracas Neto
f433b12d6e system: Don't execute Settings
In a9ad91c831, a bug was introduced in the following code:

```c
            this._settingsAction.connect('clicked',
                                         this._onSettingsClicked().bind(this));
```

Notice that the callback is being executed! This commit
fixes that by removing the '()' from the callback.
2018-07-31 13:31:59 -03:00
Florian Müllner
7ca418a79a Explicitly convert raw data to strings
As strings are guaranteed to use UTF-8 in the GNOME platform, generic
file APIs like g_file_load_contents() return raw data instead. Since
gjs' recent update to mozjs60, this data is now returns as Uint8Array
which cannot simply be treated as string - its toString() method boils
down to arr.join(',') - so use gjs' new ByteArray module to explicitly
convert the data.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/179
2018-07-31 16:28:53 +00:00
Florian Müllner
a9ad91c831 system: Pick up Settings name and icon from app
The settings action button in the system menu simply launches
gnome-control-center, so we want its icon (and accessible name)
to always match the app. So instead of keeping the button in-sync
with Settings, just look up that information from the app itself.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/433
2018-07-31 16:52:47 +02:00
Florian Müllner
bd1c7774ee system: Enforce symbolic icons in action buttons
We can simply request the symbolic variant from CSS so that we don't
have to append '-symbolic' to all the names. This will always make
it easier to pick up that information from external sources (like
.desktop files).

https://gitlab.gnome.org/GNOME/gnome-shell/issues/433
2018-07-31 16:52:47 +02:00
Florian Müllner
91da3789bc windowManager: Fix switch animation between non-adjacent workspaces
Commit e5c95b910d refactored the workspace animation to also handle
animations that involve all surrounding workspaces, but due to an
ill-advised review comment (guess whose) it broke the animation
for non-neighboring workspaces.

Update the code to handle correctly whether in a given direction:
 - we have the target workspace of a given index
 - we have a neighboring workspace
 - we don't need to animate anything

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/182
2018-07-31 06:51:35 +02:00
Daniel Drake
49d8ff38e7 Add check_cloexec_fds debug command
Add a debug command (to be executed manually via Alt+F2) to check
that all of gnome-shell's file descriptors have the CLOEXEC flag set.
This is important so that internal file descriptors do not get passed
to apps when they are launched.

It prints a warning message for every fd that does not have the flag set.

fdwalk() is used from the standard library if available (it is not
available in glibc), otherwise we use the same implementation as glib
has internally.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/132
2018-07-30 23:11:41 +00:00
Carlos Garnacho
ebe6f59d7e windowManager: Make workspace switching gestures follow motion
When 4fg swipe motion happens, set up early the workspace switching
animation with all surrounding workspaces. This allows us to move
all content back and forth in any direction. This works on both
touchcreens and touchpads.

When the gesture is activated, the same data is reused to follow
up with the tween animation.

The threshold has been also doubled, it was fairly small to start
with, and feels better now that workspaces stick to fingers.

https://bugzilla.gnome.org/show_bug.cgi?id=788994
2018-07-30 21:20:52 +00:00
Carlos Garnacho
e5c95b910d windowManager: Refactor workspace switching animations
Besides the separation into distinct functions, the stored data has
been made able to generically store windows from all surrounding
workspaces. All while keeping a special mode to animate between two
workspaces (The usual till now), this is the only mode exercised so
far.

In order to ease animations, all window groups are now children of
a common container, which is then animated.
2018-07-30 21:20:50 +00:00
Carlos Garnacho
2f76951658 windowManager: Declare variables
Fixes warnings from GJS.
2018-07-30 21:20:49 +00:00
Florian Müllner
6688610c23 screenshot: Add PickColor() method to Screenshot interface
Use the newly added API to implement a color picker method in the
screenshot interface, so that the desktop portal can expose it
to applications.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/286
2018-07-30 16:55:10 +00:00
Florian Müllner
d2c75801ea screenshot: Allow bypassing lockdown setting
The setting is only relevant when writing to disk is required. We
will soon expose a screenshot method that doesn't, so make it
possible to ignore it.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/286
2018-07-30 16:55:10 +00:00
Florian Müllner
da537cda43 screenshot: Adopt GIO's async pattern
A custom callback type is more convenient, but only as long as no
other callback type is required. We are about to add functionality
that does not return the filename to a screenshot saved on disk, so
prepare for that by moving to GIO's generic async callback pattern.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/286
2018-07-30 16:55:09 +00:00
Jan-Michael Brummer
304c667bca windowManager: Add top edge drag gesture to unmake fullscreen window
Fullscreen windows cannot be restored by touch device users unless the
application adds support for it.
As it is unlikely to change all application lets introduce a top edge
drag gesture which unmakes fullscreen windows.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/123
2018-07-28 12:11:41 +02:00
Jonas Ådahl
879a81abeb remoteAccess: Make indicator orange
Make the indicator for active remote access use the warning color, to
indicate the severity of allowing remote access.

This only makes the indicator icon orange; the icon in the system menu
is still white.
2018-07-27 18:10:35 +02:00
Marco Trevisan (Treviño)
ce3555382b workspaceThumbnail: Sync clone position changes with actor
We need to update the clone position if window actor (not the meta window)
position changed.

https://bugzilla.gnome.org/show_bug.cgi?id=776588
2018-07-24 11:08:25 +00:00
Marco Trevisan (Treviño)
837a00c3f0 workspace: Recompute bounding box on window 'position-changed'
We need to update the clone position if window size changed
also, rename meta window 'size-changed' callback accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=792681
2018-07-24 11:08:25 +00:00
Jonas Ådahl
0d5bae3844 Add remote access indication and control
Add an indicator for when there is something access the display server
remotely. This could be 1) remote desktop, 2) screen cast or 3) remote
control, but all effectively applications using
org.freedesktop.portal.ScreenCast or org.gnome.portal.RemoteDesktop as
well as gnome-remote-desktop using the corresponding org.gnome.Mutter
APIs directly.

As it is now, it'll simply show a single icon for when anything is
having an active session, and a single action "Turn off" that'll close
every active session.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/160
2018-07-23 14:03:26 +02:00
Florian Müllner
e36ba874a8 Stop using conditional catch statements
It is a mozilla extension that is going away in SpiderMonkey 60.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/151
2018-07-17 17:02:39 +00:00
Iain Lane
22392d1328 loginManager: Get the session ID from logind if XDG_SESSION_ID unset
If we're started by systemd, we won't be in the user's display session.
However, this is still the session that will get locked & unlocked. Ask
logind what the 'display' or 'greeter' session is, and watch for the
Unlock signal for that session to know when to unlock.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/137
2018-07-17 17:44:18 +02:00
Florian Müllner
0dee82fb9f 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
2018-07-17 01:44:18 +02:00
Florian Müllner
905801b178 panel: Allow restoring maximized/tiled windows by touch
Maximized and tiled windows can be restored with a drag gesture,
not only from their titlebars, but also from any non-reactive
parts of the top bar above the window. Currently this only works
for actual pointer devices, extend the behavior to handle touch
as well.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/112
2018-07-14 18:38:16 +00:00
Xavier Johnson
4a7082bb0f switcherPopup: Cancel window cycling with Tab
If the Escape key is used for a window/app cycler/switcher shortcut
(such as "Switch windows directly"), then there is no way to cancel
the switching/cycling operation with the keyboard.

This change allows cancelling such an operation by pressing the Tab
key, but only if Tab is not already being used by the current
switcher/cycler shortcut.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/315
2018-07-14 14:35:05 +00:00
Andrea Azzarone
2e90c5fa4b popupMenu: Don't handle key presses directly if there are modifiers
Key events involved in a keyboard shortcut are not completely consumed by
Mutter. That means that if the popupMenu is bound to a shortcut (e.g.
Alt<Space>) and the user keeps the keys pressed, the same key-event will be
delivered to the popupMenu. We can workaround this issue filtering out all the
events where a a modifier is down (except capslock).

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/372
2018-07-14 14:04:18 +02:00
Florian Müllner
e7f2e92410 events: Re-use event messages where possible
Destroying and recreating the entire events list on every change is not only
wasteful, it also breaks the clear functionality as messages scheduled for
removal are replaced with "new" messages after the first message has been
removed.

Address both issues by keeping track of all messages and re-use them
whenever possible.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/325
2018-07-13 20:13:30 +00:00
Carlos Garnacho
e3ebc8d0c6 keyboard: Remove stale references to global.screen
(Re)introduced by the previous patch.
2018-07-11 18:46:49 +02:00
Carlos Garnacho
fc5ab44704 keyboard: Implement standalone FocusTracker
And stop using FocusCaretTracker for caret position purposes. This
new object uses 1) the text-input protocol in wayland and 2) Info
from IBusPanelService for X11 (which is meant to work for XIM too).

This drops the usage of AtspiEventListener for OSK purposes, which
is best to avoid.
2018-07-11 18:32:32 +02:00
Florian Müllner
d9a1434ae9 workspaceThumbnail: Don't keep stale clones in list
If a clone gets destroyed before the corresponding MetaWindow is
removed from the workspace, we will still find it in the list of
clones and try to destroy it again. Avoid the resulting warnings
by updating the list of clones immediately when a clone is destroyed.

https://bugzilla.gnome.org/show_bug.cgi?id=791233
2018-07-09 13:00:35 +02:00
Florian Müllner
d0bdea3178 workspace: Don't keep stale clones in list
If a clone gets destroyed before the corresponding MetaWindow is
removed from the workspace, we will still find it in the list of
clones and try to destroy it again. Avoid the resulting warnings
by updating the list of clones immediately when a clone is destroyed.

https://bugzilla.gnome.org/show_bug.cgi?id=791233
2018-07-09 13:00:17 +02:00
Marco Trevisan (Treviño)
ccadf6aca1 workspaceThumbnail: remove unused private win reference 2018-07-09 13:00:15 +02:00
Marco Trevisan (Treviño)
266b0e9dd0 keyboard: remove global.screen
This is disabled code for now, but let's have it fixed once we'll use it
2018-07-08 17:43:15 +02:00
Marco Trevisan (Treviño)
f7355f593d closeDialog: use {disable,enable}_unredirect_for_display
Remove leftover global.screen presency
2018-07-08 17:43:15 +02:00
Jonas Ådahl
47ea10b7c9 Remove usage of MetaScreen
Remove any usage of MetaScreen, as it has been removed from libmutter
in the API version 3. The corresponding functionality has been moved
into three different places: MetaDisplay, MetaX11Display (for X11
specific functionality) and MetaWorkspaceManager.

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:56:19 +02:00
Jonas Ådahl
2c0376c150 workspaceThumbnail: Initialize signal handler ids to 0
They are used in conditions, so initialize them first.
2018-07-06 19:55:07 +02:00
Marco Trevisan (Treviño)
996dd74157 layoutManager: Return null monitor if focusIndex is invalid
https://bugzilla.gnome.org/show_bug.cgi?id=788882
2018-06-28 17:05:30 +02:00
Marco Trevisan (Treviño)
878946962d windowManager: Don't animate unmanaged windows on (un)minimization 2018-06-28 17:05:30 +02:00
Marco Trevisan (Treviño)
84d2d3feb3 keyboard: Check monitor validity before deferencing it
Monitor could be invalid in headless mode.

https://bugzilla.gnome.org/show_bug.cgi?id=788882
2018-06-28 17:05:30 +02:00
Sam Spilsbury
19e864ed3b 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
2018-06-28 17:05:29 +02:00
Sam Spilsbury
c9bf72c5c4 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
2018-06-28 16:29:07 +02:00
Florian Müllner
5fe349d5ba thunderbolt: Do not auto start boltd
The service is expected to be activated by systemd when a thunderbolt
device is plugged in, so no need to have it auto-started with the
session.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/54
2018-06-25 14:17:07 +00:00
Joe Rabinoff
8237a1f6e0 Change "const" to "var"
These variables are in fact used from other modules, so gjs complains about them
being const.
2018-06-18 11:19:13 -04:00
Xavier Johnson
a21a22fdb5 appDisplay: Make middle-click like Ctrl+click
When middle-clicking an app icon on the Dash, it will always try to open
a new window of that app, even if the app doesn't support multiple
windows. Meanwhile, Ctrl+click on an app will only open a new window if
the app allows it.

This change prevents middle-clicks on app icons from opening new windows
for apps without multi-window support.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/316
2018-06-07 17:49:36 +00:00
Florian Müllner
b1dd746443 network: Keep key focus in dialog when removing networks
When the actor that has the key focus is destroyed, Clutter moves
the focus to the stage. In case the destroyed actor was inside a
ModalDialog, this breaks any keyboard interaction: keynav is broken
because the stage isn't in any focus chain, and access keys like
Escape because they are handled on the dialog's parent.

The only dialog that may destroy a child without recreating the dialog
buttons (and thus moving the key focus there) is the WirelessDialog,
fix it by keeping the key focus within the dialog when removing networks
from the list.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/76
2018-05-31 11:42:14 +00:00
Florian Müllner
c15e163eb1 network: Handle networks with no access points
This avoids a couple of warnings when encountering such a network.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/76
2018-05-31 11:42:14 +00:00
Florian Müllner
6eed4e31d7 workspace: Fall back to app name in window caption
Just like we did for the window list in app icons' context menu,
provide a fallback for window captions in the window picker rather
than showing blank items to the user.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/26
2018-05-31 11:27:44 +00:00
Florian Müllner
f0557ea05c appDisplay: Fall back to app name in icon menu
The app icon's context menu contains a list of open windows,
identified by their title. As we currently don't handle the
case where the app didn't set a title, we end up with empty
menu items which looks clearly broken. Fall back to the app's
name in that case.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/26
2018-05-31 11:27:43 +00:00
Florian Müllner
b03bcc85aa closeDialog: Periodically check for window to become responsive again
The close dialog for non-responding windows is closed automatically
when we detect that the window is responding again. However as we
currently only ping the window in response to certain user actions
(like focusing the window or opening the window menu), this can
easily go undetected.

Address this by periodically pinging the window while the close
dialog is shown.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/298
2018-05-25 18:23:55 +02:00
Florian Müllner
70057c6a55 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
2018-05-25 14:05:29 +00:00
Ole Jørgen Brønner
fdaddbd1e0 Improve notification documentation
Ref: https://gitlab.gnome.org/GNOME/gnome-shell/issues/294
2018-05-22 18:39:19 +02:00
Daniel van Vugt
94101e8bb8 magnifier.js: Fix zoom juddering
Make Zoom respond to the mouse silky-smoothly.

It was previously hard-coded to: 1000/50 = 20 FPS.

https://bugzilla.gnome.org/show_bug.cgi?id=682013
https://launchpad.net/bugs/1691675
2018-05-17 11:42:20 +08:00
Mario Sanchez Prada
d8b9e23502 network: Update the icon in the panel whenever NM's state changes
Similar to what it's done when the main connection changes, we need
to make sure that the icon in the panel gets updated before calling
_syncConnectivity(), so that the icon gets always updated if needed,
regardless of whether there's an active connection or not.

This is needed because there's at least one case when an icon should
be shown when the computer is not connected to any network: when a
hotspot has been enabled, which can be useful even if there's not
an internet connection to share (e.g. to easily allow connecting
other devices to the computer.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/214
2018-05-15 09:15:43 +01:00
Florian Müllner
c0a453f64f networkAgent: Fix fallout from libnm port
While the libnm-glib version of the function returns a GByteArray*
that gjs can directly cast to the required gutf8*, the libnm function
returns GBytes* from which we need to explicitly fetch the data.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/136
2018-05-09 16:19:58 +02:00
Silvère Latchurié
5336175736 osdWindow: Fix blurriness at certain resolutions
The y position wasn't rounded, leading to some blurriness at vertical
resolutions that aren't a multiple of 4 (e.g. 1050).

https://bugzilla.gnome.org/show_bug.cgi?id=782011
2018-05-08 21:04:02 +02:00
Florian Müllner
ffc0eb1de2 remoteSearch: Actually return icons
Since commit 3b1330880f, a remote search result's createIcon() method
no longer returns the created icon, whoops ...

https://gitlab.gnome.org/GNOME/gnome-shell/issues/249
2018-05-03 08:22:58 +00:00
Xiaoguang Wang
594cc7cbef workspaceThumbnails: Avoid access to undefined variables
If thumbnails haven't been created, they don't need to be destroyed.

https://bugzilla.gnome.org/show_bug.cgi?id=787871
2018-05-02 20:04:42 +02:00
Yussuf Khalil
581b38ecf4 scripting: Fix argument list of createTestWindow()
Commit f285f2c6 changed Scripting.createTestWindow() to accept a parameter
object instead of a parameter list but forgot to remove the width and height
arguments. This breaks the "core" test as all windows are created with default
settings.
2018-04-25 23:47:06 +02:00
Lubomir Rintel
c82cb918ae network: initialize the agent asynchronously
This also bumps the NM requirement. We actually already use API from
1.0, but regularly hit various NetworkManager bugs with versions prior
to 1.10.2. 1.10.4 fixes the asynchronous agent initialization.

https://bugzilla.gnome.org/show_bug.cgi?id=789811
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/63
2018-04-23 10:45:20 +02:00
Florian Müllner
0327069e83 polkitAgent: Guard against repeated close() calls
We use the close() method to disconnect signal handlers set up in
init(), however the handler ID is only valid in the first call in
case the method is called more than once.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/221
2018-04-21 18:42:15 +02:00
Christian Kellner
fb509dfc25 thunderbolt: sync D-Bus API with bolt changes
bolt 0.3 deprecated all AUTHORIZED_XXX status flags, but added
a CONNECTING one. Also AuthFlags got renamed to AuthCtrl.
2018-04-20 11:36:37 +02:00
Christian Kellner
874a91968f thunderbolt: remove gdbus error prefix, if present
If we get an error during device enrollment, the message might be
prefixed to indicate that the error came from the remote peer. We
are presenting that message to the user so strip that prefix away
if it was there.
2018-04-20 11:36:37 +02:00
Christian Kellner
0963ccddba thunderbolt: fix enroll-failed signal args order
The devices emitted (device, error) while the connected handler
was expecting (error, device). The former is more consistent
with the rest of the code (so change it to device, error).
2018-04-20 11:27:11 +02:00
Takao Fujiwara
35fced27df ibusCandidatePopup: Fix candidate-clicked signal 2018-04-18 13:37:53 +09:00
Didier Roche
d6d09fd3c8 ui: Theme lookup should respect XDG_DATA_DIRS
Modes, extensions and other GNOME Shell assets are searched in appropriate
subdirectories of each directory in XDG_DATA_DIRS, falling back
to global.datadir.
However, this isn't the case for themes, which are currently always expected
in global.datadir, even when referenced by a mode in a different XDG_DATA_DIR.

The fix is to have the theme finding pattern follow the same logic as other
elements.
Fixes #167.
2018-04-16 19:09:14 +02:00
Mario Sanchez Prada
cdbc99e992 popupMenu: Fix wrong call to clutter_actor_add_child()
Specify the horizontal alignment via the x_align property when creating
the StIcon, since this function expects one argument, not two.
2018-04-16 11:40:04 +00:00
Florian Müllner
69afe7785d remoteMenu: Support icons in app-menu
The HIG discourages the use of icons in menus except for "noun" items
(files, bookmarks, ...). While those should be rarely used in the
application menu, it still makes sense to support them in the few
cases where they are used.

https://bugzilla.gnome.org/show_bug.cgi?id=760985
2018-04-14 09:02:20 +00:00
Marco Trevisan (Treviño)
b99e304f1e workspaceThumbnail: initialize porthole based on workArea
https://bugzilla.gnome.org/show_bug.cgi?id=792687
2018-04-13 16:59:51 -05:00
Marco Trevisan (Treviño)
c29bd46e7a workspaceThumbnail: rebuild thumbnails if workareas size changed
https://bugzilla.gnome.org/show_bug.cgi?id=792687
2018-04-13 16:58:28 -05:00
Marco Trevisan (Treviño)
5fcf40b973 workspaceThumbnail: only update _porthole if the overview is visible
Otherwise it happens that porthole is computed again after that the
overlay is hidden (triggered by a layout reallocation) and thus not
regenerated again afterwards.

https://bugzilla.gnome.org/show_bug.cgi?id=792687
2018-04-13 16:53:18 -05:00
Piotr Drąg
a198dfe3d8 thunderbolt: capitalize Thunderbolt in a translatable string 2018-04-13 21:52:32 +02:00
Florian Müllner
cb4252e888 polkitAgent: Hide authentication dialogs while locked
Since commit 78a92fb6be we no longer pop up authentication dialogs
on the lock screen, however any dialog that is already open at that
time remains open. This is unexpected, so hide the dialog until
the screen is unlocked again.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/166
2018-04-13 19:35:31 +02:00
Florian Müllner
09d3cdb023 workspace: Don't move focus unconditionally
Since commit 1939e22c22, we move the keyboard focus with the hover
highlight. However while this makes sense when interacting with
the window picker, it interferes with keyboard navigation of other
components like dash or top bar. Address this by only moving the
focus when the previous focus was already inside the window picker
or unset.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/50
2018-04-13 14:13:35 +00:00
Florian Müllner
71515a8a11 networkAgent: Use libnm for plugin loading
After the networking code has been ported to libnm, we can use its
API for loading VPN plugins instead of rolling our own ...

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/39
2018-04-13 14:04:55 +00:00
Florian Müllner
11ca8dd54f worldClock: Handle named timezones
The original UTC support in GWeather piggy-backed on the existing API, but
as "country" or "city" don't make sense in the context of UTC or AoE, the
concept of "named timezones" was introduced. Handle those explicitly to get
back labels for those locations.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/150
2018-04-13 09:15:48 +00:00
Florian Müllner
e00f22ebe6 overview: Use monotonic time to check for consecutive activations
We don't toggle the overview if the request happens too close to the
last activation, to filter out double-clicks or activation by both
the hot corner and a click. However as the check is based on the
real time, the check breaks if the system clock moves backwards and
the last activations appears to be in the future. Fix this by using
monotonic time which is guaranteed to only move forward.

https://bugzilla.gnome.org/show_bug.cgi?id=763886
2018-04-13 09:13:45 +00:00
Bastien Nocera
9f7b101437 appFavorites: Add evolution to rename list
Evolution 3.28 changed the desktop filename. Without this patch,
evolution will disappear from the dock.
2018-04-10 14:38:26 +00:00
Florian Müllner
78a92fb6be polkitAgent: Queue authentication requests while locked
While polkit requests *should* be the result of a user action, that's
not always the case in practice and authentication dialogs can pop up
out of nowhere at any time. That's always annoying, but particularly
bad on the lock screen. If we disabled the polkit component altogether,
the fallback GTK-based agent would kick in, so instead handle the case
explicitly and postpone showing the dialog until the session is unlocked.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/179
2018-04-06 20:08:29 +02:00
Jeremy Bicha
01509cf1a5 appFavorites: Rename gnome-tweaks.desktop 2018-04-05 22:06:15 -04:00
Florian Müllner
526834e39b modalDialog: Remove some unused code
No need to figure out an x_alignment variable that hasn't been used
since commit 0722c06275 ...
2018-03-21 16:48:56 +00:00
Carlos Garnacho
bfdbee8115 shellEntry: Use correct enum for input purpose hints
This was mistakenly left using the GTK+ counterparts. Luckily the enums
are binary compatible, but oops.
2018-03-14 13:30:47 +00:00
Christian Kellner
190a31dd5f thunderbolt: honor boltd's AuthMode property
boltd 0.2 gained a property that indicates if it is authorizing
devices or not. If it indeed is not authorizing then we wont
try to enroll new devices because that would otherwise lead to
and error.
2018-03-05 22:03:28 +01:00
Christian Kellner
cccfc7faca thunderbolt: adapt to bolt 0.2 interface changes
All enums are now strings on the bus. Also the Device.Security
property is gnome. Some new properties got added instead.
2018-03-05 22:03:11 +01:00
Florian Müllner
5e9e4f8c73 viewSelector: Don't mark synth event as in capture phase
When we move keyboard focus to the search entry, we replay the key press
that triggered the move to the entry using ClutterActor's event() method.
Since commit 3b293e91e we specify that the event is in the capture phase
to make it work with StIMText, but now that commit 83accce24 removed it,
we have to return to the expected non-capture flag that matches the orig-
inal event to unbreak find-as-you-type functionality.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/72
2018-03-05 19:12:59 +00:00
Florian Müllner
b28e48094b viewSelector: Don't duplicate find-as-you-type in captured-event
Find-as-you type was never automatically handled by StIMText, but
by the existing stage key-press handler. The functionality broke
for a different reason, we will fix it after reverting the recent
captured-event changes.

This reverts commits bc4462cd0c and e4ee944d8d.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/72
2018-03-05 19:12:58 +00:00
Florian Müllner
81dfcb85ca messageList: Fix invisible close buttons still working
Since commit c4f2bb5f, close buttons are hidden by making them fully
transparent rather than setting their visibility to false to keep
the overall message layout stable. As a result, the buttons now work
even when invisible, which is clearly unexpected - fix this by updating
the reactive property appropriately.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/66
2018-03-02 19:59:48 +00:00
Florian Müllner
3b1330880f cleanup: Use Function.prototype.bind()
When not using arrow notation with anonymous functions, we use Lang.bind()
to bind `this` to named callbacks. However since ES5, this functionality
is already provided by Function.prototype.bind() - in fact, Lang.bind()
itself uses it when no extra arguments are specified. Just use the built-in
function directly where possible, and use arrow notation in the few places
where we pass additional arguments.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/23
2018-02-21 13:55:02 +00:00
Florian Müllner
213e38c2ef cleanup: Use arrow notation for anonymous functions
Arrow notation is great, use it consistently through-out the code base
to bind `this` to anonymous functions, replacing the more overbose
Lang.bind(this, function() {}).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/23
2018-02-21 13:55:00 +00:00
Florian Müllner
76f09b1e49 cleanup: Use method syntax
Modern javascript has a short-hand for function properties, embrace
it for better readability and to prepare for an eventual port to
ES6 classes.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/23
2018-02-21 13:54:58 +00:00
Florian Müllner
2bce1f1510 keyboard: Fix a warning
imports.misc.ibusManager.IBus is declared as const, so referencing it
from another module triggers a warning with recent mozjs. As of commit
083d11a032 IBus is mandatory, so just make it a regular import to avoid
the warning.
2018-02-21 13:19:15 +01:00
Carlos Garnacho
630c70f13c keyboard: Set 'latched' pseudo-class on latched shift key
This is pseudo-class is added on .shift-key-uppercase whenever the shift
state is latched, a matching selector would be:
.keyboard-key.shift-key-uppercase:latched {}

https://gitlab.gnome.org/GNOME/gnome-shell/issues/46
2018-02-15 19:36:48 +01:00
Carlos Garnacho
ebb39bcbe2 keyboard: Delegate enter/shift/layout/hide buttons style to theming
Drop the UTF8 glyphs from those, and add style classes so those can be
specifically themed and given a background image. The style classes are:
.keyboard-key.enter-key{}
.keyboard-key.shift-key-lowercase{} /* applies while lowercase */
.keyboard-key.shift-key-uppercase{} /* applies while uppercase */
.keyboard-key.layout-key{}
.keyboard-key.hide-key{}

https://gitlab.gnome.org/GNOME/gnome-shell/issues/46
2018-02-15 19:36:45 +01:00
Carlos Garnacho
9cf2ec8bd2 keyboard: Avoid using key.label for anything else than presentation
Do the finicky checks to adjust key widths and whatnot based on other
values than the label. This makes the label exclusively used for
presentation (i.e. setting up a St.Label).

https://gitlab.gnome.org/GNOME/gnome-shell/issues/46
2018-02-15 19:36:41 +01:00
Carlos Garnacho
5f6745cad0 keyboard: Shift key shouldn't latch the state unless long pressed
Instead of latching all states, make shift unlatched by default, and only
latched when making a long press on the key. When not latched, the keyboard
will switch to the first level (alphabetic lowercase) after the first key
press.

Also, move the actual level switch to Key::pressed, so it feels more
reactive on long press.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/46
2018-02-15 19:36:36 +01:00
Carlos Garnacho
d8fd7b5a44 keyboard: Implement Key object 'long-press' signal
This signal may be emitted on any key, regardless of extended keys, so
make the timeout useful for both situations.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/46
2018-02-15 19:36:32 +01:00
Carlos Garnacho
f8abe073eb keyboard: Remove needless function
It boils down to another function call, and has a single caller. Just let
the caller make _setActiveLayer() directly.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/46
2018-02-15 19:36:29 +01:00
Carlos Garnacho
0608413b96 keyboard: Do key presses on actual key press
It was mistakenly connecting twice to the 'released' signal. Also, move
level changes to key release, since it will be more convenient to hook
latched states on long press.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/46
2018-02-15 19:36:03 +01:00
Carlos Garnacho
7f8a1ec1fb keyboard: make Key objects' topmost actor to be this.actor
These objects created this.actor being the St.Button, and a surrounding
this.container actor that is the actual actor callers care about. Turn this
around and make this.actor be the parent-less actor, and this.keyButton the
contained internal button. This is more consistent with gnome-shell style.
2018-02-12 17:00:51 +01:00
Carlos Garnacho
e859fc8f16 keyboard: Do not call non-existent function
Commit 8fdf47ea5b removed _addKeys(), but forgot one caller. We just want
to regenerate the keyboard for the current group, so call into the
_onGroupChanged function.
2018-02-12 17:00:51 +01:00
Nikita Churaev
92f1aec3dd appDisplay: Fix small app folder icons when using HIDPI
While the scale factor is taken into account for app icons, we set
an explicit size when combining the into a folder icon - unless we
take the factor into account, the result will be too small on HiDPI
displays.

https://bugzilla.gnome.org/show_bug.cgi?id=792259
2018-02-10 00:40:48 +00:00
Carlos Garnacho
bc4462cd0c viewSelector: Avoid stealing focus from other entries into overview entry
The captured-event handler just redirects focus there on the first keypress,
what it doesn't account for is that other entries may be active while the
Activities overview is opened (eg. alt-f2, or other modal dialogs). Play
along with other entries, and make it only steal focus if no other entry
is selected.

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

Closes: #33
2018-02-10 00:03:11 +00:00
Mario Sanchez Prada
d63c0e277c altTab: Add also a shortcut to close windows from the switcher popups
Similar to what has been done for the apps switcher, this allows closing
windows pressing W or F4 while operating the windows switcher popup or
the apps switcher popup while navigating the list of windows for an app.

https://bugzilla.gnome.org/show_bug.cgi?id=620106
2018-02-09 09:26:50 +00:00
Mario Sanchez Prada
06f790d86c switcherPopup: Handle removal of items from SwitcherPopup
This will be mainly useful for closing apps from the applications
switcher, but can be implemented generically enough to select the
nearest existing item after removal if there's any, or destroying
the popup's actor otherwise.

Specifically for the apps switcher, doing this also removes the need
of having to manually either update the current app in AppSwitcher
and highlight it, if there are still any items after the removal, or
simply destroy the AppSwitcher otherwise. Besides, calling _select()
in the handler for item-removed makes sure that the list of thumbnails
in the switcher is always closed, if open, when quitting the app.

https://bugzilla.gnome.org/show_bug.cgi?id=620106
2018-02-09 09:26:50 +00:00
Florian Müllner
a3918d8c38 altTab: Add shortcut to quit application
Allow to quit the currently selected application by hitting Alt-q,
similar to the OS X switcher.

https://bugzilla.gnome.org/show_bug.cgi?id=620106
2018-02-09 09:26:50 +00:00
Florian Müllner
5122b06839 altTab: Update the switcher when apps and/or windows get stopped/closed
Make sure that the items from the applications switcher and the windows
switcher are removed when the related applications get stopped, or some
of the associated windows closed.

https://bugzilla.gnome.org/show_bug.cgi?id=620106
2018-02-09 09:26:49 +00:00
Rafal Luzynski
a647445b95 calendar Preparing for genitive/nominative months
glibc 2.27 introduced new format specifiers for the month names.
It's obligatory to use them in several languages already and it's
encouraged to use them for all languages because it is not destructive
for any language. As more languages are expected to follow this
standard it's better to use the "%OB" format specifier now so it will
start working correctly automatically.
See also: https://sourceware.org/bugzilla/show_bug.cgi?id=10871

This standard has been also working in BSD and OS X since 1990s,
if anyone tries to use gnome-shell in these systems.

Note: This will not work correctly with glibc < 2.27, there is no
detection whether the system is old or new.

https://bugzilla.gnome.org/show_bug.cgi?id=780957
2018-02-08 12:48:31 +01:00
Rafal Luzynski
9dbe10889b calendar: Make month and month-year formats translatable
Don't try to figure out the month-year order from gtk+.
Provide the format for the translators.  This is easier
and more versatile.

https://bugzilla.gnome.org/show_bug.cgi?id=781329
2018-02-08 12:39:00 +01:00
Florian Müllner
d3a3b7f514 screenShield: Do not save lock state on wayland
We keep track of the lock state and restore it on startup to prevent
a crash from bypassing the screen lock. However on wayland, a crash
doesn't result in gnome-session restarting gnome-shell, but brings
down the entire session - that is, restoring the lock state does not
actually protect the existing session in that case, but forces the
user to authenticate twice in order to start the next session. This
is clearly not helpful, so avoid this by not saving the state when
running as wayland compositor.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/17
2018-02-07 04:35:57 +00:00
Didier Roche
cd0af33947 panel: center date entry with workarea
Align and center the date entry with the workspace's workarea.
This way, maximized applications have their window aligned with the top date
entry.
This doesn't change anything for desktops with no docks or when left/right
workareas are aligned with the monitor.

The offset is leftOffset - rightOffset:
(workArea.x - monitor.x) - (monitor.width - ((workArea.x - monitor.x) +
                                              workArea.width))

https://bugzilla.gnome.org/show_bug.cgi?id=792354
2018-02-06 11:19:58 +01:00
Christian Kellner
194040dcb2 thunderbolt: add policy provider and indicator
We will now basically act as "policy provider" for thunderbolt
peripherals by using org.freedesktop.bolt service: when new
devices are connect and session is a unlocked user session
we will automatically enroll (authorize and store in the database)
them.
If new devices are connected but the session is locked a message
will be shown informing the user that the device needs to be
reconnected to properly work.
The org.freedesktop.bolt service is provided by the "bolt" daemon.
2018-02-05 21:38:49 +01:00
Carlos Garnacho
8fdf47ea5b keyboard: Do not create widgetry for all keyboard groups at once
Instead do this on demand based on the current group. It is less
taxing at the time of initially creating the Keyboard object.
2018-02-05 17:46:57 +01:00
Carlos Garnacho
82cecf2e36 keyboard: Add languages selection popup
Currently the language options displayed pretty much mirror those of the
top bar keyboard layout selection popup. It may make sense in the future
to only list languages, and automatically switch to the enabled IMs that
the OSK can benefit from (eg. by filling in suggestions).
2018-02-05 17:46:57 +01:00
Carlos Garnacho
d7f8a39023 keyboard: slide focused window on OSK visibility
The focused window will move up/down together with the OSK if the focus
area happens to be covered by the area to be covered by the OSK. This
state is reverted whenever the window loses focus, given it wasn't
relayout in between.
2018-02-05 17:46:57 +01:00
Carlos Garnacho
e0852e5991 keyboard: Remove duplicate code
The same calls happen right at the beginning of the function.
2018-02-05 17:46:57 +01:00
Carlos Garnacho
5cec4ae670 keyboard: Move extended keys pop up/down into the Key object
We do not need the parent Keyboard object to handle those specially, the
code can be self-contained enough. The Key object will simply emit
pressed/released events containing the keycode/string, be it from the
parent key or one contained in the BoxPointer.
2018-02-05 17:46:57 +01:00
Carlos Garnacho
e4ee944d8d viewSelector: Send first printable keystroke to the search entry
StIMText used to handle key events for IM consumption in the capture phase,
this made the search box work automagically with nothing explicitly focusing
it. Since it's no longer the case, it has to be done somewhere.
2018-02-05 17:46:57 +01:00
Carlos Garnacho
70bc94946f keyboard: add a special KeyContainer actor to contain keyboard layers
Instead of manually resizing each key everytime the keyboard needs to
relayout, have a special grid container that will preserve aspect when
resized.

This actor works in two stages though, first the keys need to be added
and then layoutButtons() need to be called for the actors to be
reparented to the container with the right attachment options.
2018-02-05 17:46:57 +01:00
Carlos Garnacho
8c3f5b615f shell: Remove gdk_screen property/getter
It's used nowhere.
2018-02-05 17:46:57 +01:00
Carlos Garnacho
a2303c5272 ibusCandidatePopup: Feed OSK suggestions from ibus panel candidates
We don't currently hide the ibus completion panel, and this is done from
within the popup that we are meant to hide itself, so thoroughly sucks.
2018-02-05 17:46:57 +01:00
Carlos Garnacho
e0910c0f7c keyboard: Add visible property
So its visibility can be queried externally.
2018-02-05 17:46:57 +01:00
Carlos Garnacho
5b1e705561 keyboard: Add Suggestions object/actor
This will display completion suggestions, that when clicked will get the
text inserted into the current IM focus.
2018-02-05 17:46:57 +01:00
Carlos Garnacho
d93037c05e keyboard: Lookup minimum number of grid slots for each keymap
Instead of doing max() of all. Results on better used screen space on
every keymap.
2018-02-05 17:46:57 +01:00
Carlos Garnacho
73c7441279 keyboard: Use InputMethod underneath 2018-02-05 17:46:57 +01:00
Carlos Garnacho
5914f225a2 misc: Add InputMethod class
This is a ClutterInputMethod implementation using IBus underneath. The
input method will interact with the currently focused ClutterInputFocus,
be it shell chrome or wayland clients through the text_input protocol.
2018-02-05 17:46:57 +01:00
Carlos Garnacho
774930f1a1 keyboard: Ensure to resize keys after layer change
The keys possibly need resizing after a (new) layer has been set, there's
however calling places that don't. Instead, fold this._redraw() into
setActiveLayer().
2018-02-05 17:46:57 +01:00
Carlos Garnacho
7fd8fa3478 keyboard: Rework OSK
Caribou is no longer used to load keyboard layouts,
gnome-shell uses the JSON files extracted from Unicode
CLDR instead.
2018-02-05 17:46:57 +01:00
Carlos Garnacho
33c3ed68fd keyboard: Drop message tray source, and tray focus handling
These are long unused.
2018-02-05 17:46:57 +01:00
Carlos Garnacho
a1ce0da9e7 main: Load OSK layouts resource 2018-02-05 17:46:57 +01:00
Carlos Garnacho
7544bba0c1 keyboard: Restore intended OSK visibility behavior
Getting the necessary "setting enabled, or input from touchscreen"
conditions to have the OSK shown are not enough on the lack of a
current focus. As we are setting up the caret tracker here, wait for
the focus in event before showing the keyboard.

This fixes 2 issues, with the setting disabled it became really hard
to get the OSK hidden on eg. touchscreen->pointer device switches,
as visibility only depended on the a11y setting here. And secondly,
enabling the setting would always end up with the OSK being shown
regardless of focus, while it should stay hidden if there's no text
edition.

https://bugzilla.gnome.org/show_bug.cgi?id=788188
2018-02-05 17:46:57 +01:00
Carlos Garnacho
e09f8c87e8 padOsd: Fixup to the previous commit
Forgot to squash this change before pushing, I will leave something in the
money jar as I close the door.
2018-01-30 16:41:25 +01:00
Carlos Garnacho
9ad7f59cdb padOsd: Ensure to pick pad devices only
If the underlying X11 input driver creates multiple devices from a single
device node, we may end up picking up the wrong device. So, instead of
picking the first device based on node and bailing out if it's not a pad,
pick the first pad that has that device node, and bail out if there is
none.

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

Closes: #10
2018-01-30 16:19:42 +01:00
Florian Müllner
1d3154a89e networkAgent: Pick up VPN service dir from pkg-config
It turns out that NetworkManager does export the directory as pkg-config
variable after all, so use that instead of building the path ourselves
from the prefix.

https://bugzilla.gnome.org/show_bug.cgi?id=789811
2018-01-22 08:44:19 +01:00
Marco Trevisan (Treviño)
69da686fa9 dnd: Declare restore location variables
https://bugzilla.gnome.org/show_bug.cgi?id=791233
2018-01-17 13:04:41 -05:00
Marco Trevisan (Treviño)
35eac697c1 appDisplay: don't try to close the popup menu that is already destroyed
This would lead to a JS error otherwise, as we might end up
in deleting actors that have been already destructed.

https://bugzilla.gnome.org/show_bug.cgi?id=791233
2018-01-17 13:04:41 -05:00
Florian Müllner
705915cd31 keyboard: Don't pop up on touch events
We want touch events to enable the keyboard and focus tracking, but
not to actually show it right away. Implement that behavior by only
changing the visibility of the keyboard when triggered by a GSettings
change.

https://bugzilla.gnome.org/show_bug.cgi?id=788188
2018-01-16 17:41:46 +01:00
Florian Müllner
cf23490c37 keyboard: Split enabled setting from enabled state
We enable the keyboard when it is either enabled explicitly via
a11y settings or when using a touch device. We'll soon want to
special-case changes to the GSettings, so track its value in a
dedicated property.

https://bugzilla.gnome.org/show_bug.cgi?id=788188
2018-01-16 17:41:46 +01:00
Florian Müllner
d5f081a108 keyboard: Minor cleanup
_syncEnabled() will call _setupKeyboard() if necessary, so no need
to call it explicitly before.

https://bugzilla.gnome.org/show_bug.cgi?id=788188
2018-01-16 17:41:46 +01:00
Lubomir Rintel
16a1c35e28 network: unregister the agent when it's disabled
When the agent doesn't work (e.g. when the screen is locked), it shouldn't be
registered with NM. Otherwise it will keep cancelling the requests that
could happily be serviced with system secrets.

https://bugzilla.gnome.org/show_bug.cgi?id=789811
2018-01-12 11:50:49 +01:00
Lubomir Rintel
baacd216dd network: remove the vpn request when it's serviced
The native agent already forgets about the request at the point it's
serviced and the further attempt to use it (e.g. cancel it when the screen
is locked) will trigger an assertion failure:

  ** (gnome-shell:30862): CRITICAL **: shell_network_agent_respond: assertion 'request != NULL' failed

https://bugzilla.gnome.org/show_bug.cgi?id=789811
2018-01-12 11:48:52 +01:00
Lubomir Rintel
d71af5e579 network: port to libnm
The libnm-glib is depreacted for a long time already.

https://bugzilla.gnome.org/show_bug.cgi?id=789811
2018-01-12 11:48:49 +01:00
Olivier Fourdan
bc5be10d78 ui: Add keyboard accessibility dialog
Show a dialog informing the user each time the keyboard accessibility
flags are changed by one of the clutter backends (either from toggle
keys or two-keys-off modifiers).

https://bugzilla.gnome.org/show_bug.cgi?id=788564
2018-01-10 19:10:18 +01:00
Florian Müllner
f91fbd7728 network: Fix visibility of VPN section
Commit f2a9467f91 was too eager to simplify the code, and removed
the bits that hid the section in case no VPNs are set up - add them
back to fix the visibility.

https://bugzilla.gnome.org/show_bug.cgi?id=787845
2018-01-10 10:11:25 +01:00
Florian Müllner
723c49a8b7 location: Use translated reason string
Gio now has API to look up localized strings from desktop files,
so we can display a correctly translated reason where available.

https://bugzilla.gnome.org/show_bug.cgi?id=779413
2018-01-09 00:25:46 +01:00
Florian Müllner
3f3e514ff2 networkAgent: Update VPN config path
The location moved a while ago, so update the path to point to
the non-deprecated location.

https://bugzilla.gnome.org/show_bug.cgi?id=791487
2018-01-09 00:25:46 +01:00
Ray Strode
94b96f8d97 background: don't leak wall clock when background changes
The background code allocates a GnomeWallClock when its first created,
but neglects to drop a reference to that clock at destroy time.
The undestroyed clocks lead to a timerfd leak that eventually prevents
the shell from functioning.

https://bugzilla.gnome.org/show_bug.cgi?id=791655
2017-12-15 10:57:14 -05:00
Bastien Nocera
29987ae033 dateMenu: Fix possible crash with unknown locations
If there are locations unknown to the libgweather version gnome-shell is
using, don't crash.

JS ERROR: TypeError: b.location is null
WorldClocksSection<._clocksChanged/<@resource:///org/gnome/shell/ui/dateMenu.js:141:1
WorldClocksSection<._clocksChanged@resource:///org/gnome/shell/ui/dateMenu.js:139:9

https://bugzilla.gnome.org/show_bug.cgi?id=791148
2017-12-06 02:02:48 +01:00
Bastien Nocera
a29ceb31dd dateMenu: Ignore malformed world-clocks settings
Guard against a malformed setting that doesn't contain a
'location' key.

https://bugzilla.gnome.org/show_bug.cgi?id=791148
2017-12-06 02:02:48 +01:00
Marco Trevisan (Treviño)
74683b7ef7 dash: Do not shadow ClutterActor's destroy()
Since commit ef1e27966d turned DashItemContainer into an StWidget,
the destroy() method overrides the ClutterActor method, which is at
the very least bad style. Instead, follow the usual pattern of using
a ::destroy handler.

https://bugzilla.gnome.org/show_bug.cgi?id=791233
2017-12-05 18:07:00 -05:00
Marco Trevisan (Treviño)
6c655a6c71 dash: Make sure item labels are only destroyed once
Labels are currently destroyed from both animateOutAndDestroy()
and destroy(), which now (rightfully) triggers a gjs warning. As
the label is created unconditionally since commit 36e5ae4a25,
mirror that and always release it in destroy() and hide it
elsewhere.

https://bugzilla.gnome.org/show_bug.cgi?id=791233
2017-12-05 18:06:58 -05:00
Gautier Pelloux-Prayer
35a9c3ec86 extension: log message if extension could not be installed
https://bugzilla.gnome.org/show_bug.cgi?id=776940
2017-11-21 13:15:05 -05:00
Marco Trevisan (Treviño)
a46af9edf0 status/keyboard: Reset menuItems and Label objects on change
In the current code it could happen that we've menuItems and indicatorLabels
for sources that aren't anymore around, because in case a source is removed
we don't cleanup the their container objects.
Also, we should nullify InputManager's _currentSource when sources change
or it might point to some invalid data again.

So it could happen that we try to access an invalid menuitem or label
if a source change happens mentioning a source that has been deleted.

https://bugzilla.gnome.org/show_bug.cgi?id=788931
2017-11-21 02:16:38 -05:00
Carlos Garnacho
cdc212ff6e overview: Protect ::drag-end handlers
These end up emitting item-drag-end/window-drag-end pretty much
without checks. Given the MetaDnd object may end up emitting
::drag-leave as a result of the plugin ending its grab, this
would result on spurious emission of those events and subsequent
warnings.

For extra paranoia, the _inDrag variable has been split into
_inItemDrag/_inWindowDrag so we can't cross the streams.

https://bugzilla.gnome.org/show_bug.cgi?id=784545
2017-11-17 14:34:40 +01:00
Stefano Facchini
feed029ae4 panel: focus windows on Escape key press
https://bugzilla.gnome.org/show_bug.cgi?id=671121
2017-11-01 20:52:58 +01:00
Florian Müllner
e765e684c3 windowAttentionHandler: Fix typo
Gah, thanks Alessandro Bono for the quick catch ...
2017-10-26 19:54:50 +02:00
Florian Müllner
eecbd4dd42 windowAttentionHandler: Follow app policy for attention notifications
While window attention notifications are created by the shell itself
rather than applications (most likely as a result of focus stealing
prevention), users still commonly link them to the application for
which they are shown. It makes therefore sense to follow the appropriate
policy set by the user rather than showing them unconditionally.

https://bugzilla.gnome.org/show_bug.cgi?id=779974
2017-10-26 19:39:04 +02:00
Florian Müllner
100d6a7fa7 dialog: Reset initial focus on destroy
Since 0b02f757f8 we track the button that should have key focus
when the dialog is opened. However when the dialog is reused, the
button may get destroyed - clear the initial focus in that case to
allow setButton() to set a new one.

https://bugzilla.gnome.org/show_bug.cgi?id=788542
2017-10-26 18:14:52 +02:00
Florian Müllner
aa0858529e network: Spawn wifi panel for further WPA enterprise configuration
Settings recently split Wi-Fi configuration from the Network panel,
so launch that instead.

https://bugzilla.gnome.org/show_bug.cgi?id=789231
2017-10-20 18:03:33 +02:00
Mario Sanchez Prada
fb3070981c bluetooth: Add missing 'BluetoothHardwareAirplaneMode' to D-Bus interface
This D-Bus property was never been added here, which caused inconsistencies
under some scenarios (e.g. coming back from suspend) if some devices were
previously paired, since _sync() would then make the bluetooth menu visible
unconditially, because of the proxied property evaluating to 'false'.

Adding this to the D-Bus interface makes sure that it's no longer undefined
and returns the right value, fixing the bug.

https://bugzilla.gnome.org/show_bug.cgi?id=789110
2017-10-17 20:16:38 +01:00
Florian Müllner
c12da66da8 popupMenu: Fix setting ImageMenuItem's icons via strings
Commit 28ca96064b added support for setting PopupImageMenuItem's icons
via GIcons as well as via strings. However as the check whether an object
implements the GIcon interface only works on GObjects, specifying an icon
name was broken. Fix that to actually allow both strings and GIcons.

https://bugzilla.gnome.org/show_bug.cgi?id=789018
2017-10-16 20:47:05 +02:00
Florian Müllner
01d8811913 gdm: Remove separate greeter universal access icon
The idea behind always showing the icon on the login screen is that
the users' needs aren't known at that point. However we can achieve
the same behavior by including the 'always-show-universal-access-status'
key in GDM's presets, so drop the special-case.

https://bugzilla.gnome.org/show_bug.cgi?id=788943
2017-10-13 16:53:54 +02:00
Jonas Ådahl
db43c45b12 layout: Unset primary and bottom monitor when headless
We were handling being initially headless by only setting the primary
and bottom monitor if there was any primary monitor, then checking the
primary monitor reference before making calls assuming there was any
monitors.

What we didn't do was unset the primary and bottom monitor when going
headless, meaning that temporarly disconnecting a monitor while having
windows open caused an assert to be triggered due to various code paths
taking the path assuming there are valid monitors.

Unsetting both the primary and bottom monitor when going headless avoids
the code paths in the same way as they were avoided when starting
headless.

https://bugzilla.gnome.org/show_bug.cgi?id=788607
2017-10-06 20:31:14 -04:00
Florian Müllner
7da5a76aaa popupMenu: Close menus on session mode changes
We are already closing top bar menus on session mode changes, but
as this behavior makes sense for any other menus as well - dash
context menus or the background menu for instance - just generalize
the behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=787676
2017-10-04 18:12:27 +02:00
Florian Müllner
0b02f757f8 dialog: Fix setting buttons as initial key focus
Commit 1c7a3ee61b broke setting the initial key focus for default
buttons added via addButton(). Fix this by allowing the dialog class
to provide a different default widget to ModalDialog than the entire
dialog itself.

https://bugzilla.gnome.org/show_bug.cgi?id=788282
2017-10-04 18:12:27 +02:00