Commit Graph

6071 Commits

Author SHA1 Message Date
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)
cf69fe4b18 gdm, util: Always allow to retry login in unlock mode
When in lockscreen mode there's no point of resetting the auth login as there's
no welcome screen, and that would just cause the UI to freeze, with no reason.
This could have been useful if we were stopping the user to login for a given
time after ALLOWED_FAILURES attempts, but this is not the case yet.
2018-07-25 20:32:42 +00:00
Marco Trevisan (Treviño)
8f848925f6 authPrompt: Do not enable sensitivity if retries are disallowed
Set the sensitivity of the UI according to the canRetry parameter and thus
if no more logins are allowed don't take any input.

Fixes #311
2018-07-25 20:32:42 +00:00
Marco Trevisan (Treviño)
d21657fe61 authPrompt: Unset preemptiveAnswer on reset
When we get a reset signal the preemptiveAnswer should be also unset or it will
be used next time the user authPrompt will be activated, even without any further
user interaction.

Fixes #311
2018-07-25 20:32:41 +00: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
Carlos Garnacho
374caade47 inputMethod: Handle IBusInputContext::forward-key-press
The input method may hint that certain keycodes should be pressed/released
besides the textual information in ::commit. An example is hitting space
in some IMs to commit text, where both ::commit happens, and an space is
visibly inserted. In order to handle this properly, we must honor
::forward-key-press.

In order to cater for the case that a keypress is forwarded while handling
that same keypress in a physical keyboard, check the current event being
handled and just forward it as-is if it matches. This is necessary to
prevent state from being doubly set, and the second event silenced away.

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

Closes: #275
2018-07-17 23:27:24 +00: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