Compare commits

..

6 Commits

Author SHA1 Message Date
Ray Strode
0507fef4cd st-texture-cache: purge on resume
With the proprietary nvidia driver, textures get garbled on suspend,
so the texture cache needs to evict all textures in that situation.
2019-01-15 12:54:32 -05:00
Ray Strode
68c631223c background: rebuild background, not just animation on resume
Previously, we would only refresh the animation on resume
(to handle clock skew).

But we actually need to rebuild the background, too, on nvidia,
so we should just do a full background change.
2019-01-15 12:52:49 -05:00
Ray Strode
97b38c1950 background: refresh after suspend on wayland
At the moment we only refresh after suspend on Xorg.

We need to do it on wayland, too.
2019-01-15 12:51:16 -05:00
Jonas Ådahl
b098930e6d 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.
2019-01-08 13:00:35 -05:00
Jonas Ådahl
45da60516c 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
2019-01-08 13:00:35 -05:00
Ray Strode
c4b1ba48f2 gnome-shell-favourite-apps-firefox.patch 2019-01-08 13:00:35 -05:00
39 changed files with 109 additions and 1146 deletions

View File

@@ -46,8 +46,7 @@ dbus_interfaces = [
'org.gnome.Shell.Screencast.xml',
'org.gnome.Shell.Screenshot.xml',
'org.gnome.ShellSearchProvider.xml',
'org.gnome.ShellSearchProvider2.xml',
'org.gnome.Shell.Introspect.xml'
'org.gnome.ShellSearchProvider2.xml'
]
install_data(dbus_interfaces, install_dir: ifacedir)

View File

@@ -1,61 +0,0 @@
<!DOCTYPE node PUBLIC
'-//freedesktop//DTD D-BUS Object Introspection 1.0//EN'
'http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd'>
<node>
<!--
org.gnome.Shell.Introspect:
@short_description: Introspection interface
The interface used to introspect the state of Shell, such as running
applications, currently active application, etc.
-->
<interface name="org.gnome.Shell.Introspect">
<!--
RunningApplicationsChanged:
@short_description: Notifies when the running applications changes
-->
<signal name="RunningApplicationsChanged" />
<!--
GetRunningApplications:
@short_description: Retrieves the description of all running applications
Each application is associated by an application ID. The details of
each application consists of a varlist of keys and values. Available
keys are listed below.
'active-on-seats' - (as) list of seats the application is active on
(a seat only has at most one active
application)
-->
<method name="GetRunningApplications">
<arg name="apps" direction="out" type="a{sa{sv}}" />
</method>
<!--
GetWindows:
@short_description: Retrieves the current list of windows and their properties
A window is exposed as:
* t ID: unique ID of the window
* a{sv} properties: high-level properties
Known properties:
- "title" (s): (readonly) title of the window
- "app-id" (s): (readonly) application ID of the window
- "wm-class" (s): (readonly) class of the window
- "client-type" (u): (readonly) 0 for Wayland, 1 for X11
- "is-hidden" (b): (readonly) if the window is currently hidden
- "has-focus" (b): (readonly) if the window currently have
keyboard focus
- "width" (u): (readonly) width of the window
- "height" (u): (readonly) height of the window
-->
<method name="GetWindows">
<arg name="windows" direction="out" type="a{ta{sv}}" />
</method>
</interface>
</node>

View File

@@ -39,7 +39,7 @@
</description>
</key>
<key name="favorite-apps" type="as">
<default>[ 'firefox.desktop', 'evolution.desktop', 'rhythmbox.desktop', 'shotwell.desktop', 'org.gnome.Nautilus.desktop', 'org.gnome.Software.desktop', 'yelp.desktop', 'gnome-terminal.desktop' ]</default>
<default>[ 'firefox.desktop', 'evolution.desktop', 'rhythmbox.desktop', 'shotwell.desktop', 'org.gnome.Nautilus.desktop', 'org.gnome.Software.desktop' ]</default>
<summary>List of desktop file IDs for favorite applications</summary>
<description>
The applications corresponding to these identifiers
@@ -90,14 +90,6 @@
adapter is ever seen not to have devices associated to it.
</description>
</key>
<key name="introspect" type="b">
<default>false</default>
<summary>Enable introspection API</summary>
<description>
Enables a D-Bus API that allows to introspect the application state of
the shell.
</description>
</key>
<child name="keybindings" schema="org.gnome.shell.keybindings"/>
<child name="keyboard" schema="org.gnome.shell.keyboard"/>
</schema>

View File

@@ -776,11 +776,6 @@ StScrollBar {
//dimensions of the icon are hardcoded
}
.panel-logo-icon {
padding-right: .4em;
icon-size: 1em;
}
.system-status-icon,
.app-menu-icon > StIcon,
.popup-menu-arrow {
@@ -1404,14 +1399,6 @@ StScrollBar {
}
.app-well-hover-text {
text-align: center;
color: $osd_fg_color;
background-color: $osd_bg_color;
border-radius: 5px;
padding: 3px;
}
.app-well-app-running-dot { //running apps indicator
width: 10px; height: 3px;
background-color: $selected_bg_color;
@@ -1784,12 +1771,7 @@ StScrollBar {
.login-dialog-banner { color: darken($osd_fg_color,10%); }
.login-dialog-button-box { spacing: 5px; }
.login-dialog-message-warning { color: $warning_color; }
.login-dialog-message-hint, .login-dialog-message {
color: darken($osd_fg_color, 20%);
padding-top: 0;
padding-bottom: 20px;
min-height: 2.75em;
}
.login-dialog-message-hint { padding-top: 0; padding-bottom: 20px; }
.login-dialog-user-selection-box { padding: 100px 0px; }
.login-dialog-not-listed-label {
padding-left: 2px;
@@ -1845,10 +1827,6 @@ StScrollBar {
padding-bottom: 12px;
spacing: 8px;
width: 23em;
.login-dialog-timed-login-indicator {
height: 2px;
background-color: darken($fg_color,40%);
}
}
.login-dialog-prompt-label {

View File

@@ -23,5 +23,3 @@ foreach style: styles
],
depend_files: theme_sources)
endforeach
install_data('process-working.svg', install_dir: themedir)

View File

@@ -1,195 +0,0 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/*
* Copyright 2017 Red Hat, Inc
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
const Clutter = imports.gi.Clutter;
const GObject = imports.gi.GObject;
const Gtk = imports.gi.Gtk;
const Lang = imports.lang;
const Meta = imports.gi.Meta;
const Signals = imports.signals;
const St = imports.gi.St;
const Tweener = imports.ui.tweener;
const _SCROLL_ANIMATION_TIME = 0.5;
const AuthListItem = new Lang.Class({
Name: 'AuthListItem',
_init(key, text) {
this.key = key;
let label = new St.Label({ style_class: 'auth-list-item-label',
y_align: Clutter.ActorAlign.CENTER });
label.text = text;
this.actor = new St.Button({ style_class: 'login-dialog-user-list-item',
button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
can_focus: true,
child: label,
reactive: true,
x_align: St.Align.START,
x_fill: true });
this.actor.connect('key-focus-in', () => {
this._setSelected(true);
});
this.actor.connect('key-focus-out', () => {
this._setSelected(false);
});
this.actor.connect('notify::hover', () => {
this._setSelected(this.actor.hover);
});
this.actor.connect('clicked', this._onClicked.bind(this));
},
_onClicked() {
this.emit('activate');
},
_setSelected(selected) {
if (selected) {
this.actor.add_style_pseudo_class('selected');
this.actor.grab_key_focus();
} else {
this.actor.remove_style_pseudo_class('selected');
}
}
});
Signals.addSignalMethods(AuthListItem.prototype);
const AuthList = new Lang.Class({
Name: 'AuthList',
_init() {
this.actor = new St.BoxLayout({ vertical: true,
style_class: 'login-dialog-auth-list-layout' });
this.label = new St.Label({ style_class: 'prompt-dialog-headline' });
this.actor.add_actor(this.label);
this._scrollView = new St.ScrollView({ style_class: 'login-dialog-user-list-view'});
this._scrollView.set_policy(Gtk.PolicyType.NEVER,
Gtk.PolicyType.AUTOMATIC);
this.actor.add_actor(this._scrollView);
this._box = new St.BoxLayout({ vertical: true,
style_class: 'login-dialog-user-list',
pseudo_class: 'expanded' });
this._scrollView.add_actor(this._box);
this._items = {};
this.actor.connect('key-focus-in', this._moveFocusToItems.bind(this));
},
_moveFocusToItems() {
let hasItems = Object.keys(this._items).length > 0;
if (!hasItems)
return;
if (global.stage.get_key_focus() != this.actor)
return;
let focusSet = this.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
if (!focusSet) {
Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => {
this._moveFocusToItems();
return false;
});
}
},
_onItemActivated(activatedItem) {
this.emit('activate', activatedItem.key);
},
scrollToItem(item) {
let box = item.actor.get_allocation_box();
let adjustment = this._scrollView.get_vscroll_bar().get_adjustment();
let value = (box.y1 + adjustment.step_increment / 2.0) - (adjustment.page_size / 2.0);
Tweener.removeTweens(adjustment);
Tweener.addTween (adjustment,
{ value: value,
time: _SCROLL_ANIMATION_TIME,
transition: 'easeOutQuad' });
},
jumpToItem(item) {
let box = item.actor.get_allocation_box();
let adjustment = this._scrollView.get_vscroll_bar().get_adjustment();
let value = (box.y1 + adjustment.step_increment / 2.0) - (adjustment.page_size / 2.0);
adjustment.set_value(value);
},
getItem(key) {
let item = this._items[key];
if (!item)
return null;
return item;
},
addItem(key, text) {
this.removeItem(key);
let item = new AuthListItem(key, text);
this._box.add(item.actor, { x_fill: true });
this._items[key] = item;
item.connect('activate',
this._onItemActivated.bind(this));
// Try to keep the focused item front-and-center
item.actor.connect('key-focus-in',
() => { this.scrollToItem(item); });
this._moveFocusToItems();
this.emit('item-added', item);
},
removeItem(key) {
let item = this._items[key];
if (!item)
return;
item.actor.destroy();
delete this._items[key];
},
numItems() {
return Object.keys(this._items).length;
},
clear() {
this.label.text = "";
this._box.destroy_all_children();
this._items = {};
}
});
Signals.addSignalMethods(AuthList.prototype);

View File

@@ -2,17 +2,14 @@
const Clutter = imports.gi.Clutter;
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const Lang = imports.lang;
const Pango = imports.gi.Pango;
const Signals = imports.signals;
const St = imports.gi.St;
const Animation = imports.ui.animation;
const AuthList = imports.gdm.authList;
const Batch = imports.gdm.batch;
const GdmUtil = imports.gdm.util;
const Meta = imports.gi.Meta;
const Params = imports.misc.params;
const ShellEntry = imports.ui.shellEntry;
const Tweener = imports.ui.tweener;
@@ -50,8 +47,6 @@ var AuthPrompt = new Lang.Class({
this._gdmClient = gdmClient;
this._mode = mode;
this._idleMonitor = Meta.IdleMonitor.get_core();
let reauthenticationOnly;
if (this._mode == AuthPromptMode.UNLOCK_ONLY)
reauthenticationOnly = true;
@@ -62,7 +57,6 @@ var AuthPrompt = new Lang.Class({
this._userVerifier.connect('ask-question', this._onAskQuestion.bind(this));
this._userVerifier.connect('show-message', this._onShowMessage.bind(this));
this._userVerifier.connect('show-choice-list', this._onShowChoiceList.bind(this));
this._userVerifier.connect('verification-failed', this._onVerificationFailed.bind(this));
this._userVerifier.connect('verification-complete', this._onVerificationComplete.bind(this));
this._userVerifier.connect('reset', this._onReset.bind(this));
@@ -72,16 +66,11 @@ var AuthPrompt = new Lang.Class({
this.connect('next', () => {
this.updateSensitivity(false);
this.startSpinning();
if (this._queryingService) {
this.startSpinning();
this._userVerifier.answerQuery(this._queryingService, this._entry.text);
} else {
this._preemptiveAnswer = this._entry.text;
if (this._preemptiveAnswerWatchId) {
this._idleMonitor.remove_watch(this._preemptiveAnswerWatchId);
this._preemptiveAnswerWatchId = 0;
}
}
});
@@ -120,33 +109,6 @@ var AuthPrompt = new Lang.Class({
this._entry.grab_key_focus();
this._timedLoginIndicator = new St.Bin({ style_class: 'login-dialog-timed-login-indicator',
scale_x: 0 });
this.actor.add(this._timedLoginIndicator);
this._authList = new AuthList.AuthList();
this._authList.connect('activate', (list, key) => {
this._authList.actor.reactive = false;
Tweener.addTween(this._authList.actor,
{ opacity: 0,
time: MESSAGE_FADE_OUT_ANIMATION_TIME,
transition: 'easeOutQuad',
onComplete: () => {
this._authList.clear();
this._authList.actor.hide();
this._userVerifier.selectChoice(this._queryingService, key);
}
});
});
this._authList.actor.hide();
this.actor.add(this._authList.actor,
{ expand: true,
x_fill: true,
y_fill: false,
x_align: St.Align.START });
this._message = new St.Label({ opacity: 0,
styleClass: 'login-dialog-message' });
this._message.clutter_text.line_wrap = true;
@@ -172,46 +134,7 @@ var AuthPrompt = new Lang.Class({
this._defaultButtonWell.add_child(this._spinner.actor);
},
showTimedLoginIndicator(time) {
let hold = new Batch.Hold();
this.hideTimedLoginIndicator();
let startTime = GLib.get_monotonic_time();
this._timedLoginTimeoutId = GLib.timeout_add (GLib.PRIORITY_DEFAULT, 33,
() => {
let currentTime = GLib.get_monotonic_time();
let elapsedTime = (currentTime - startTime) / GLib.USEC_PER_SEC;
this._timedLoginIndicator.scale_x = elapsedTime / time;
if (elapsedTime >= time) {
this._timedLoginTimeoutId = 0;
hold.release();
return GLib.SOURCE_REMOVE;
}
return GLib.SOURCE_CONTINUE;
});
GLib.Source.set_name_by_id(this._timedLoginTimeoutId, '[gnome-shell] this._timedLoginTimeoutId');
return hold;
},
hideTimedLoginIndicator() {
if (this._timedLoginTimeoutId) {
GLib.source_remove(this._timedLoginTimeoutId);
this._timedLoginTimeoutId = 0;
}
this._timedLoginIndicator.scale_x = 0.;
},
_onDestroy() {
if (this._preemptiveAnswerWatchId) {
this._idleMonitor.remove_watch(this._preemptiveAnswerWatchId);
this._preemptiveAnswerWatchId = 0;
}
this._userVerifier.destroy();
this._userVerifier = null;
},
@@ -253,7 +176,7 @@ var AuthPrompt = new Lang.Class({
this._updateNextButtonSensitivity(this._entry.text.length > 0);
this._entry.clutter_text.connect('text-changed', () => {
if (!this._userVerifier.hasPendingMessages && this._queryingService && !this._preemptiveAnswer)
if (!this._userVerifier.hasPendingMessages)
this._fadeOutMessage();
this._updateNextButtonSensitivity(this._entry.text.length > 0 || this.verificationStatus == AuthPromptStatus.VERIFYING);
@@ -290,21 +213,6 @@ var AuthPrompt = new Lang.Class({
this.emit('prompted');
},
_onShowChoiceList(userVerifier, serviceName, promptMessage, choiceList) {
if (this._queryingService)
this.clear();
this._queryingService = serviceName;
if (this._preemptiveAnswer)
this._preemptiveAnswer = null;
this.nextButton.label = _("Next");
this.setChoiceList(promptMessage, choiceList);
this.updateSensitivity(true);
this.emit('prompted');
},
_onOVirtUserAuthenticated() {
if (this.verificationStatus != AuthPromptStatus.VERIFICATION_SUCCEEDED)
this.reset();
@@ -433,8 +341,6 @@ var AuthPrompt = new Lang.Class({
clear() {
this._entry.text = '';
this.stopSpinning();
this._authList.clear();
this._authList.actor.hide();
},
setPasswordChar(passwordChar) {
@@ -443,49 +349,14 @@ var AuthPrompt = new Lang.Class({
},
setQuestion(question) {
if (this._preemptiveAnswerWatchId) {
this._idleMonitor.remove_watch(this._preemptiveAnswerWatchId);
this._preemptiveAnswerWatchId = 0;
}
this._label.set_text(question);
this._authList.actor.hide();
this._label.show();
this._entry.show();
this._entry.grab_key_focus();
},
_fadeInChoiceList() {
this._authList.actor.opacity = 0;
this._authList.actor.show();
this._authList.actor.reactive = false;
Tweener.addTween(this._authList.actor,
{ opacity: 255,
time: MESSAGE_FADE_OUT_ANIMATION_TIME,
transition: 'easeOutQuad',
onComplete: () => {
this._authList.actor.reactive = true;
}
});
},
setChoiceList(promptMessage, choiceList) {
this._authList.clear();
this._authList.label.text = promptMessage;
for (let key in choiceList) {
let text = choiceList[key];
this._authList.addItem(key, text);
}
this._label.hide();
this._entry.hide();
if (this._message.text == "")
this._message.hide();
this._fadeInChoiceList();
},
getAnswer() {
let text;
@@ -521,7 +392,6 @@ var AuthPrompt = new Lang.Class({
else
this._message.remove_style_class_name('login-dialog-message-hint');
this._message.show();
if (message) {
Tweener.removeTweens(this._message);
this._message.text = message;
@@ -537,7 +407,7 @@ var AuthPrompt = new Lang.Class({
},
updateSensitivity(sensitive) {
this._updateNextButtonSensitivity(sensitive && !this._authList.actor.visible && (this._entry.text.length > 0 || this.verificationStatus == AuthPromptStatus.VERIFYING));
this._updateNextButtonSensitivity(sensitive && (this._entry.text.length > 0 || this.verificationStatus == AuthPromptStatus.VERIFYING));
this._entry.reactive = sensitive;
this._entry.clutter_text.editable = sensitive;
},
@@ -564,31 +434,12 @@ var AuthPrompt = new Lang.Class({
}
},
_onUserStoppedTypePreemptiveAnswer() {
if (!this._preemptiveAnswerWatchId ||
this._preemptiveAnswer ||
this._queryingService)
return;
this._idleMonitor.remove_watch(this._preemptiveAnswerWatchId);
this._preemptiveAnswerWatchId = 0;
this._entry.text = '';
this.updateSensitivity(false);
},
reset() {
let oldStatus = this.verificationStatus;
this.verificationStatus = AuthPromptStatus.NOT_VERIFYING;
this.cancelButton.reactive = true;
this.nextButton.label = _("Next");
if (this._preemptiveAnswerWatchId) {
this._idleMonitor.remove_watch(this._preemptiveAnswerWatchId);
}
this._preemptiveAnswerWatchId = this._idleMonitor.add_idle_watch (500,
this._onUserStoppedTypePreemptiveAnswer.bind(this));
if (this._userVerifier)
this._userVerifier.cancel();

View File

@@ -418,11 +418,6 @@ var LoginDialog = new Lang.Class({
this._userManager = AccountsService.UserManager.get_default()
this._gdmClient = new Gdm.Client();
try {
this._gdmClient.set_enabled_extensions([Gdm.UserVerifierChoiceList.interface_info().name]);
} catch(e) {
}
this._settings = new Gio.Settings({ schema_id: GdmUtil.LOGIN_SCREEN_SCHEMA });
this._settings.connect('changed::' + GdmUtil.BANNER_MESSAGE_KEY,
@@ -743,9 +738,6 @@ var LoginDialog = new Lang.Class({
if (this._authPrompt.verificationStatus == AuthPrompt.AuthPromptStatus.NOT_VERIFYING)
this._authPrompt.reset();
if (this._disableUserList && this._timedLoginUserListHold)
this._timedLoginUserListHold.release();
}
},
@@ -1027,33 +1019,17 @@ var LoginDialog = new Lang.Class({
},
_startTimedLogin(userName, delay) {
this._timedLoginUserName = userName;
this._timedLoginItem = null;
this._timedLoginDelay = delay;
this._timedLoginAnimationTime = delay;
let tasks = [() => {
if (this._disableUserList)
return;
this._timedLoginUserListHold = this._waitForItemForUser(userName);
return this._timedLoginUserListHold;
},
let tasks = [() => this._waitForItemForUser(userName),
() => {
this._timedLoginUserListHold = null;
if (this._disableUserList)
return;
this._timedLoginItem = this._userList.getItemFromUserName(userName);
},
() => {
if (this._disableUserList)
return;
// If we're just starting out, start on the right
// item.
if (!this._userManager.is_loaded) {
@@ -1064,9 +1040,6 @@ var LoginDialog = new Lang.Class({
this._blockTimedLoginUntilIdle,
() => {
if (this._disableUserList)
return;
this._userList.scrollToItem(this._timedLoginItem);
},
@@ -1091,9 +1064,7 @@ var LoginDialog = new Lang.Class({
if (this._timedLoginItem)
this._timedLoginItem.hideTimedLoginIndicator();
this._authPrompt.hideTimedLoginIndicator();
let userName = this._timedLoginUserName;
let userName = this._timedLoginItem.user.get_user_name();
if (userName)
this._startTimedLogin(userName, this._timedLoginDelay);

View File

@@ -134,6 +134,7 @@ var ShellUserVerifier = new Lang.Class({
this._settings = new Gio.Settings({ schema_id: LOGIN_SCREEN_SCHEMA });
this._settings.connect('changed',
this._updateDefaultService.bind(this));
this._updateDefaultService();
this._fprintManager = Fprint.FprintManager();
this._smartcardManager = SmartcardManager.getSmartcardManager();
@@ -145,8 +146,6 @@ var ShellUserVerifier = new Lang.Class({
this.smartcardDetected = false;
this._checkForSmartcard();
this._updateDefaultService();
this._smartcardInsertedId = this._smartcardManager.connect('smartcard-inserted',
this._checkForSmartcard.bind(this));
this._smartcardRemovedId = this._smartcardManager.connect('smartcard-removed',
@@ -200,10 +199,6 @@ var ShellUserVerifier = new Lang.Class({
if (this._userVerifier) {
this._userVerifier.run_dispose();
this._userVerifier = null;
if (this._userVerifierChoiceList) {
this._userVerifierChoiceList.run_dispose();
this._userVerifierChoiceList = null;
}
}
},
@@ -231,10 +226,6 @@ var ShellUserVerifier = new Lang.Class({
this._oVirtCredentialsManager = null;
},
selectChoice(serviceName, key) {
this._userVerifierChoiceList.call_select_choice(serviceName, key, this._cancellable, null);
},
answerQuery(serviceName, answer) {
if (!this.hasPendingMessages) {
this._userVerifier.call_answer_query(serviceName, answer, this._cancellable, null);
@@ -343,8 +334,6 @@ var ShellUserVerifier = new Lang.Class({
else if (this._preemptingService == SMARTCARD_SERVICE_NAME)
this._preemptingService = null;
this._updateDefaultService();
this.emit('smartcard-status-changed');
}
},
@@ -375,11 +364,6 @@ var ShellUserVerifier = new Lang.Class({
return;
}
if (client.get_user_verifier_choice_list)
this._userVerifierChoiceList = client.get_user_verifier_choice_list();
else
this._userVerifierChoiceList = null;
this.reauthenticating = true;
this._connectSignals();
this._beginVerification();
@@ -397,11 +381,6 @@ var ShellUserVerifier = new Lang.Class({
return;
}
if (client.get_user_verifier_choice_list)
this._userVerifierChoiceList = client.get_user_verifier_choice_list();
else
this._userVerifierChoiceList = null;
this._connectSignals();
this._beginVerification();
this._hold.release();
@@ -415,9 +394,6 @@ var ShellUserVerifier = new Lang.Class({
this._userVerifier.connect('conversation-stopped', this._onConversationStopped.bind(this));
this._userVerifier.connect('reset', this._onReset.bind(this));
this._userVerifier.connect('verification-complete', this._onVerificationComplete.bind(this));
if (this._userVerifierChoiceList)
this._userVerifierChoiceList.connect('choice-query', this._onChoiceListQuery.bind(this));
},
_getForegroundService() {
@@ -436,9 +412,7 @@ var ShellUserVerifier = new Lang.Class({
},
_updateDefaultService() {
if (this._smartcardManager.loggedInWithToken())
this._defaultService = SMARTCARD_SERVICE_NAME;
else if (this._settings.get_boolean(PASSWORD_AUTHENTICATION_KEY))
if (this._settings.get_boolean(PASSWORD_AUTHENTICATION_KEY))
this._defaultService = PASSWORD_SERVICE_NAME;
else if (this._settings.get_boolean(SMARTCARD_AUTHENTICATION_KEY))
this._defaultService = SMARTCARD_SERVICE_NAME;
@@ -494,13 +468,6 @@ var ShellUserVerifier = new Lang.Class({
this._startService(FINGERPRINT_SERVICE_NAME);
},
_onChoiceListQuery(client, serviceName, promptMessage, list) {
if (!this.serviceIsForeground(serviceName))
return;
this.emit('show-choice-list', serviceName, promptMessage, list.deep_unpack());
},
_onInfo(client, serviceName, info) {
if (this.serviceIsForeground(serviceName)) {
this._queueMessage(info, MessageType.INFO);

View File

@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/shell">
<file>gdm/authList.js</file>
<file>gdm/authPrompt.js</file>
<file>gdm/batch.js</file>
<file>gdm/fingerprint.js</file>
@@ -19,7 +18,6 @@
<file>misc/history.js</file>
<file>misc/ibusManager.js</file>
<file>misc/inputMethod.js</file>
<file>misc/introspect.js</file>
<file>misc/jsParse.js</file>
<file>misc/keyboardManager.js</file>
<file>misc/loginManager.js</file>

View File

@@ -13,8 +13,7 @@ const FileUtils = imports.misc.fileUtils;
var ExtensionType = {
SYSTEM: 1,
PER_USER: 2,
SESSION_MODE: 3
PER_USER: 2
};
// Maps uuid -> metadata object

View File

@@ -15,8 +15,6 @@ var InputMethod = new Lang.Class({
this._purpose = 0;
this._enabled = true;
this._currentFocus = null;
this._preeditStr = '';
this._preeditPos = 0;
this._ibus = IBus.Bus.new_async();
this._ibus.connect('connected', this._onConnected.bind(this));
this._ibus.connect('disconnected', this._clear.bind(this));
@@ -66,9 +64,6 @@ var InputMethod = new Lang.Class({
this._context.connect('commit-text', this._onCommitText.bind(this));
this._context.connect('delete-surrounding-text', this._onDeleteSurroundingText.bind(this));
this._context.connect('update-preedit-text', this._onUpdatePreeditText.bind(this));
this._context.connect('show-preedit-text', this._onShowPreeditText.bind(this));
this._context.connect('hide-preedit-text', this._onHidePreeditText.bind(this));
this._context.connect('forward-key-event', this._onForwardKeyEvent.bind(this));
this._updateCapabilities();
},
@@ -78,8 +73,6 @@ var InputMethod = new Lang.Class({
this._hints = 0;
this._purpose = 0;
this._enabled = false;
this._preeditStr = ''
this._preeditPos = 0;
},
_emitRequestSurrounding() {
@@ -96,36 +89,11 @@ var InputMethod = new Lang.Class({
},
_onUpdatePreeditText(context, text, pos, visible) {
if (text == null)
return;
this._preeditStr = text.get_text();
this._preeditPos = pos;
if (visible)
this.set_preedit_text(this._preeditStr, pos);
else
this.set_preedit_text(null, pos);
},
let str = null;
if (visible && text != null)
str = text.get_text();
_onShowPreeditText(context) {
this.set_preedit_text(this._preeditStr, this._preeditPos);
},
_onHidePreeditText(context) {
this.set_preedit_text(null, this._preeditPos);
},
_onForwardKeyEvent(context, keyval, keycode, state) {
let press = (state & IBus.ModifierType.RELEASE_MASK) == 0;
state &= ~(IBus.ModifierType.RELEASE_MASK);
let curEvent = Clutter.get_current_event();
let time;
if (curEvent)
time = curEvent.get_time();
else
time = global.display.get_current_time_roundtrip();
this.forward_key(keyval, keycode + 8, state & Clutter.ModifierType.MODIFIER_MASK, time, press);
this.set_preedit_text(str, pos);
},
vfunc_focus_in(focus) {
@@ -167,11 +135,8 @@ var InputMethod = new Lang.Class({
},
vfunc_set_surrounding(text, cursor, anchor) {
if (!this._context || !text)
return;
let ibusText = IBus.Text.new_from_string(text);
this._context.set_surrounding_text(ibusText, cursor, anchor);
if (this._context)
this._context.set_surrounding_text(text, cursor, anchor);
},
vfunc_update_content_hints(hints) {
@@ -232,7 +197,6 @@ var InputMethod = new Lang.Class({
if (event.type() == Clutter.EventType.KEY_RELEASE)
state |= IBus.ModifierType.RELEASE_MASK;
this._context.process_key_event_async(event.get_key_symbol(),
event.get_key_code() - 8, // Convert XKB keycodes to evcodes
state, -1, null,

View File

@@ -1,174 +0,0 @@
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const Lang = imports.lang;
const Meta = imports.gi.Meta;
const Shell = imports.gi.Shell;
const INTROSPECT_SCHEMA = 'org.gnome.shell';
const INTROSPECT_KEY = 'introspect';
const APP_WHITELIST = ['org.freedesktop.impl.portal.desktop.gtk'];
const IntrospectDBusIface = '<node> \
<interface name="org.gnome.Shell.Introspect"> \
<signal name="RunningApplicationsChanged" /> \
<method name="GetRunningApplications"> \
<arg name="apps" direction="out" type="a{sa{sv}}" /> \
</method> \
<method name="GetWindows"> \
<arg name="windows" direction="out" type="a{ta{sv}}" /> \
</method> \
</interface> \
</node>';
var IntrospectService = new Lang.Class({
Name: 'IntrospectService',
_init() {
this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(IntrospectDBusIface,
this);
this._dbusImpl.export(Gio.DBus.session, '/org/gnome/Shell/Introspect');
Gio.DBus.session.own_name('org.gnome.Shell.Introspect',
Gio.BusNameOwnerFlags.REPLACE,
null, null);
this._runningApplications = {};
this._runningApplicationsDirty = true;
this._activeApplication = null;
this._activeApplicationDirty = true;
this._appSystem = Shell.AppSystem.get_default();
this._appSystem.connect('app-state-changed',
() => {
this._runningApplicationsDirty = true;
this._syncRunningApplications();
});
this._settings = new Gio.Settings({ schema_id: INTROSPECT_SCHEMA });
let tracker = Shell.WindowTracker.get_default();
tracker.connect('notify::focus-app',
() => {
this._activeApplicationDirty = true;
this._syncRunningApplications();
});
this._syncRunningApplications();
},
_isStandaloneApp(app) {
let windows = app.get_windows();
return app.get_windows().some(w => w.transient_for == null);
},
_isIntrospectEnabled() {
return this._settings.get_boolean(INTROSPECT_KEY);
},
_isSenderWhitelisted(sender) {
return APP_WHITELIST.includes(sender);
},
_syncRunningApplications() {
let tracker = Shell.WindowTracker.get_default();
let apps = this._appSystem.get_running();
let seatName = "seat0";
let newRunningApplications = {};
let newActiveApplication = null;
let focusedApp = tracker.focus_app;
for (let app of apps) {
let appInfo = {};
let isAppActive = (focusedApp == app);
if (!this._isStandaloneApp(app))
continue;
if (isAppActive) {
appInfo['active-on-seats'] = new GLib.Variant('as', [seatName]);
newActiveApplication = app.get_id();
}
newRunningApplications[app.get_id()] = appInfo;
}
if (this._runningApplicationsDirty ||
(this._activeApplicationDirty &&
this._activeApplication != newActiveApplication)) {
this._runningApplications = newRunningApplications;
this._activeApplication = newActiveApplication;
this._dbusImpl.emit_signal('RunningApplicationsChanged', null);
}
this._runningApplicationsDirty = false;
this._activeApplicationDirty = false;
},
_isEligibleWindow(window) {
if (window.is_override_redirect())
return false;
let type = window.get_window_type();
return (type == Meta.WindowType.NORMAL ||
type == Meta.WindowType.DIALOG ||
type == Meta.WindowType.MODAL_DIALOG ||
type == Meta.WindowType.UTILITY);
},
GetRunningApplicationsAsync(params, invocation) {
if (!this._isIntrospectEnabled() &&
!this._isSenderWhitelisted(invocation.get_sender())) {
invocation.return_error_literal(Gio.DBusError,
Gio.DBusError.ACCESS_DENIED,
'App introspection not allowed');
return;
}
invocation.return_value(new GLib.Variant('(a{sa{sv}})', [this._runningApplications]));
},
GetWindowsAsync(params, invocation) {
let focusWindow = global.display.get_focus_window();
let apps = this._appSystem.get_running();
let windowsList = {};
if (!this._isIntrospectEnabled()) {
invocation.return_error_literal(Gio.DBusError,
Gio.DBusError.ACCESS_DENIED,
'App introspection not allowed');
return;
}
for (let app of apps) {
let windows = app.get_windows();
for (let window of windows) {
if (!this._isEligibleWindow(window))
continue;
let windowId = window.get_id();
let frameRect = window.get_frame_rect();
let title = window.get_title();
let wmClass = window.get_wm_class();
windowsList[windowId] = {
'app-id': GLib.Variant.new('s', app.get_id()),
'client-type': GLib.Variant.new('u', window.get_client_type()),
'is-hidden': GLib.Variant.new('b', window.is_hidden()),
'has-focus': GLib.Variant.new('b', (window == focusWindow)),
'width': GLib.Variant.new('u', frameRect.width),
'height': GLib.Variant.new('u', frameRect.height)
};
// These properties may not be available for all windows:
if (title != null)
windowsList[windowId]['title'] = GLib.Variant.new('s', title);
if (wmClass != null)
windowsList[windowId]['wm-class'] = GLib.Variant.new('s', wmClass);
}
}
invocation.return_value(new GLib.Variant('(a{ta{sv}})', [windowsList]));
}
});

View File

@@ -52,20 +52,11 @@ var KeyboardManager = new Lang.Class({
this._current = null;
this._localeLayoutInfo = this._getLocaleLayout();
this._layoutInfos = {};
this._currentKeymap = null;
},
_applyLayoutGroup(group) {
let options = this._buildOptionsString();
let [layouts, variants] = this._buildGroupStrings(group);
if (this._currentKeymap &&
this._currentKeymap.layouts == layouts &&
this._currentKeymap.variants == variants &&
this._currentKeymap.options == options)
return;
this._currentKeymap = {layouts, variants, options};
Meta.get_backend().set_keymap(layouts, variants, options);
},
@@ -98,6 +89,8 @@ var KeyboardManager = new Lang.Class({
},
setUserLayouts(ids) {
let currentId = this._current ? this._current.id : null;
let currentGroupIndex = this._current ? this._current.groupIndex : null;
this._current = null;
this._layoutInfos = {};
@@ -124,6 +117,9 @@ var KeyboardManager = new Lang.Class({
info.group = group;
info.groupIndex = groupIndex;
if (currentId == id && currentGroupIndex == groupIndex)
this._current = info;
i += 1;
}
},

View File

@@ -112,13 +112,6 @@ var SmartcardManager = new Lang.Class({
return false;
return true;
},
loggedInWithToken() {
if (this._loginToken)
return true;
return false;
}
});

View File

@@ -1628,20 +1628,6 @@ var AppIcon = new Lang.Class({
this.actor.connect('clicked', this._onClicked.bind(this));
this.actor.connect('popup-menu', this._onKeyboardPopupMenu.bind(this));
this._hoverText = null;
this._hoverTimeoutId = 0;
if (this.icon.label) {
this._hoverText = new St.Label({ style_class: 'app-well-hover-text',
text: this.icon.label.text,
visible: false });
this._hoverText.clutter_text.line_wrap = true;
Main.layoutManager.addChrome(this._hoverText);
this.actor.connect('notify::hover', this._syncHoverText.bind(this));
this.connect('sync-tooltip', this._syncHoverText.bind(this));
}
this._menu = null;
this._menuManager = new PopupMenu.PopupMenuManager(this);
@@ -1673,39 +1659,12 @@ var AppIcon = new Lang.Class({
this.app.disconnect(this._stateChangedId);
this._stateChangedId = 0;
this._removeMenuTimeout();
this._removeHoverTimeout();
if (this._hoverText)
this._hoverText.destroy();
this._hoverText = null;
},
_createIcon(iconSize) {
return this.app.create_icon_texture(iconSize);
},
_syncHoverText() {
if (this.shouldShowTooltip()) {
if (this._hoverTimeoutId)
return;
this._hoverTimeoutId = Mainloop.timeout_add(300, () => {
this._hoverText.style = `max-width: ${2 * this.icon.iconSize}px;`;
this._hoverText.ensure_style();
let [x, y] = this.icon.label.get_transformed_position();
let offset = (this._hoverText.width - this.icon.label.width) / 2;
this._hoverText.set_position(Math.floor(x - offset), Math.floor(y));
this._hoverText.show();
this._hoverTimeoutId = 0;
return GLib.SOURCE_REMOVE;
});
} else {
this._removeHoverTimeout();
this._hoverText.hide();
}
},
_removeMenuTimeout() {
if (this._menuTimeoutId > 0) {
Mainloop.source_remove(this._menuTimeoutId);
@@ -1713,13 +1672,6 @@ var AppIcon = new Lang.Class({
}
},
_removeHoverTimeout() {
if (this._hoverTimeoutId > 0) {
Mainloop.source_remove(this._hoverTimeoutId);
this._hoverTimeoutId = 0;
}
},
_updateRunningStyle() {
if (this.app.state != Shell.AppState.STOPPED)
this._dot.show();

View File

@@ -539,15 +539,10 @@ var BackgroundSource = new Lang.Class({
this._backgrounds = [];
this._monitorsChangedId = global.screen.connect('monitors-changed',
this._refresh.bind(this));
global.display.connect('gl-video-memory-purged', () => {
Meta.Background.refresh_all();
this._refresh();
});
this._onMonitorsChanged.bind(this));
},
_refresh() {
_onMonitorsChanged() {
for (let monitorIndex in this._backgrounds) {
let background = this._backgrounds[monitorIndex];

View File

@@ -802,8 +802,6 @@ var NotificationMessage = new Lang.Class({
},
_onDestroy() {
this.parent();
if (this._updatedId)
this.notification.disconnect(this._updatedId);
this._updatedId = 0;

View File

@@ -2,7 +2,6 @@
const Clutter = imports.gi.Clutter;
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const GObject = imports.gi.GObject;
const Lang = imports.lang;
const Meta = imports.gi.Meta;
@@ -14,7 +13,6 @@ const Tweener = imports.ui.tweener;
var FROZEN_WINDOW_BRIGHTNESS = -0.3
var DIALOG_TRANSITION_TIME = 0.15
var ALIVE_TIMEOUT = 5000;
var CloseDialog = new Lang.Class({
Name: 'CloseDialog',
@@ -28,10 +26,6 @@ var CloseDialog = new Lang.Class({
this.parent();
this._window = window;
this._dialog = null;
this._tracked = undefined;
this._timeoutId = 0;
this._windowFocusChangedId = 0;
this._keyFocusChangedId = 0;
},
get window() {
@@ -99,57 +93,10 @@ var CloseDialog = new Lang.Class({
this.response(Meta.CloseDialogResponse.FORCE_CLOSE);
},
_onFocusChanged() {
if (Meta.is_wayland_compositor())
return;
let focusWindow = global.display.focus_window;
let keyFocus = global.stage.key_focus;
let shouldTrack;
if (focusWindow != null)
shouldTrack = focusWindow == this._window;
else
shouldTrack = keyFocus && this._dialog.contains(keyFocus);
if (this._tracked === shouldTrack)
return;
if (shouldTrack)
Main.layoutManager.trackChrome(this._dialog,
{ affectsInputRegion: true });
else
Main.layoutManager.untrackChrome(this._dialog);
// The buttons are broken when they aren't added to the input region,
// so disable them properly in that case
this._dialog.buttonLayout.get_children().forEach(b => {
b.reactive = shouldTrack;
});
this._tracked = shouldTrack;
},
vfunc_show() {
if (this._dialog != null)
return;
Meta.disable_unredirect_for_screen(global.screen);
this._timeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, ALIVE_TIMEOUT,
() => {
this._window.check_alive(global.display.get_current_time_roundtrip());
return GLib.SOURCE_CONTINUE;
});
this._windowFocusChangedId =
global.display.connect('notify::focus-window',
this._onFocusChanged.bind(this));
this._keyFocusChangedId =
global.stage.connect('notify::key-focus',
this._onFocusChanged.bind(this));
this._addWindowEffect();
this._initDialog();
@@ -160,7 +107,9 @@ var CloseDialog = new Lang.Class({
{ scale_y: 1,
transition: 'linear',
time: DIALOG_TRANSITION_TIME,
onComplete: this._onFocusChanged.bind(this)
onComplete: () => {
Main.layoutManager.trackChrome(this._dialog, { affectsInputRegion: true });
}
});
},
@@ -168,17 +117,6 @@ var CloseDialog = new Lang.Class({
if (this._dialog == null)
return;
Meta.enable_unredirect_for_screen(global.screen);
GLib.source_remove(this._timeoutId);
this._timeoutId = 0;
global.display.disconnect(this._windowFocusChangedId)
this._windowFocusChangedId = 0;
global.stage.disconnect(this._keyFocusChangedId);
this._keyFocusChangedId = 0;
let dialog = this._dialog;
this._dialog = null;
this._removeWindowEffect();

View File

@@ -210,10 +210,6 @@ var AutomountManager = new Lang.Class({
},
_onVolumeRemoved(monitor, volume) {
if (volume._allowAutorunExpireId && volume._allowAutorunExpireId > 0) {
Mainloop.source_remove(volume._allowAutorunExpireId);
delete volume._allowAutorunExpireId;
}
this._volumeQueue =
this._volumeQueue.filter(element => (element != volume));
},
@@ -238,10 +234,8 @@ var AutomountManager = new Lang.Class({
_allowAutorunExpire(volume) {
let id = Mainloop.timeout_add_seconds(AUTORUN_EXPIRE_TIMEOUT_SECS, () => {
volume.allowAutorun = false;
delete volume._allowAutorunExpireId;
return GLib.SOURCE_REMOVE;
});
volume._allowAutorunExpireId = id;
GLib.Source.set_name_by_id(id, '[gnome-shell] volume.allowAutorun');
}
});

View File

@@ -27,12 +27,6 @@ var DragMotionResult = {
CONTINUE: 3
};
var DragState = {
INIT: 0,
DRAGGING: 1,
CANCELLED: 2,
};
var DRAG_CURSOR_MAP = {
0: Meta.Cursor.DND_UNSUPPORTED_TARGET,
1: Meta.Cursor.DND_COPY,
@@ -84,8 +78,6 @@ var _Draggable = new Lang.Class({
dragActorOpacity: undefined });
this.actor = actor;
this._dragState = DragState.INIT;
if (!params.manualMode) {
this.actor.connect('button-press-event',
this._onButtonPress.bind(this));
@@ -96,7 +88,7 @@ var _Draggable = new Lang.Class({
this.actor.connect('destroy', () => {
this._actorDestroyed = true;
if (this._dragState == DragState.DRAGGING && this._dragCancellable)
if (this._dragInProgress && this._dragCancellable)
this._cancelDrag(global.get_current_time());
this.disconnectAll();
});
@@ -108,6 +100,7 @@ var _Draggable = new Lang.Class({
this._dragActorOpacity = params.dragActorOpacity;
this._buttonDown = false; // The mouse button has been pressed and has not yet been released.
this._dragInProgress = false; // The drag has been started, and has not been dropped or cancelled yet.
this._animationInProgress = false; // The drag is over and the item is in the process of animating to its original position (snapping back or reverting).
this._dragCancellable = true;
@@ -213,10 +206,9 @@ var _Draggable = new Lang.Class({
(event.type() == Clutter.EventType.TOUCH_END &&
global.display.is_pointer_emulating_sequence(event.get_event_sequence()))) {
this._buttonDown = false;
if (this._dragState == DragState.DRAGGING) {
if (this._dragInProgress) {
return this._dragActorDropped(event);
} else if ((this._dragActor != null || this._dragState == DragState.CANCELLED) &&
!this._animationInProgress) {
} else if (this._dragActor != null && !this._animationInProgress) {
// Drag must have been cancelled with Esc.
this._dragComplete();
return Clutter.EVENT_STOP;
@@ -230,14 +222,14 @@ var _Draggable = new Lang.Class({
} else if (event.type() == Clutter.EventType.MOTION ||
(event.type() == Clutter.EventType.TOUCH_UPDATE &&
global.display.is_pointer_emulating_sequence(event.get_event_sequence()))) {
if (this._dragActor && this._dragState == DragState.DRAGGING) {
if (this._dragInProgress) {
return this._updateDragPosition(event);
} else if (this._dragActor == null && this._dragState != DragState.CANCELLED) {
} else if (this._dragActor == null) {
return this._maybeStartDrag(event);
}
// We intercept KEY_PRESS event so that we can process Esc key press to cancel
// dragging and ignore all other key presses.
} else if (event.type() == Clutter.EventType.KEY_PRESS && this._dragState == DragState.DRAGGING) {
} else if (event.type() == Clutter.EventType.KEY_PRESS && this._dragInProgress) {
let symbol = event.get_key_symbol();
if (symbol == Clutter.Escape) {
this._cancelDrag(event.get_time());
@@ -273,7 +265,7 @@ var _Draggable = new Lang.Class({
*/
startDrag(stageX, stageY, time, sequence) {
currentDraggable = this;
this._dragState = DragState.DRAGGING;
this._dragInProgress = true;
// Special-case St.Button: the pointer grab messes with the internal
// state, so force a reset to a reasonable state here
@@ -350,13 +342,6 @@ var _Draggable = new Lang.Class({
Shell.util_set_hidden_from_pick(this._dragActor, true);
}
this._dragActorDestroyId = this._dragActor.connect('destroy', () => {
// Cancel ongoing animation (if any)
this._finishAnimation();
this._dragActor = null;
this._dragState = DragState.CANCELLED;
});
this._dragOrigOpacity = this._dragActor.opacity;
if (this._dragActorOpacity != undefined)
this._dragActor.opacity = this._dragActorOpacity;
@@ -411,15 +396,10 @@ var _Draggable = new Lang.Class({
return true;
},
_pickTargetActor() {
return this._dragActor.get_stage().get_actor_at_pos(Clutter.PickMode.ALL,
this._dragX, this._dragY);
},
_updateDragHover() {
this._updateHoverId = 0;
let target = this._pickTargetActor();
let target = this._dragActor.get_stage().get_actor_at_pos(Clutter.PickMode.ALL,
this._dragX, this._dragY);
let dragEvent = {
x: this._dragX,
y: this._dragY,
@@ -427,18 +407,6 @@ var _Draggable = new Lang.Class({
source: this.actor._delegate,
targetActor: target
};
let targetActorDestroyHandlerId;
let handleTargetActorDestroyClosure;
handleTargetActorDestroyClosure = () => {
target = this._pickTargetActor();
dragEvent.targetActor = target;
targetActorDestroyHandlerId =
target.connect('destroy', handleTargetActorDestroyClosure);
};
targetActorDestroyHandlerId =
target.connect('destroy', handleTargetActorDestroyClosure);
for (let i = 0; i < dragMonitors.length; i++) {
let motionFunc = dragMonitors[i].dragMotion;
if (motionFunc) {
@@ -449,7 +417,6 @@ var _Draggable = new Lang.Class({
}
}
}
dragEvent.targetActor.disconnect(targetActorDestroyHandlerId);
while (target) {
if (target._delegate && target._delegate.handleDragOver) {
@@ -533,7 +500,7 @@ var _Draggable = new Lang.Class({
event.get_time())) {
// If it accepted the drop without taking the actor,
// handle it ourselves.
if (this._dragActor && this._dragActor.get_parent() == Main.uiGroup) {
if (this._dragActor.get_parent() == Main.uiGroup) {
if (this._restoreOnSuccess) {
this._restoreDragActor(event.get_time());
return true;
@@ -541,7 +508,7 @@ var _Draggable = new Lang.Class({
this._dragActor.destroy();
}
this._dragState = DragState.INIT;
this._dragInProgress = false;
global.screen.set_cursor(Meta.Cursor.DEFAULT);
this.emit('drag-end', event.get_time(), true);
this._dragComplete();
@@ -590,22 +557,20 @@ var _Draggable = new Lang.Class({
_cancelDrag(eventTime) {
this.emit('drag-cancelled', eventTime);
let wasCancelled = (this._dragState == DragState.CANCELLED);
this._dragState = DragState.CANCELLED;
this._dragInProgress = false;
let [snapBackX, snapBackY, snapBackScale] = this._getRestoreLocation();
if (this._actorDestroyed || wasCancelled) {
if (this._actorDestroyed) {
global.screen.set_cursor(Meta.Cursor.DEFAULT);
if (!this._buttonDown)
this._dragComplete();
this.emit('drag-end', eventTime, false);
if (!this._dragOrigParent && this._dragActor)
if (!this._dragOrigParent)
this._dragActor.destroy();
return;
}
let [snapBackX, snapBackY, snapBackScale] = this._getRestoreLocation();
this._animateDragEnd(eventTime,
{ x: snapBackX,
y: snapBackY,
@@ -616,7 +581,7 @@ var _Draggable = new Lang.Class({
},
_restoreDragActor(eventTime) {
this._dragState = DragState.INIT;
this._dragInProgress = false;
let [restoreX, restoreY, restoreScale] = this._getRestoreLocation();
// fade the actor back in at its original location
@@ -631,6 +596,12 @@ var _Draggable = new Lang.Class({
_animateDragEnd(eventTime, params) {
this._animationInProgress = true;
// finish animation if the actor gets destroyed
// during it
this._dragActorDestroyId =
this._dragActor.connect('destroy',
this._finishAnimation.bind(this));
params['opacity'] = this._dragOrigOpacity;
params['transition'] = 'easeOutQuad';
params['onComplete'] = this._onAnimationComplete;
@@ -653,6 +624,9 @@ var _Draggable = new Lang.Class({
},
_onAnimationComplete(dragActor, eventTime) {
dragActor.disconnect(this._dragActorDestroyId);
this._dragActorDestroyId = 0;
if (this._dragOrigParent) {
Main.uiGroup.remove_child(this._dragActor);
this._dragOrigParent.add_actor(this._dragActor);
@@ -667,7 +641,7 @@ var _Draggable = new Lang.Class({
},
_dragComplete() {
if (!this._actorDestroyed && this._dragActor)
if (!this._actorDestroyed)
Shell.util_set_hidden_from_pick(this._dragActor, false);
this._ungrabEvents();
@@ -678,12 +652,7 @@ var _Draggable = new Lang.Class({
this._updateHoverId = 0;
}
if (this._dragActor) {
this._dragActor.disconnect(this._dragActorDestroyId);
this._dragActor = null;
}
this._dragState = DragState.INIT;
this._dragActor = undefined;
currentDraggable = null;
}
});

View File

@@ -7,7 +7,6 @@ const GLib = imports.gi.GLib;
const Gio = imports.gi.Gio;
const St = imports.gi.St;
const Config = imports.misc.config;
const ExtensionUtils = imports.misc.extensionUtils;
const Main = imports.ui.main;
@@ -307,36 +306,6 @@ function _onVersionValidationChanged() {
}
}
function _doUpdateCheck() {
let version = Config.PACKAGE_VERSION.split('.');
if (parseInt(version[1]) % 2 == 0)
version.pop();
let pkgCacheDir = GLib.get_user_cache_dir() + '/gnome-shell/';
let updateStamp = Gio.file_new_for_path(pkgCacheDir +
'update-check-' + version.join('.'));
if (updateStamp.query_exists(null))
return;
GLib.mkdir_with_parents (pkgCacheDir, 0o755);
updateStamp.create(0, null).close(null);
let nOutdated = enabledExtensions.reduce(function(n, uuid) {
let extension = ExtensionUtils.extensions[uuid];
if (extension && extension.state == ExtensionState.OUT_OF_DATE)
n++;
return n;
}, 0);
if (nOutdated == 0)
return;
Main.notify(ngettext("%d extension is out of date",
"%d extensions are out of date",
nOutdated).format(nOutdated),
_("You can visit http://extensions.gnome.org for updates"));
}
function _loadExtensions() {
global.settings.connect('changed::' + ENABLED_EXTENSIONS_KEY, onEnabledExtensionsChanged);
global.settings.connect('changed::' + DISABLE_USER_EXTENSIONS_KEY, onEnabledExtensionsChanged);
@@ -347,11 +316,8 @@ function _loadExtensions() {
let finder = new ExtensionUtils.ExtensionFinder();
finder.connect('extension-found', (finder, extension) => {
loadExtension(extension);
if (Main.sessionMode.enabledExtensions.indexOf(extension.uuid) != -1)
extension.type = ExtensionUtils.ExtensionType.SESSION_MODE;
});
finder.scanExtensions();
_doUpdateCheck();
}
function enableAllExtensions() {

View File

@@ -533,25 +533,17 @@ var FocusTracker = new Lang.Class({
},
_setCurrentRect(rect) {
if (this._currentWindow) {
let frameRect = this._currentWindow.get_frame_rect();
rect.x -= frameRect.x;
rect.y -= frameRect.y;
}
let frameRect = this._currentWindow.get_frame_rect();
rect.x -= frameRect.x;
rect.y -= frameRect.y;
this._rect = rect;
this.emit('position-changed');
},
getCurrentRect() {
let rect = { x: this._rect.x, y: this._rect.y,
width: this._rect.width, height: this._rect.height };
if (this._currentWindow) {
let frameRect = this._currentWindow.get_frame_rect();
rect.x += frameRect.x;
rect.y += frameRect.y;
}
let frameRect = this._currentWindow.get_frame_rect();
let rect = { x: this._rect.x + frameRect.x, y: this._rect.y + frameRect.y, width: this._rect.width, height: this._rect.height };
return rect;
}

View File

@@ -278,6 +278,18 @@ var LayoutManager = new Lang.Class({
global.screen.connect('in-fullscreen-changed',
this._updateFullscreen.bind(this));
this._monitorsChanged();
// NVIDIA drivers don't preserve FBO contents across
// suspend/resume, see
// https://bugzilla.gnome.org/show_bug.cgi?id=739178
if (Shell.util_need_background_refresh()) {
LoginManager.getLoginManager().connect('prepare-for-sleep',
(lm, suspending) => {
if (suspending)
return;
Meta.Background.refresh_all();
});
}
},
// This is called by Main after everything else is constructed

View File

@@ -20,7 +20,6 @@ const Environment = imports.ui.environment;
const ExtensionSystem = imports.ui.extensionSystem;
const ExtensionDownloader = imports.ui.extensionDownloader;
const InputMethod = imports.misc.inputMethod;
const Introspect = imports.misc.introspect;
const Keyboard = imports.ui.keyboard;
const MessageTray = imports.ui.messageTray;
const ModalDialog = imports.ui.modalDialog;
@@ -83,7 +82,6 @@ var keyboard = null;
var layoutManager = null;
var kbdA11yDialog = null;
var inputMethod = null;
var introspectService = null;
let _startDate;
let _defaultCssStylesheet = null;
let _cssStylesheet = null;
@@ -189,8 +187,6 @@ function _initializeUI() {
windowAttentionHandler = new WindowAttentionHandler.WindowAttentionHandler();
componentManager = new Components.ComponentManager();
introspectService = new Introspect.IntrospectService();
layoutManager.init();
overview.init();
@@ -212,8 +208,10 @@ function _initializeUI() {
});
global.display.connect('gl-video-memory-purged', () => {
let cache = St.TextureCache.get_default();
let cache = St.TextureCache.get_default();
cache.clear();
loadTheme();
});

View File

@@ -362,8 +362,7 @@ var Message = new Lang.Class({
this.setBody(body);
this._closeButton.connect('clicked', this.close.bind(this));
let actorHoverId = this.actor.connect('notify::hover', this._sync.bind(this));
this._closeButton.connect('destroy', this.actor.disconnect.bind(this.actor, actorHoverId));
this.actor.connect('notify::hover', this._sync.bind(this));
this.actor.connect('clicked', this._onClicked.bind(this));
this.actor.connect('destroy', this._onDestroy.bind(this));
this._sync();

View File

@@ -108,30 +108,15 @@ var OsdWindow = new Lang.Class({
this._hideTimeoutId = 0;
this._reset();
this.actor.connect('destroy', this._onDestroy.bind(this));
this._monitorsChangedId =
Main.layoutManager.connect('monitors-changed',
this._relayout.bind(this));
Main.layoutManager.connect('monitors-changed',
this._relayout.bind(this));
let themeContext = St.ThemeContext.get_for_stage(global.stage);
this._scaleChangedId =
themeContext.connect('notify::scale-factor',
this._relayout.bind(this));
themeContext.connect('notify::scale-factor',
this._relayout.bind(this));
this._relayout();
Main.uiGroup.add_child(this.actor);
},
_onDestroy() {
if (this._monitorsChangedId)
Main.layoutManager.disconnect(this._monitorsChangedId);
this._monitorsChangedId = 0;
let themeContext = St.ThemeContext.get_for_stage(global.stage);
if (this._scaleChangedId)
themeContext.disconnect(this._scaleChangedId);
this._scaleChangedId = 0;
},
setIcon(icon) {
this._icon.gicon = icon;
},

View File

@@ -406,18 +406,11 @@ var ActivitiesButton = new Lang.Class({
this.actor.name = 'panelActivities';
let box = new St.BoxLayout();
this.actor.add_actor(box);
let iconFile = Gio.File.new_for_path('/usr/share/icons/hicolor/scalable/apps/start-here.svg');
this._icon = new St.Icon({ gicon: new Gio.FileIcon({ file: iconFile }),
style_class: 'panel-logo-icon' });
box.add_actor(this._icon);
/* Translators: If there is no suitable word for "Activities"
in your language, you can use the word for "Overview". */
this._label = new St.Label({ text: _("Activities"),
y_align: Clutter.ActorAlign.CENTER });
box.add_actor(this._label);
this.actor.add_actor(this._label);
this.actor.label_actor = this._label;

View File

@@ -515,10 +515,8 @@ var ScreenShield = new Lang.Class({
this._smartcardManager = SmartcardManager.getSmartcardManager();
this._smartcardManager.connect('smartcard-inserted',
(manager, token) => {
if (this._isLocked && token.UsedToLogin) {
this._wakeUpScreen();
if (this._isLocked && token.UsedToLogin)
this._liftShield(true, 0);
}
});
this._oVirtCredentialsManager = OVirt.getOVirtCredentialsManager();

View File

@@ -322,10 +322,6 @@ const GnomeShellExtensionsIface = '<node> \
</method> \
<method name="CheckForUpdates"> \
</method> \
<method name="LoadUserExtension"> \
<arg type="s" direction="in" name="uuid"/> \
<arg type="b" direction="out" name="success"/> \
</method> \
<property name="ShellVersion" type="s" access="read" /> \
</interface> \
</node>';
@@ -428,22 +424,6 @@ var GnomeShellExtensions = new Lang.Class({
ExtensionDownloader.checkForUpdates();
},
LoadUserExtension(uuid) {
let extension = ExtensionUtils.extensions[uuid];
if (extension)
return true;
let dir = Gio.File.new_for_path(GLib.build_filenamev([global.userdatadir, 'extensions', uuid]));
try {
extension = ExtensionUtils.createExtensionObject(uuid, dir, ExtensionUtils.ExtensionType.PER_USER);
ExtensionSystem.loadExtension(extension);
} catch (e) {
log('Could not load user extension from %s'.format(dir.get_path()));
return false;
}
return true;
},
ShellVersion: Config.PACKAGE_VERSION,
_extensionStateChanged(_, newState) {

View File

@@ -58,9 +58,6 @@ var AltSwitcher = new Lang.Class({
childToShow = this._standard;
} else if (this._alternate.visible) {
childToShow = this._alternate;
} else {
this.actor.hide();
return;
}
let childShown = this.actor.get_child();
@@ -82,7 +79,7 @@ var AltSwitcher = new Lang.Class({
global.sync_pointer();
}
this.actor.show();
this.actor.visible = (childToShow != null);
},
_onDestroy() {

View File

@@ -69,67 +69,30 @@ function _getTweenState(target) {
return target.__ShellTweenerState;
}
function _ensureHandlers(target) {
if (!target.__ShellTweenerHandlers)
target.__ShellTweenerHandlers = {};
return target.__ShellTweenerHandlers;
}
function _resetTweenState(target) {
let state = target.__ShellTweenerState;
if (state) {
if (state.destroyedId) {
if (state.destroyedId)
state.actor.disconnect(state.destroyedId);
delete state.destroyedId;
}
}
_removeHandler(target, 'onComplete', _tweenCompleted);
target.__ShellTweenerState = {};
}
function _addHandler(target, params, name, handler) {
let wrapperNeeded = false;
let tweenerHandlers = _ensureHandlers(target);
if (params[name]) {
let oldHandler = params[name];
let oldScope = params[name + 'Scope'];
let oldParams = params[name + 'Params'];
let eventScope = oldScope ? oldScope : target;
if (!(name in tweenerHandlers)) {
tweenerHandlers[name] = [];
wrapperNeeded = true;
}
let handlers = tweenerHandlers[name];
handlers.push(handler);
if (wrapperNeeded) {
if (params[name]) {
let oldHandler = params[name];
let oldScope = params[name + 'Scope'];
let oldParams = params[name + 'Params'];
let eventScope = oldScope ? oldScope : target;
params[name] = () => {
oldHandler.apply(eventScope, oldParams);
handlers.forEach((h) => h(target));
};
} else {
params[name] = () => { handlers.forEach((h) => h(target)); };
}
}
}
function _removeHandler(target, name, handler) {
let tweenerHandlers = _ensureHandlers(target);
if (name in tweenerHandlers) {
let handlers = tweenerHandlers[name];
let handlerIndex = handlers.indexOf(handler);
while (handlerIndex > -1) {
handlers.splice(handlerIndex, 1);
handlerIndex = handlers.indexOf(handler);
}
}
params[name] = () => {
oldHandler.apply(eventScope, oldParams);
handler(target);
};
} else
params[name] = () => { handler(target); };
}
function _actorDestroyed(target) {

View File

@@ -51,14 +51,7 @@ var UnlockDialog = new Lang.Class({
y_expand: true });
this.actor.add_child(this._promptBox);
this._gdmClient = new Gdm.Client();
try {
this._gdmClient.set_enabled_extensions([Gdm.UserVerifierChoiceList.interface_info().name]);
} catch(e) {
}
this._authPrompt = new AuthPrompt.AuthPrompt(this._gdmClient, AuthPrompt.AuthPromptMode.UNLOCK_ONLY);
this._authPrompt = new AuthPrompt.AuthPrompt(new Gdm.Client(), AuthPrompt.AuthPromptMode.UNLOCK_ONLY);
this._authPrompt.connect('failed', this._fail.bind(this));
this._authPrompt.connect('cancelled', this._fail.bind(this));
this._authPrompt.connect('reset', this._onReset.bind(this));

View File

@@ -123,22 +123,6 @@ var WindowMenu = new Lang.Class({
window.change_workspace(workspace.get_neighbor(dir));
});
}
let nWorkspaces = global.screen.n_workspaces;
if (nWorkspaces > 1 && !Meta.prefs_get_dynamic_workspaces()) {
item = new PopupMenu.PopupSubMenuMenuItem(_("Move to another workspace"));
this.addMenuItem(item);
let currentIndex = global.screen.get_active_workspace_index();
for (let i = 0; i < nWorkspaces; i++) {
let index = i;
let name = Meta.prefs_get_workspace_name(i);
let subitem = item.menu.addAction(name, () => {
window.change_workspace_by_index(index, false);
});
subitem.setSensitive(currentIndex != i);
}
}
}
}

View File

@@ -56,7 +56,6 @@ mozplugindir = join_paths(libdir, 'mozilla', 'plugins')
portaldir = join_paths(datadir, 'xdg-desktop-portal', 'portals')
schemadir = join_paths(datadir, 'glib-2.0', 'schemas')
servicedir = join_paths(datadir, 'dbus-1', 'services')
themedir = join_paths(pkgdatadir, 'theme')
plugindir = get_variable('BROWSER_PLUGIN_DIR', mozplugindir)

View File

@@ -38,7 +38,6 @@ extern GType gnome_shell_plugin_get_type (void);
static gboolean is_gdm_mode = FALSE;
static char *session_mode = NULL;
static char *override_schema = NULL;
static int caught_signal = 0;
#define DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER 1
@@ -451,12 +450,6 @@ GOptionEntry gnome_shell_options[] = {
N_("List possible modes"),
NULL
},
{
"override-schema", 0, 0, G_OPTION_ARG_STRING,
&override_schema,
N_("Override the override schema"),
"SCHEMA"
},
{ NULL }
};
@@ -514,9 +507,7 @@ main (int argc, char **argv)
if (session_mode == NULL)
session_mode = is_gdm_mode ? (char *)"gdm" : (char *)"user";
_shell_global_init ("session-mode", session_mode,
"override-schema", override_schema,
NULL);
_shell_global_init ("session-mode", session_mode, NULL);
shell_prefs_init ();

View File

@@ -265,7 +265,7 @@ shell_app_get_name (ShellApp *app)
const char *name = NULL;
if (window)
name = meta_window_get_title (window);
name = meta_window_get_wm_class (window);
if (!name)
name = C_("program", "Unknown");
return name;
@@ -1159,7 +1159,7 @@ shell_app_request_quit (ShellApp *app)
{
MetaWindow *win = iter->data;
if (!meta_window_can_close (win))
if (meta_window_is_skip_taskbar (win))
continue;
meta_window_delete (win, shell_global_get_current_time (shell_global_get ()));

View File

@@ -65,7 +65,6 @@ struct _ShellGlobal {
MetaScreen *meta_screen;
char *session_mode;
char *override_schema;
XserverRegion input_region;
@@ -97,7 +96,6 @@ enum {
PROP_0,
PROP_SESSION_MODE,
PROP_OVERRIDE_SCHEMA,
PROP_SCREEN,
PROP_DISPLAY,
PROP_SCREEN_WIDTH,
@@ -140,10 +138,6 @@ shell_global_set_property(GObject *object,
g_clear_pointer (&global->session_mode, g_free);
global->session_mode = g_ascii_strdown (g_value_get_string (value), -1);
break;
case PROP_OVERRIDE_SCHEMA:
g_clear_pointer (&global->override_schema, g_free);
global->override_schema = g_value_dup_string (value);
break;
case PROP_FRAME_TIMESTAMPS:
global->frame_timestamps = g_value_get_boolean (value);
break;
@@ -169,9 +163,6 @@ shell_global_get_property(GObject *object,
case PROP_SESSION_MODE:
g_value_set_string (value, shell_global_get_session_mode (global));
break;
case PROP_OVERRIDE_SCHEMA:
g_value_set_string (value, global->override_schema);
break;
case PROP_SCREEN:
g_value_set_object (value, global->meta_screen);
break;
@@ -377,13 +368,6 @@ shell_global_class_init (ShellGlobalClass *klass)
g_param_spec_string ("session-mode",
"Session Mode",
"The session mode to use",
NULL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (gobject_class,
PROP_OVERRIDE_SCHEMA,
g_param_spec_string ("override-schema",
"Override Schema",
"The override schema to use",
"user",
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (gobject_class,
@@ -1376,9 +1360,7 @@ shell_global_get_overrides_settings (ShellGlobal *global)
if (!settings)
{
if (global->override_schema != NULL)
schema = global->override_schema;
else if (strcmp (global->session_mode, "classic") == 0)
if (strcmp (global->session_mode, "classic") == 0)
schema = "org.gnome.shell.extensions.classic-overrides";
else if (strcmp (global->session_mode, "user") == 0)
schema = "org.gnome.shell.overrides";

View File

@@ -396,6 +396,15 @@ get_gl_vendor (void)
return vendor;
}
gboolean
shell_util_need_background_refresh (void)
{
if (g_strcmp0 (get_gl_vendor (), "NVIDIA Corporation") == 0)
return TRUE;
return FALSE;
}
static gboolean
canvas_draw_cb (ClutterContent *content,
cairo_t *cr,