Compare commits
65 Commits
3.28.0
...
wip/textur
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0507fef4cd | ||
![]() |
68c631223c | ||
![]() |
97b38c1950 | ||
![]() |
b098930e6d | ||
![]() |
45da60516c | ||
![]() |
c4b1ba48f2 | ||
![]() |
6ed21e1ce0 | ||
![]() |
9c51c87d8c | ||
![]() |
db2245d60b | ||
![]() |
f26cc3ac23 | ||
![]() |
02c5b4b947 | ||
![]() |
df57829ea1 | ||
![]() |
da96408098 | ||
![]() |
4b2e0247af | ||
![]() |
2c617e5a3a | ||
![]() |
4ff7e84c51 | ||
![]() |
9f76b6e4a2 | ||
![]() |
0ac0f7e85b | ||
![]() |
73b00ff1a7 | ||
![]() |
a52597ac5b | ||
![]() |
9a2597f80b | ||
![]() |
e1ed4b25e1 | ||
![]() |
c70b18764b | ||
![]() |
4398516520 | ||
![]() |
220514d10e | ||
![]() |
18312d9ccd | ||
![]() |
234b1441e4 | ||
![]() |
e909db5848 | ||
![]() |
702338bc7d | ||
![]() |
7c9dbc66d9 | ||
![]() |
0d031dc20f | ||
![]() |
b476e851b7 | ||
![]() |
a27be6a540 | ||
![]() |
4b6a57fabe | ||
![]() |
92758890bb | ||
![]() |
5b10d157fe | ||
![]() |
5cc42b18b0 | ||
![]() |
cb4252e888 | ||
![]() |
09d3cdb023 | ||
![]() |
71515a8a11 | ||
![]() |
11ca8dd54f | ||
![]() |
e00f22ebe6 | ||
![]() |
13390543b0 | ||
![]() |
de95ced92c | ||
![]() |
f6a08472a0 | ||
![]() |
9f7b101437 | ||
![]() |
9c0707d4dc | ||
![]() |
78a92fb6be | ||
![]() |
01509cf1a5 | ||
![]() |
61e9f51274 | ||
![]() |
201bd9d42e | ||
![]() |
8a78f08f6c | ||
![]() |
a5e54f9712 | ||
![]() |
526834e39b | ||
![]() |
bdde2476d2 | ||
![]() |
3171f9debe | ||
![]() |
0e2aeac5f9 | ||
![]() |
788fb5547c | ||
![]() |
c4d2c0ee64 | ||
![]() |
977686a77a | ||
![]() |
44b29f210c | ||
![]() |
36c7d65ccf | ||
![]() |
b81d24fdb4 | ||
![]() |
bfdbee8115 | ||
![]() |
4a17c8f4a9 |
45
NEWS
45
NEWS
@@ -1,3 +1,48 @@
|
||||
3.28.3
|
||||
======
|
||||
* Fix lagging pointer when zoomed [Daniel; #682013]
|
||||
* Fix "Clear All" for calendar events [Florian; #325]
|
||||
* Misc. bug fixes [Florian, Mario, Marco; #136, #214, #788931, #791233]
|
||||
|
||||
Contributors:
|
||||
Carlos Garnacho, Florian Müllner, Mario Sanchez Prada, Joe Rabinoff,
|
||||
Didier Roche, Marco Trevisan (Treviño), Daniel van Vugt
|
||||
|
||||
Translators:
|
||||
Pieter Schalk Schoeman [af], Gun Chleoc [gd]
|
||||
|
||||
3.28.2
|
||||
======
|
||||
* Fix lock-up on cancelling polkit dialog [Florian; #221]
|
||||
* Guard against untimely keyboard map changes [Carlos; #240]
|
||||
* Fix blurriness of OSD under some resolutions [Silvère; #782011]
|
||||
* Fix icons in search provider results [Florian; #249]
|
||||
* Misc. bug fixes [Marco, Florian; #792687, #781471]
|
||||
|
||||
Contributors:
|
||||
Carlos Garnacho, Silvère Latchurié, Florian Müllner, Mario Sanchez Prada,
|
||||
Ray Strode, Marco Trevisan (Treviño)
|
||||
|
||||
Translators:
|
||||
Stas Solovey [ru], Rafael Fontenelle [pt_BR]
|
||||
|
||||
3.28.1
|
||||
======
|
||||
* Fix compose characters in shell entries [Carlos; #115]
|
||||
* Don't show authentication dialogs on lock screen [Florian; #179, #166]
|
||||
* Fix handling of UTC timezone in world clock [Florian; #150]
|
||||
* Fix keyboard navigation in overview when hovering windows [Florian; #50]
|
||||
* Misc. bug fixes [Florian; #127, #788908, #763886, !39]
|
||||
|
||||
Contributors:
|
||||
Jeremy Bicha, Carlos Garnacho, Andy Holmes, Florian Müllner, Bastien Nocera
|
||||
|
||||
Translators:
|
||||
Stas Solovey [ru], Daniel Șerbănescu [ro], Dušan Kazik [sk],
|
||||
Rafael Fontenelle [pt_BR], Nathan Follens [nl], Dz Chen [zh_CN],
|
||||
Matej Urbančič [sl], Hannie Dumoleyn [nl], Khaled Hosny [ar],
|
||||
Guillaume Bernard [fr]
|
||||
|
||||
3.28.0
|
||||
======
|
||||
|
||||
|
@@ -39,7 +39,7 @@
|
||||
</description>
|
||||
</key>
|
||||
<key name="favorite-apps" type="as">
|
||||
<default>[ 'epiphany.desktop', 'evolution.desktop', 'rhythmbox.desktop', 'shotwell.desktop', 'org.gnome.Nautilus.desktop', 'org.gnome.Software.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
|
||||
|
@@ -824,6 +824,8 @@ StScrollBar {
|
||||
|
||||
.screencast-indicator { color: $warning_color; }
|
||||
|
||||
.remote-access-indicator { color: $warning_color; }
|
||||
|
||||
&.solid {
|
||||
background-color: black;
|
||||
/* transition from transparent to solid */
|
||||
@@ -1111,7 +1113,7 @@ StScrollBar {
|
||||
.aggregate-menu {
|
||||
min-width: 21em;
|
||||
.popup-menu-icon { padding: 0 4px; }
|
||||
.popup-sub-menu .popup-menu-item :first-child {
|
||||
.popup-sub-menu .popup-menu-item > :first-child {
|
||||
&:ltr { /* 12px spacing + 2*4px padding */
|
||||
padding-left: 20px; margin-left: 1.09em; }
|
||||
&:rtl { /* 12px spacing + 2*4px padding */
|
||||
|
@@ -130,6 +130,7 @@
|
||||
<file>ui/status/rfkill.js</file>
|
||||
<file>ui/status/volume.js</file>
|
||||
<file>ui/status/bluetooth.js</file>
|
||||
<file>ui/status/remoteAccess.js</file>
|
||||
<file>ui/status/screencast.js</file>
|
||||
<file>ui/status/system.js</file>
|
||||
<file>ui/status/thunderbolt.js</file>
|
||||
|
@@ -115,6 +115,11 @@ var IBusManager = new Lang.Class({
|
||||
object_path: IBus.PATH_PANEL });
|
||||
this._candidatePopup.setPanelService(this._panelService);
|
||||
this._panelService.connect('update-property', this._updateProperty.bind(this));
|
||||
this._panelService.connect('set-cursor-location', (ps, x, y, w, h) => {
|
||||
let cursorLocation = { x, y, width: w, height: h };
|
||||
this.emit('set-cursor-location', cursorLocation);
|
||||
});
|
||||
|
||||
try {
|
||||
// IBus versions older than 1.5.10 have a bug which
|
||||
// causes spurious set-content-type emissions when
|
||||
|
@@ -188,8 +188,7 @@ var InputMethod = new Lang.Class({
|
||||
vfunc_filter_key_event(event) {
|
||||
if (!this._context || !this._enabled)
|
||||
return false;
|
||||
if (!this._currentSource ||
|
||||
this._currentSource.type == Keyboard.INPUT_SOURCE_TYPE_XKB)
|
||||
if (!this._currentSource)
|
||||
return false;
|
||||
|
||||
let state = event.get_state();
|
||||
|
@@ -89,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 = {};
|
||||
|
||||
@@ -115,6 +117,9 @@ var KeyboardManager = new Lang.Class({
|
||||
info.group = group;
|
||||
info.groupIndex = groupIndex;
|
||||
|
||||
if (currentId == id && currentGroupIndex == groupIndex)
|
||||
this._current = info;
|
||||
|
||||
i += 1;
|
||||
}
|
||||
},
|
||||
|
@@ -17,7 +17,7 @@ const Params = imports.misc.params;
|
||||
var SCROLL_TIME = 0.1;
|
||||
|
||||
// http://daringfireball.net/2010/07/improved_regex_for_matching_urls
|
||||
const _balancedParens = '\\((?:[^\\s()<>]+|(?:\\(?:[^\\s()<>]+\\)))*\\)';
|
||||
const _balancedParens = '\\([^\\s()<>]+\\)';
|
||||
const _leadingJunk = '[\\s`(\\[{\'\\"<\u00AB\u201C\u2018]';
|
||||
const _notTrailingJunk = '[^\\s`!()\\[\\]{};:\'\\".,<>?\u00AB\u00BB\u201C\u201D\u2018\u2019]';
|
||||
|
||||
|
@@ -13,6 +13,7 @@ const RENAMED_DESKTOP_IDS = {
|
||||
'dconf-editor.desktop': 'ca.desrt.dconf-editor.desktop',
|
||||
'empathy.desktop': 'org.gnome.Empathy.desktop',
|
||||
'epiphany.desktop': 'org.gnome.Epiphany.desktop',
|
||||
'evolution.desktop': 'org.gnome.Evolution.desktop',
|
||||
'file-roller.desktop': 'org.gnome.FileRoller.desktop',
|
||||
'gcalctool.desktop': 'org.gnome.Calculator.desktop',
|
||||
'geary.desktop': 'org.gnome.Geary.desktop',
|
||||
@@ -34,11 +35,13 @@ const RENAMED_DESKTOP_IDS = {
|
||||
'gnome-screenshot.desktop': 'org.gnome.Screenshot.desktop',
|
||||
'gnome-software.desktop': 'org.gnome.Software.desktop',
|
||||
'gnome-terminal.desktop': 'org.gnome.Terminal.desktop',
|
||||
'gnome-tweaks.desktop': 'org.gnome.tweaks.desktop',
|
||||
'gnome-weather.desktop': 'org.gnome.Weather.Application.desktop',
|
||||
'gnomine.desktop': 'gnome-mines.desktop',
|
||||
'gnotravex.desktop': 'gnome-tetravex.desktop',
|
||||
'gnotski.desktop': 'gnome-klotski.desktop',
|
||||
'gtali.desktop': 'tali.desktop',
|
||||
'mozilla-firefox.desktop': 'firefox.desktop',
|
||||
'nautilus.desktop': 'org.gnome.Nautilus.desktop',
|
||||
'polari.desktop': 'org.gnome.Polari.desktop',
|
||||
'totem.desktop': 'org.gnome.Totem.desktop',
|
||||
|
@@ -264,7 +264,7 @@ var Background = new Lang.Class({
|
||||
(lm, aboutToSuspend) => {
|
||||
if (aboutToSuspend)
|
||||
return;
|
||||
this._refreshAnimation();
|
||||
this.emit('changed');
|
||||
});
|
||||
|
||||
this._settingsChangedSignalId = this._settings.connect('changed', () => {
|
||||
|
@@ -821,6 +821,8 @@ var EventsSection = new Lang.Class({
|
||||
this._desktopSettings.connect('changed', this._reloadEvents.bind(this));
|
||||
this._eventSource = new EmptyEventSource();
|
||||
|
||||
this._messageById = new Map();
|
||||
|
||||
this.parent();
|
||||
|
||||
this._title = new St.Button({ style_class: 'events-section-title',
|
||||
@@ -875,20 +877,32 @@ var EventsSection = new Lang.Class({
|
||||
|
||||
this._reloading = true;
|
||||
|
||||
this._list.destroy_all_children();
|
||||
|
||||
let periodBegin = _getBeginningOfDay(this._date);
|
||||
let periodEnd = _getEndOfDay(this._date);
|
||||
let events = this._eventSource.getEvents(periodBegin, periodEnd);
|
||||
|
||||
let ids = events.map(e => e.id);
|
||||
this._messageById.forEach((message, id) => {
|
||||
if (ids.includes(id))
|
||||
return;
|
||||
this._messageById.delete(id);
|
||||
this.removeMessage(message);
|
||||
});
|
||||
|
||||
for (let i = 0; i < events.length; i++) {
|
||||
let event = events[i];
|
||||
|
||||
let message = new EventMessage(event, this._date);
|
||||
message.connect('close', () => {
|
||||
this._ignoreEvent(event);
|
||||
});
|
||||
this.addMessage(message, false);
|
||||
let message = this._messageById.get(event.id);
|
||||
if (!message) {
|
||||
message = new EventMessage(event, this._date);
|
||||
message.connect('close', () => {
|
||||
this._ignoreEvent(event);
|
||||
});
|
||||
this._messageById.set(event.id, message);
|
||||
this.addMessage(message, false);
|
||||
} else {
|
||||
this.moveMessage(message, i, false);
|
||||
}
|
||||
}
|
||||
|
||||
this._reloading = false;
|
||||
|
@@ -655,7 +655,7 @@ var NetworkAgent = new Lang.Class({
|
||||
switch (connectionType) {
|
||||
case '802-11-wireless':
|
||||
let wirelessSetting = connection.get_setting_wireless();
|
||||
let ssid = NM.utils_ssid_to_utf8(wirelessSetting.get_ssid());
|
||||
let ssid = NM.utils_ssid_to_utf8(wirelessSetting.get_ssid().get_data());
|
||||
title = _("Authentication required by wireless network");
|
||||
body = _("Passwords or encryption keys are required to access the wireless network “%s”.").format(ssid);
|
||||
break;
|
||||
@@ -765,57 +765,29 @@ var NetworkAgent = new Lang.Class({
|
||||
this._vpnCacheBuilt = true;
|
||||
this._vpnBinaries = { };
|
||||
|
||||
try {
|
||||
let fileEnum = this._pluginDir.enumerate_children('standard::name', Gio.FileQueryInfoFlags.NONE, null);
|
||||
let info;
|
||||
NM.VpnPluginInfo.list_load().forEach(plugin => {
|
||||
let service = plugin.get_service();
|
||||
let fileName = plugin.get_auth_dialog();
|
||||
let supportsHints = plugin.supports_hints();
|
||||
let externalUIMode = false;
|
||||
|
||||
while ((info = fileEnum.next_file(null))) {
|
||||
let name = info.get_name();
|
||||
if (name.substr(-5) != '.name')
|
||||
continue;
|
||||
|
||||
try {
|
||||
let keyfile = new GLib.KeyFile();
|
||||
keyfile.load_from_file(this._pluginDir.get_child(name).get_path(), GLib.KeyFileFlags.NONE);
|
||||
let service = keyfile.get_string('VPN Connection', 'service');
|
||||
let binary = keyfile.get_string('GNOME', 'auth-dialog');
|
||||
let externalUIMode = false;
|
||||
let hints = false;
|
||||
|
||||
try {
|
||||
externalUIMode = keyfile.get_boolean('GNOME', 'supports-external-ui-mode');
|
||||
} catch(e) { } // ignore errors if key does not exist
|
||||
|
||||
try {
|
||||
hints = keyfile.get_boolean('GNOME', 'supports-hints');
|
||||
} catch(e) { } // ignore errors if key does not exist
|
||||
|
||||
let path = binary;
|
||||
if (!GLib.path_is_absolute(path)) {
|
||||
path = GLib.build_filenamev([Config.LIBEXECDIR, path]);
|
||||
}
|
||||
|
||||
if (GLib.file_test(path, GLib.FileTest.IS_EXECUTABLE)) {
|
||||
this._vpnBinaries[service] = { fileName: path, externalUIMode: externalUIMode, supportsHints: hints };
|
||||
try {
|
||||
let aliases = keyfile.get_string_list('VPN Connection', 'aliases');
|
||||
|
||||
for (let alias of aliases) {
|
||||
this._vpnBinaries[alias] = { fileName: path, externalUIMode: externalUIMode, supportsHints: hints };
|
||||
}
|
||||
} catch(e) { } // ignore errors if key does not exist
|
||||
} else {
|
||||
throw new Error('VPN plugin at %s is not executable'.format(path));
|
||||
}
|
||||
} catch(e) {
|
||||
log('Error \'%s\' while processing VPN keyfile \'%s\''.
|
||||
format(e.message, this._pluginDir.get_child(name).get_path()));
|
||||
continue;
|
||||
}
|
||||
let prop = plugin.lookup_property('GNOME', 'supports-external-ui-mode');
|
||||
if (prop) {
|
||||
prop = prop.trim().toLowerCase();
|
||||
externalUIMode = ['true', 'yes', 'on', '1'].includes(prop);
|
||||
}
|
||||
} catch(e) {
|
||||
logError(e, 'error while enumerating VPN auth helpers');
|
||||
}
|
||||
|
||||
if (GLib.file_test(fileName, GLib.FileTest.IS_EXECUTABLE)) {
|
||||
let binary = { fileName, externalUIMode, supportsHints };
|
||||
this._vpnBinaries[service] = binary;
|
||||
|
||||
plugin.get_aliases().forEach(alias => {
|
||||
this._vpnBinaries[alias] = binary;
|
||||
});
|
||||
} else {
|
||||
log('VPN plugin at %s is not executable'.format(fileName));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
var Component = NetworkAgent;
|
||||
|
@@ -16,6 +16,7 @@ const PolkitAgent = imports.gi.PolkitAgent;
|
||||
const Animation = imports.ui.animation;
|
||||
const Components = imports.ui.components;
|
||||
const Dialog = imports.ui.dialog;
|
||||
const Main = imports.ui.main;
|
||||
const ModalDialog = imports.ui.modalDialog;
|
||||
const ShellEntry = imports.ui.shellEntry;
|
||||
const UserWidget = imports.ui.userWidget;
|
||||
@@ -39,6 +40,10 @@ var AuthenticationDialog = new Lang.Class({
|
||||
this.userNames = userNames;
|
||||
this._wasDismissed = false;
|
||||
|
||||
this._sessionUpdatedId = Main.sessionMode.connect('updated', () => {
|
||||
this._group.visible = !Main.sessionMode.isLocked;
|
||||
});
|
||||
|
||||
let icon = new Gio.ThemedIcon({ name: 'dialog-password-symbolic' });
|
||||
let title = _("Authentication Required");
|
||||
|
||||
@@ -193,6 +198,14 @@ var AuthenticationDialog = new Lang.Class({
|
||||
this._session.initiate();
|
||||
},
|
||||
|
||||
close(timestamp) {
|
||||
this.parent(timestamp);
|
||||
|
||||
if (this._sessionUpdatedId)
|
||||
Main.sessionMode.disconnect(this._sessionUpdatedId);
|
||||
this._sessionUpdatedId = 0;
|
||||
},
|
||||
|
||||
_ensureOpen() {
|
||||
// NOTE: ModalDialog.open() is safe to call if the dialog is
|
||||
// already open - it just returns true without side-effects
|
||||
@@ -348,6 +361,7 @@ var AuthenticationAgent = new Lang.Class({
|
||||
this._native = new Shell.PolkitAuthenticationAgent();
|
||||
this._native.connect('initiate', this._onInitiate.bind(this));
|
||||
this._native.connect('cancel', this._onCancel.bind(this));
|
||||
this._sessionUpdatedId = 0;
|
||||
},
|
||||
|
||||
enable() {
|
||||
@@ -367,6 +381,17 @@ var AuthenticationAgent = new Lang.Class({
|
||||
},
|
||||
|
||||
_onInitiate(nativeAgent, actionId, message, iconName, cookie, userNames) {
|
||||
// Don't pop up a dialog while locked
|
||||
if (Main.sessionMode.isLocked) {
|
||||
this._sessionUpdatedId = Main.sessionMode.connect('updated', () => {
|
||||
Main.sessionMode.disconnect(this._sessionUpdatedId);
|
||||
this._sessionUpdatedId = 0;
|
||||
|
||||
this._onInitiate(nativeAgent, actionId, message, iconName, cookie, userNames);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
this._currentDialog = new AuthenticationDialog(actionId, message, cookie, userNames);
|
||||
|
||||
// We actually don't want to open the dialog until we know for
|
||||
@@ -396,6 +421,10 @@ var AuthenticationAgent = new Lang.Class({
|
||||
this._currentDialog.destroySession();
|
||||
this._currentDialog = null;
|
||||
|
||||
if (this._sessionUpdatedId)
|
||||
Main.sessionMode.disconnect(this._sessionUpdatedId);
|
||||
this._sessionUpdatedId = 0;
|
||||
|
||||
this._native.complete(dismissed);
|
||||
},
|
||||
});
|
||||
|
@@ -153,8 +153,10 @@ var WorldClocksSection = new Lang.Class({
|
||||
for (let i = 0; i < this._locations.length; i++) {
|
||||
let l = this._locations[i].location;
|
||||
|
||||
let name = l.get_level() == GWeather.LocationLevel.NAMED_TIMEZONE ? l.get_name()
|
||||
: l.get_city_name();
|
||||
let label = new St.Label({ style_class: 'world-clocks-city',
|
||||
text: l.get_city_name(),
|
||||
text: name,
|
||||
x_align: Clutter.ActorAlign.START,
|
||||
x_expand: true });
|
||||
|
||||
|
@@ -1,6 +1,5 @@
|
||||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
|
||||
const FocusCaretTracker = imports.ui.focusCaretTracker;
|
||||
const Atspi = imports.gi.Atspi;
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gdk = imports.gi.Gdk;
|
||||
@@ -13,6 +12,7 @@ const Signals = imports.signals;
|
||||
const St = imports.gi.St;
|
||||
const InputSourceManager = imports.ui.status.keyboard;
|
||||
|
||||
const IBusManager = imports.misc.ibusManager;
|
||||
const BoxPointer = imports.ui.boxpointer;
|
||||
const Layout = imports.ui.layout;
|
||||
const Main = imports.ui.main;
|
||||
@@ -261,6 +261,7 @@ var Key = new Lang.Class({
|
||||
this._extended_keyboard = null;
|
||||
this._pressTimeoutId = 0;
|
||||
this._capturedPress = false;
|
||||
|
||||
this._capturedEventId = 0;
|
||||
this._unmapId = 0;
|
||||
this._longPress = false;
|
||||
@@ -484,6 +485,71 @@ var KeyboardModel = new Lang.Class({
|
||||
}
|
||||
});
|
||||
|
||||
var FocusTracker = new Lang.Class({
|
||||
Name: 'FocusTracker',
|
||||
|
||||
_init() {
|
||||
this._currentWindow = null;
|
||||
this._currentWindowPositionId = 0;
|
||||
|
||||
global.screen.get_display().connect('notify::focus-window', () => {
|
||||
this._setCurrentWindow(global.screen.get_display().focus_window);
|
||||
this.emit('window-changed', this._currentWindow);
|
||||
});
|
||||
|
||||
/* Valid for wayland clients */
|
||||
Main.inputMethod.connect('cursor-location-changed', (o, rect) => {
|
||||
let newRect = { x: rect.get_x(), y: rect.get_y(), width: rect.get_width(), height: rect.get_height() };
|
||||
this._setCurrentRect(newRect);
|
||||
});
|
||||
|
||||
this._ibusManager = IBusManager.getIBusManager();
|
||||
this._ibusManager.connect('set-cursor-location', (manager, rect) => {
|
||||
/* Valid for X11 clients only */
|
||||
if (Main.inputMethod.currentFocus)
|
||||
return;
|
||||
|
||||
this._setCurrentRect(rect);
|
||||
});
|
||||
},
|
||||
|
||||
get currentWindow() {
|
||||
return this._currentWindow;
|
||||
},
|
||||
|
||||
_setCurrentWindow(window) {
|
||||
if (this._currentWindow)
|
||||
this._currentWindow.disconnect(this._currentWindowPositionId);
|
||||
|
||||
this._currentWindow = window;
|
||||
if (window) {
|
||||
this._currentWindowPositionId = this._currentWindow.connect('position-changed', () => {
|
||||
if (global.display.get_grab_op() == Meta.GrabOp.NONE)
|
||||
this.emit('position-changed');
|
||||
else
|
||||
this.emit('reset');
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
_setCurrentRect(rect) {
|
||||
let frameRect = this._currentWindow.get_frame_rect();
|
||||
rect.x -= frameRect.x;
|
||||
rect.y -= frameRect.y;
|
||||
|
||||
this._rect = rect;
|
||||
this.emit('position-changed');
|
||||
},
|
||||
|
||||
getCurrentRect() {
|
||||
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;
|
||||
}
|
||||
});
|
||||
Signals.addSignalMethods(FocusTracker.prototype);
|
||||
|
||||
var Keyboard = new Lang.Class({
|
||||
Name: 'Keyboard',
|
||||
|
||||
@@ -491,15 +557,10 @@ var Keyboard = new Lang.Class({
|
||||
this.actor = null;
|
||||
this._focusInExtendedKeys = false;
|
||||
|
||||
this._focusCaretTracker = new FocusCaretTracker.FocusCaretTracker();
|
||||
this._focusCaretTracker.connect('focus-changed', this._onFocusChanged.bind(this));
|
||||
this._focusCaretTracker.connect('caret-moved', this._onCaretMoved.bind(this));
|
||||
this._languagePopup = null;
|
||||
this._currentAccessible = null;
|
||||
this._caretTrackingEnabled = false;
|
||||
this._updateCaretPositionId = 0;
|
||||
this._currentFocusWindow = null;
|
||||
this._originalWindowY = null;
|
||||
this._animFocusedWindow = null;
|
||||
this._delayedAnimFocusWindow = null;
|
||||
|
||||
this._enableKeyboard = false; // a11y settings value
|
||||
this._enabled = false; // enabled state (by setting or device type)
|
||||
@@ -510,6 +571,14 @@ var Keyboard = new Lang.Class({
|
||||
this._lastDeviceId = null;
|
||||
this._suggestions = null;
|
||||
|
||||
this._focusTracker = new FocusTracker();
|
||||
this._focusTracker.connect('position-changed', this._onFocusPositionChanged.bind(this));
|
||||
this._focusTracker.connect('reset', () => {
|
||||
this._delayedAnimFocusWindow = null;
|
||||
this._animFocusedWindow = null;
|
||||
this._oskFocusWindow = null;
|
||||
});
|
||||
|
||||
Meta.get_backend().connect('last-device-changed',
|
||||
(backend, deviceId) => {
|
||||
let manager = Clutter.DeviceManager.get_default();
|
||||
@@ -532,102 +601,15 @@ var Keyboard = new Lang.Class({
|
||||
this._keyboardRestingId = 0;
|
||||
|
||||
Main.layoutManager.connect('monitors-changed', this._relayout.bind(this));
|
||||
//Main.inputMethod.connect('cursor-location-changed', (o, rect) => {
|
||||
// if (this._keyboardVisible) {
|
||||
// let currentWindow = global.screen.get_display().focus_window;
|
||||
// this.setCursorLocation(currentWindow, rect.get_x(), rect.get_y(),
|
||||
// rect.get_width(), rect.get_height());
|
||||
// }
|
||||
//});
|
||||
},
|
||||
|
||||
get visible() {
|
||||
return this._keyboardVisible;
|
||||
},
|
||||
|
||||
_setCaretTrackerEnabled(enabled) {
|
||||
if (this._caretTrackingEnabled == enabled)
|
||||
return;
|
||||
|
||||
this._caretTrackingEnabled = enabled;
|
||||
|
||||
if (enabled) {
|
||||
this._focusCaretTracker.registerFocusListener();
|
||||
this._focusCaretTracker.registerCaretListener();
|
||||
} else {
|
||||
this._focusCaretTracker.deregisterFocusListener();
|
||||
this._focusCaretTracker.deregisterCaretListener();
|
||||
}
|
||||
},
|
||||
|
||||
_updateCaretPosition(accessible) {
|
||||
if (this._updateCaretPositionId)
|
||||
GLib.source_remove(this._updateCaretPositionId);
|
||||
if (!this._keyboardRequested)
|
||||
return;
|
||||
this._updateCaretPositionId = GLib.idle_add(GLib.PRIORITY_DEFAULT_IDLE, () => {
|
||||
this._updateCaretPositionId = 0;
|
||||
|
||||
let currentWindow = global.screen.get_display().focus_window;
|
||||
if (!currentWindow) {
|
||||
this.setCursorLocation(null);
|
||||
return GLib.SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
let windowRect = currentWindow.get_frame_rect();
|
||||
let text = accessible.get_text_iface();
|
||||
let component = accessible.get_component_iface();
|
||||
|
||||
try {
|
||||
let caretOffset = text.get_caret_offset();
|
||||
let caretRect = text.get_character_extents(caretOffset, Atspi.CoordType.WINDOW);
|
||||
let focusRect = component.get_extents(Atspi.CoordType.WINDOW);
|
||||
|
||||
if (caretRect.width == 0 && caretRect.height == 0)
|
||||
caretRect = focusRect;
|
||||
|
||||
this.setCursorLocation(currentWindow, caretRect.x, caretRect.y, caretRect.width, caretRect.height);
|
||||
} catch (e) {
|
||||
log('Error updating caret position for OSK: ' + e.message);
|
||||
}
|
||||
|
||||
return GLib.SOURCE_REMOVE;
|
||||
});
|
||||
|
||||
GLib.Source.set_name_by_id(this._updateCaretPositionId, '[gnome-shell] this._updateCaretPosition');
|
||||
},
|
||||
|
||||
_focusIsTextEntry(accessible) {
|
||||
try {
|
||||
let role = accessible.get_role();
|
||||
let stateSet = accessible.get_state_set();
|
||||
return stateSet.contains(Atspi.StateType.EDITABLE) || role == Atspi.Role.TERMINAL;
|
||||
} catch (e) {
|
||||
log('Error determining accessible role: ' + e.message);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
_onFocusChanged(caretTracker, event) {
|
||||
let accessible = event.source;
|
||||
if (!this._focusIsTextEntry(accessible))
|
||||
return;
|
||||
|
||||
let focused = event.detail1 != 0;
|
||||
if (focused) {
|
||||
this._currentAccessible = accessible;
|
||||
this._updateCaretPosition(accessible);
|
||||
this.show(Main.layoutManager.focusIndex);
|
||||
} else if (this._currentAccessible == accessible) {
|
||||
this._currentAccessible = null;
|
||||
this.hide();
|
||||
}
|
||||
},
|
||||
|
||||
_onCaretMoved(caretTracker, event) {
|
||||
let accessible = event.source;
|
||||
if (this._currentAccessible == accessible)
|
||||
this._updateCaretPosition(accessible);
|
||||
_onFocusPositionChanged(focusTracker) {
|
||||
let rect = focusTracker.getCurrentRect();
|
||||
this.setCursorLocation(focusTracker.currentWindow, rect.x, rect.y, rect.width, rect.height);
|
||||
},
|
||||
|
||||
_lastDeviceIsTouchscreen() {
|
||||
@@ -650,8 +632,6 @@ var Keyboard = new Lang.Class({
|
||||
if (!this._enabled && !this._keyboardController)
|
||||
return;
|
||||
|
||||
this._setCaretTrackerEnabled(this._enabled);
|
||||
|
||||
if (this._enabled && !this._keyboardController)
|
||||
this._setupKeyboard();
|
||||
else if (!this._enabled)
|
||||
@@ -1027,11 +1007,14 @@ var Keyboard = new Lang.Class({
|
||||
if (!this._keyboardRequested)
|
||||
return;
|
||||
|
||||
if (this._currentAccessible)
|
||||
this._updateCaretPosition(this._currentAccessible);
|
||||
Main.layoutManager.keyboardIndex = monitor;
|
||||
this._relayout();
|
||||
Main.layoutManager.showKeyboard();
|
||||
|
||||
if (this._delayedAnimFocusWindow) {
|
||||
this._setAnimationWindow(this._delayedAnimFocusWindow);
|
||||
this._delayedAnimFocusWindow = null;
|
||||
}
|
||||
},
|
||||
|
||||
hide() {
|
||||
@@ -1102,8 +1085,9 @@ var Keyboard = new Lang.Class({
|
||||
window.move_frame(true, frameRect.x, frameRect.y);
|
||||
},
|
||||
|
||||
_animateWindow(window, show, deltaY) {
|
||||
_animateWindow(window, show) {
|
||||
let windowActor = window.get_compositor_private();
|
||||
let deltaY = Main.layoutManager.keyboardBox.height;
|
||||
if (!windowActor)
|
||||
return;
|
||||
|
||||
@@ -1124,35 +1108,39 @@ var Keyboard = new Lang.Class({
|
||||
}
|
||||
},
|
||||
|
||||
setCursorLocation(window, x, y , w, h) {
|
||||
if (window == this._oskFocusWindow)
|
||||
_setAnimationWindow(window) {
|
||||
if (this._animFocusedWindow == window)
|
||||
return;
|
||||
|
||||
if (this._oskFocusWindow) {
|
||||
let display = global.screen.get_display();
|
||||
if (this._animFocusedWindow)
|
||||
this._animateWindow(this._animFocusedWindow, false);
|
||||
if (window)
|
||||
this._animateWindow(window, true);
|
||||
|
||||
if (display.get_grab_op() == Meta.GrabOp.NONE ||
|
||||
display.get_focus_window() != this._oskFocusWindow)
|
||||
this._animateWindow(this._oskFocusWindow, false, this._oskFocusWindowDelta);
|
||||
this._animFocusedWindow = window;
|
||||
},
|
||||
|
||||
this._oskFocusWindow = null;
|
||||
this._oskFocusWindowDelta = null;
|
||||
}
|
||||
setCursorLocation(window, x, y , w, h) {
|
||||
let monitor = Main.layoutManager.keyboardMonitor;
|
||||
|
||||
if (window) {
|
||||
let monitor = Main.layoutManager.keyboardMonitor;
|
||||
if (window && monitor) {
|
||||
let keyboardHeight = Main.layoutManager.keyboardBox.height;
|
||||
let frameRect = window.get_frame_rect();
|
||||
let windowActor = window.get_compositor_private();
|
||||
let delta = 0;
|
||||
let focusObscured = false;
|
||||
|
||||
if (frameRect.y + y + h >= monitor.height - keyboardHeight)
|
||||
delta = keyboardHeight;
|
||||
|
||||
this._animateWindow(window, true, delta);
|
||||
this._oskFocusWindow = window;
|
||||
this._oskFocusWindowDelta = delta;
|
||||
if (y + h >= monitor.y + monitor.height - keyboardHeight) {
|
||||
if (this._keyboardVisible)
|
||||
this._setAnimationWindow(window);
|
||||
else
|
||||
this._delayedAnimFocusWindow = window;
|
||||
} else if (y < keyboardHeight) {
|
||||
this._delayedAnimFocusWindow = null;
|
||||
this._setAnimationWindow(null);
|
||||
}
|
||||
} else {
|
||||
this._setAnimationWindow(null);
|
||||
}
|
||||
|
||||
this._oskFocusWindow = window;
|
||||
},
|
||||
});
|
||||
|
||||
|
@@ -19,7 +19,6 @@ const MagnifierDBus = imports.ui.magnifierDBus;
|
||||
const Params = imports.misc.params;
|
||||
const PointerWatcher = imports.ui.pointerWatcher;
|
||||
|
||||
var MOUSE_POLL_FREQUENCY = 50;
|
||||
var CROSSHAIRS_CLIP_SIZE = [100, 100];
|
||||
var NO_CHANGE = 0.0;
|
||||
|
||||
@@ -152,8 +151,10 @@ var Magnifier = new Lang.Class({
|
||||
* Turn on mouse tracking, if not already doing so.
|
||||
*/
|
||||
startTrackingMouse() {
|
||||
if (!this._pointerWatch)
|
||||
this._pointerWatch = PointerWatcher.getPointerWatcher().addWatch(MOUSE_POLL_FREQUENCY, this.scrollToMousePos.bind(this));
|
||||
if (!this._pointerWatch) {
|
||||
let interval = 1000 / Clutter.get_default_frame_rate();
|
||||
this._pointerWatch = PointerWatcher.getPointerWatcher().addWatch(interval, this.scrollToMousePos.bind(this));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
@@ -207,7 +207,13 @@ function _initializeUI() {
|
||||
return true;
|
||||
});
|
||||
|
||||
global.display.connect('gl-video-memory-purged', loadTheme);
|
||||
global.display.connect('gl-video-memory-purged', () => {
|
||||
let cache = St.TextureCache.get_default();
|
||||
|
||||
cache.clear();
|
||||
|
||||
loadTheme();
|
||||
});
|
||||
|
||||
// Provide the bus object for gnome-session to
|
||||
// initiate logouts.
|
||||
@@ -256,6 +262,14 @@ function _getStylesheet(name) {
|
||||
if (stylesheet.query_exists(null))
|
||||
return stylesheet;
|
||||
|
||||
let dataDirs = GLib.get_system_data_dirs();
|
||||
for (let i = 0; i < dataDirs.length; i++) {
|
||||
let path = GLib.build_filenamev([dataDirs[i], 'gnome-shell', 'theme', name]);
|
||||
let stylesheet = Gio.file_new_for_path(path);
|
||||
if (stylesheet.query_exists(null))
|
||||
return stylesheet;
|
||||
}
|
||||
|
||||
stylesheet = Gio.File.new_for_path(global.datadir + '/theme/' + name);
|
||||
if (stylesheet.query_exists(null))
|
||||
return stylesheet;
|
||||
|
@@ -100,21 +100,8 @@ var ModalDialog = new Lang.Class({
|
||||
setButtons(buttons) {
|
||||
this.clearButtons();
|
||||
|
||||
for (let i = 0; i < buttons.length; i++) {
|
||||
let buttonInfo = buttons[i];
|
||||
|
||||
let x_alignment;
|
||||
if (buttons.length == 1)
|
||||
x_alignment = St.Align.END;
|
||||
else if (i == 0)
|
||||
x_alignment = St.Align.START;
|
||||
else if (i == buttons.length - 1)
|
||||
x_alignment = St.Align.END;
|
||||
else
|
||||
x_alignment = St.Align.MIDDLE;
|
||||
|
||||
for (let buttonInfo of buttons)
|
||||
this.addButton(buttonInfo);
|
||||
}
|
||||
},
|
||||
|
||||
addButton(buttonInfo) {
|
||||
|
@@ -204,7 +204,7 @@ var OsdWindow = new Lang.Class({
|
||||
|
||||
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
|
||||
this._icon.icon_size = popupSize / (2 * scaleFactor);
|
||||
this._box.translation_y = monitor.height / 4;
|
||||
this._box.translation_y = Math.round(monitor.height / 4);
|
||||
this._boxConstraint.minSize = popupSize;
|
||||
}
|
||||
});
|
||||
|
@@ -488,7 +488,8 @@ var Overview = new Lang.Class({
|
||||
return false;
|
||||
if (this._inItemDrag || this._inWindowDrag)
|
||||
return false;
|
||||
if (this._activationTime == 0 || Date.now() / 1000 - this._activationTime > OVERVIEW_ACTIVATION_TIMEOUT)
|
||||
if (this._activationTime == 0 ||
|
||||
GLib.get_monotonic_time() / GLib.USEC_PER_SEC - this._activationTime > OVERVIEW_ACTIVATION_TIMEOUT)
|
||||
return true;
|
||||
return false;
|
||||
},
|
||||
@@ -547,7 +548,7 @@ var Overview = new Lang.Class({
|
||||
this.visible = true;
|
||||
this.animationInProgress = true;
|
||||
this.visibleTarget = true;
|
||||
this._activationTime = Date.now() / 1000;
|
||||
this._activationTime = GLib.get_monotonic_time() / GLib.USEC_PER_SEC;
|
||||
|
||||
Meta.disable_unredirect_for_screen(global.screen);
|
||||
this.viewSelector.show();
|
||||
|
@@ -709,6 +709,7 @@ var AggregateMenu = new Lang.Class({
|
||||
this._bluetooth = null;
|
||||
}
|
||||
|
||||
this._remoteAccess = new imports.ui.status.remoteAccess.RemoteAccessApplet();
|
||||
this._power = new imports.ui.status.power.Indicator();
|
||||
this._rfkill = new imports.ui.status.rfkill.Indicator();
|
||||
this._volume = new imports.ui.status.volume.Indicator();
|
||||
@@ -729,6 +730,7 @@ var AggregateMenu = new Lang.Class({
|
||||
if (this._bluetooth) {
|
||||
this._indicators.add_child(this._bluetooth.indicators);
|
||||
}
|
||||
this._indicators.add_child(this._remoteAccess.indicators);
|
||||
this._indicators.add_child(this._rfkill.indicators);
|
||||
this._indicators.add_child(this._volume.indicators);
|
||||
this._indicators.add_child(this._power.indicators);
|
||||
@@ -743,6 +745,7 @@ var AggregateMenu = new Lang.Class({
|
||||
if (this._bluetooth) {
|
||||
this.menu.addMenuItem(this._bluetooth.menu);
|
||||
}
|
||||
this.menu.addMenuItem(this._remoteAccess.menu);
|
||||
this.menu.addMenuItem(this._location.menu);
|
||||
this.menu.addMenuItem(this._rfkill.menu);
|
||||
this.menu.addMenuItem(this._power.menu);
|
||||
|
@@ -394,8 +394,9 @@ var PopupImageMenuItem = new Lang.Class({
|
||||
_init(text, icon, params) {
|
||||
this.parent(params);
|
||||
|
||||
this._icon = new St.Icon({ style_class: 'popup-menu-icon' });
|
||||
this.actor.add_child(this._icon, { align: St.Align.END });
|
||||
this._icon = new St.Icon({ style_class: 'popup-menu-icon',
|
||||
x_align: Clutter.ActorAlign.END });
|
||||
this.actor.add_child(this._icon);
|
||||
this.label = new St.Label({ text: text });
|
||||
this.actor.add_child(this.label);
|
||||
this.actor.label_actor = this.label;
|
||||
|
@@ -295,7 +295,7 @@ var RemoteSearchProvider = new Lang.Class({
|
||||
name: metas[i]['name'],
|
||||
description: metas[i]['description'],
|
||||
createIcon: size => {
|
||||
this.createIcon(size, metas[i]);
|
||||
return this.createIcon(size, metas[i]);
|
||||
},
|
||||
clipboardText: metas[i]['clipboardText'] });
|
||||
}
|
||||
|
@@ -55,11 +55,11 @@ var EntryMenu = new Lang.Class({
|
||||
|
||||
if (v) {
|
||||
this._makePasswordItem();
|
||||
this._entry.input_purpose = Gtk.InputPurpose.PASSWORD;
|
||||
this._entry.input_purpose = Clutter.InputContentPurpose.PASSWORD;
|
||||
} else {
|
||||
this._passwordItem.destroy();
|
||||
this._passwordItem = null;
|
||||
this._entry.input_purpose = Gtk.InputPurpose.FREE_FORM;
|
||||
this._entry.input_purpose = Clutter.InputContentPurpose.NORMAL;
|
||||
}
|
||||
},
|
||||
|
||||
|
@@ -1944,6 +1944,7 @@ var NMApplet = new Lang.Class({
|
||||
this.indicators.visible = this._client.nm_running;
|
||||
this.menu.actor.visible = this._client.networking_enabled;
|
||||
|
||||
this._updateIcon();
|
||||
this._syncConnectivity();
|
||||
},
|
||||
|
||||
|
81
js/ui/status/remoteAccess.js
Normal file
81
js/ui/status/remoteAccess.js
Normal file
@@ -0,0 +1,81 @@
|
||||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
|
||||
const Lang = imports.lang;
|
||||
const Meta = imports.gi.Meta;
|
||||
|
||||
const PanelMenu = imports.ui.panelMenu;
|
||||
const PopupMenu = imports.ui.popupMenu;
|
||||
|
||||
var RemoteAccessApplet = new Lang.Class({
|
||||
Name: 'RemoteAccessApplet',
|
||||
Extends: PanelMenu.SystemIndicator,
|
||||
|
||||
_init() {
|
||||
this.parent();
|
||||
|
||||
let backend = Meta.get_backend();
|
||||
let controller = backend.get_remote_access_controller();
|
||||
|
||||
if (!controller)
|
||||
return;
|
||||
|
||||
// We can't possibly know about all types of screen sharing on X11, so
|
||||
// showing these controls on X11 might give a false sense of security.
|
||||
// Thus, only enable these controls when using Wayland, where we are
|
||||
// in control of sharing.
|
||||
if (!Meta.is_wayland_compositor())
|
||||
return;
|
||||
|
||||
this._handles = new Set();
|
||||
this._indicator = null;
|
||||
this._menuSection = null;
|
||||
|
||||
controller.connect('new-handle', (controller, handle) => {
|
||||
this._onNewHandle(handle);
|
||||
});
|
||||
},
|
||||
|
||||
_ensureControls() {
|
||||
if (this._indicator)
|
||||
return;
|
||||
|
||||
this._indicator = this._addIndicator();
|
||||
this._indicator.icon_name = 'screen-shared-symbolic';
|
||||
this._indicator.add_style_class_name('remote-access-indicator');
|
||||
this._item =
|
||||
new PopupMenu.PopupSubMenuMenuItem(_("Screen is Being Shared"),
|
||||
true);
|
||||
this._item.menu.addAction(_("Turn off"),
|
||||
() => {
|
||||
for (let handle of this._handles)
|
||||
handle.stop();
|
||||
});
|
||||
this._item.icon.icon_name = 'screen-shared-symbolic';
|
||||
this.menu.addMenuItem(this._item);
|
||||
},
|
||||
|
||||
_sync() {
|
||||
if (this._handles.size == 0) {
|
||||
this._indicator.visible = false;
|
||||
this._item.actor.visible = false;
|
||||
} else {
|
||||
this._indicator.visible = true;
|
||||
this._item.actor.visible = true;
|
||||
}
|
||||
},
|
||||
|
||||
_onStopped(handle) {
|
||||
this._handles.delete(handle);
|
||||
this._sync();
|
||||
},
|
||||
|
||||
_onNewHandle(handle) {
|
||||
this._handles.add(handle);
|
||||
handle.connect('stopped', this._onStopped.bind(this));
|
||||
|
||||
if (this._handles.size == 1) {
|
||||
this._ensureControls();
|
||||
this._sync();
|
||||
}
|
||||
},
|
||||
});
|
@@ -24,7 +24,7 @@ const EdgeDragAction = imports.ui.edgeDragAction;
|
||||
const CloseDialog = imports.ui.closeDialog;
|
||||
const SwitchMonitor = imports.ui.switchMonitor;
|
||||
|
||||
const SHELL_KEYBINDINGS_SCHEMA = 'org.gnome.shell.keybindings';
|
||||
var SHELL_KEYBINDINGS_SCHEMA = 'org.gnome.shell.keybindings';
|
||||
var MINIMIZE_WINDOW_ANIMATION_TIME = 0.2;
|
||||
var SHOW_WINDOW_ANIMATION_TIME = 0.15;
|
||||
var DIALOG_SHOW_WINDOW_ANIMATION_TIME = 0.1;
|
||||
|
@@ -660,7 +660,6 @@ var WindowOverlay = new Lang.Class({
|
||||
if (this._hidden)
|
||||
return;
|
||||
|
||||
this._windowClone.actor.grab_key_focus();
|
||||
this._animateVisible();
|
||||
this.emit('show-close-button');
|
||||
},
|
||||
@@ -1432,34 +1431,26 @@ var Workspace = new Lang.Class({
|
||||
_doRemoveWindow(metaWin) {
|
||||
let win = metaWin.get_compositor_private();
|
||||
|
||||
// find the position of the window in our list
|
||||
let index = this._lookupIndex (metaWin);
|
||||
let clone = this._removeWindowClone(metaWin);
|
||||
|
||||
if (index == -1)
|
||||
return;
|
||||
|
||||
let clone = this._windows[index];
|
||||
|
||||
this._windows.splice(index, 1);
|
||||
this._windowOverlays.splice(index, 1);
|
||||
|
||||
// If metaWin.get_compositor_private() returned non-NULL, that
|
||||
// means the window still exists (and is just being moved to
|
||||
// another workspace or something), so set its overviewHint
|
||||
// accordingly. (If it returned NULL, then the window is being
|
||||
// destroyed; we'd like to animate this, but it's too late at
|
||||
// this point.)
|
||||
if (win) {
|
||||
let [stageX, stageY] = clone.actor.get_transformed_position();
|
||||
let [stageWidth, stageHeight] = clone.actor.get_transformed_size();
|
||||
win._overviewHint = {
|
||||
x: stageX,
|
||||
y: stageY,
|
||||
scale: stageWidth / clone.actor.width
|
||||
};
|
||||
if (clone) {
|
||||
// If metaWin.get_compositor_private() returned non-NULL, that
|
||||
// means the window still exists (and is just being moved to
|
||||
// another workspace or something), so set its overviewHint
|
||||
// accordingly. (If it returned NULL, then the window is being
|
||||
// destroyed; we'd like to animate this, but it's too late at
|
||||
// this point.)
|
||||
if (win) {
|
||||
let [stageX, stageY] = clone.actor.get_transformed_position();
|
||||
let [stageWidth, stageHeight] = clone.actor.get_transformed_size();
|
||||
win._overviewHint = {
|
||||
x: stageX,
|
||||
y: stageY,
|
||||
scale: stageWidth / clone.actor.width
|
||||
};
|
||||
}
|
||||
clone.destroy();
|
||||
}
|
||||
clone.destroy();
|
||||
|
||||
|
||||
// We need to reposition the windows; to avoid shuffling windows
|
||||
// around while the user is interacting with the workspace, we delay
|
||||
@@ -1849,10 +1840,18 @@ var Workspace = new Lang.Class({
|
||||
clone.connect('size-changed', () => {
|
||||
this._recalculateWindowPositions(WindowPositionFlags.NONE);
|
||||
});
|
||||
clone.actor.connect('destroy', () => {
|
||||
this._removeWindowClone(clone.metaWindow);
|
||||
});
|
||||
|
||||
this.actor.add_actor(clone.actor);
|
||||
|
||||
overlay.connect('show-close-button', this._onShowOverlayClose.bind(this));
|
||||
overlay.connect('show-close-button', () => {
|
||||
let focus = global.stage.key_focus;
|
||||
if (focus == null || this.actor.contains(focus))
|
||||
clone.actor.grab_key_focus();
|
||||
this._onShowOverlayClose(overlay);
|
||||
});
|
||||
|
||||
if (this._windows.length == 0)
|
||||
clone.setStackAbove(null);
|
||||
@@ -1865,6 +1864,17 @@ var Workspace = new Lang.Class({
|
||||
return [clone, overlay];
|
||||
},
|
||||
|
||||
_removeWindowClone(metaWin) {
|
||||
// find the position of the window in our list
|
||||
let index = this._lookupIndex (metaWin);
|
||||
|
||||
if (index == -1)
|
||||
return null;
|
||||
|
||||
this._windowOverlays.splice(index, 1);
|
||||
return this._windows.splice(index, 1).pop();
|
||||
},
|
||||
|
||||
_onShowOverlayClose(windowOverlay) {
|
||||
for (let i = 0; i < this._windowOverlays.length; i++) {
|
||||
let overlay = this._windowOverlays[i];
|
||||
|
@@ -31,7 +31,7 @@ var WORKSPACE_CUT_SIZE = 10;
|
||||
|
||||
var WORKSPACE_KEEP_ALIVE_TIME = 100;
|
||||
|
||||
const OVERRIDE_SCHEMA = 'org.gnome.shell.overrides';
|
||||
var OVERRIDE_SCHEMA = 'org.gnome.shell.overrides';
|
||||
|
||||
/* A layout manager that requests size only for primary_actor, but then allocates
|
||||
all using a fixed layout */
|
||||
@@ -241,7 +241,7 @@ var WindowClone = new Lang.Class({
|
||||
Signals.addSignalMethods(WindowClone.prototype);
|
||||
|
||||
|
||||
const ThumbnailState = {
|
||||
var ThumbnailState = {
|
||||
NEW : 0,
|
||||
ANIMATING_IN : 1,
|
||||
NORMAL: 2,
|
||||
@@ -275,8 +275,8 @@ var WorkspaceThumbnail = new Lang.Class({
|
||||
|
||||
this._createBackground();
|
||||
|
||||
let monitor = Main.layoutManager.primaryMonitor;
|
||||
this.setPorthole(monitor.x, monitor.y, monitor.width, monitor.height);
|
||||
let workArea = Main.layoutManager.getWorkAreaForMonitor(this.monitorIndex);
|
||||
this.setPorthole(workArea.x, workArea.y, workArea.width, workArea.height);
|
||||
|
||||
let windows = global.get_window_actors().filter(actor => {
|
||||
let win = actor.meta_window;
|
||||
@@ -321,8 +321,6 @@ var WorkspaceThumbnail = new Lang.Class({
|
||||
},
|
||||
|
||||
setPorthole(x, y, width, height) {
|
||||
this._portholeX = x;
|
||||
this._portholeY = y;
|
||||
this.actor.set_size(width, height);
|
||||
this._contents.set_position(-x, -y);
|
||||
},
|
||||
@@ -374,18 +372,9 @@ var WorkspaceThumbnail = new Lang.Class({
|
||||
},
|
||||
|
||||
_doRemoveWindow(metaWin) {
|
||||
let win = metaWin.get_compositor_private();
|
||||
|
||||
// find the position of the window in our list
|
||||
let index = this._lookupIndex (metaWin);
|
||||
|
||||
if (index == -1)
|
||||
return;
|
||||
|
||||
let clone = this._windows[index];
|
||||
this._windows.splice(index, 1);
|
||||
|
||||
clone.destroy();
|
||||
let clone = this._removeWindowClone(metaWin);
|
||||
if (clone)
|
||||
clone.destroy();
|
||||
},
|
||||
|
||||
_doAddWindow(metaWin) {
|
||||
@@ -537,6 +526,9 @@ var WorkspaceThumbnail = new Lang.Class({
|
||||
clone.connect('drag-end', () => {
|
||||
Main.overview.endWindowDrag(clone.metaWindow);
|
||||
});
|
||||
clone.actor.connect('destroy', () => {
|
||||
this._removeWindowClone(clone.metaWindow);
|
||||
});
|
||||
this._contents.add_actor(clone.actor);
|
||||
|
||||
if (this._windows.length == 0)
|
||||
@@ -549,6 +541,16 @@ var WorkspaceThumbnail = new Lang.Class({
|
||||
return clone;
|
||||
},
|
||||
|
||||
_removeWindowClone(metaWin) {
|
||||
// find the position of the window in our list
|
||||
let index = this._lookupIndex (metaWin);
|
||||
|
||||
if (index == -1)
|
||||
return null;
|
||||
|
||||
return this._windows.splice(index, 1).pop();
|
||||
},
|
||||
|
||||
activate(time) {
|
||||
if (this.state > ThumbnailState.NORMAL)
|
||||
return;
|
||||
@@ -675,11 +677,7 @@ var ThumbnailsBox = new Lang.Class({
|
||||
this._settings.connect('changed::dynamic-workspaces',
|
||||
this._updateSwitcherVisibility.bind(this));
|
||||
|
||||
Main.layoutManager.connect('monitors-changed', () => {
|
||||
this._destroyThumbnails();
|
||||
if (Main.overview.visible)
|
||||
this._createThumbnails();
|
||||
});
|
||||
Main.layoutManager.connect('monitors-changed', this._rebuildThumbnails.bind(this));
|
||||
},
|
||||
|
||||
_updateSwitcherVisibility() {
|
||||
@@ -872,6 +870,9 @@ var ThumbnailsBox = new Lang.Class({
|
||||
Main.overview.connect('windows-restacked',
|
||||
this._syncStacking.bind(this));
|
||||
|
||||
this._workareasChangedId =
|
||||
global.screen.connect('workareas-changed', this._rebuildThumbnails.bind(this));
|
||||
|
||||
this._targetScale = 0;
|
||||
this._scale = 0;
|
||||
this._pendingScaleUpdate = false;
|
||||
@@ -901,12 +902,24 @@ var ThumbnailsBox = new Lang.Class({
|
||||
this._syncStackingId = 0;
|
||||
}
|
||||
|
||||
if (this._workareasChangedId > 0) {
|
||||
global.screen.disconnect(this._workareasChangedId);
|
||||
this._workareasChangedId = 0;
|
||||
}
|
||||
|
||||
for (let w = 0; w < this._thumbnails.length; w++)
|
||||
this._thumbnails[w].destroy();
|
||||
this._thumbnails = [];
|
||||
this._porthole = null;
|
||||
},
|
||||
|
||||
_rebuildThumbnails() {
|
||||
this._destroyThumbnails();
|
||||
|
||||
if (Main.overview.visible)
|
||||
this._createThumbnails();
|
||||
},
|
||||
|
||||
_workspacesChanged() {
|
||||
let validThumbnails =
|
||||
this._thumbnails.filter(t => t.state <= ThumbnailState.NORMAL);
|
||||
@@ -1159,7 +1172,7 @@ var ThumbnailsBox = new Lang.Class({
|
||||
// The "porthole" is the portion of the screen that we show in the
|
||||
// workspaces
|
||||
_ensurePorthole() {
|
||||
if (!Main.layoutManager.primaryMonitor)
|
||||
if (!Main.layoutManager.primaryMonitor || !Main.overview.visible)
|
||||
return false;
|
||||
|
||||
if (!this._porthole)
|
||||
|
@@ -1,5 +1,5 @@
|
||||
project('gnome-shell', 'c',
|
||||
version: '3.28.0',
|
||||
version: '3.28.3',
|
||||
meson_version: '>= 0.42.0',
|
||||
license: 'GPLv2+'
|
||||
)
|
||||
@@ -18,7 +18,7 @@ ecal_req = '>= 3.5.3'
|
||||
eds_req = '>= 3.17.2'
|
||||
gcr_req = '>= 3.7.5'
|
||||
gdesktop_req = '>= 3.7.90'
|
||||
gio_req = '>= 2.53.0'
|
||||
gio_req = '>= 2.56.0'
|
||||
gi_req = '>= 1.49.1'
|
||||
gjs_req = '>= 1.47.0'
|
||||
gtk_req = '>= 3.15.0'
|
||||
@@ -189,3 +189,5 @@ subdir('tests')
|
||||
if get_option('gtk_doc')
|
||||
subdir('docs/reference')
|
||||
endif
|
||||
|
||||
meson.add_install_script('meson/meson-postinstall.sh')
|
||||
|
10
meson/meson-postinstall.sh
Executable file
10
meson/meson-postinstall.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Package managers set this so we don't need to run
|
||||
if [ -z "$DESTDIR" ]; then
|
||||
echo Compiling GSettings schemas...
|
||||
glib-compile-schemas ${MESON_INSTALL_PREFIX}/share/glib-2.0/schemas
|
||||
|
||||
echo Updating desktop database...
|
||||
update-desktop-database -q ${MESON_INSTALL_PREFIX}/share/applications
|
||||
fi
|
36
po/nl.po
36
po/nl.po
@@ -8,22 +8,22 @@
|
||||
# Wouter Bolsterlee <wbolster@gnome.org>, 2011–2014.
|
||||
# Erwin Poeze <donnut@outlook.com>, 2013.
|
||||
# Nathan Follens <nthn@unseen.is>, 2015-2018.
|
||||
# Hannie Dumoleyn <hannie@ubuntu-nl.org>, 2015, 2017.
|
||||
# Hannie Dumoleyn <hannie@ubuntu-nl.org>, 2015, 2017, 2018.
|
||||
# Justin van Steijn <jvs@fsfe.org>, 2016, 2018.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: gnome-shell\n"
|
||||
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gnome-shell/issues\n"
|
||||
"POT-Creation-Date: 2018-02-21 14:13+0000\n"
|
||||
"PO-Revision-Date: 2018-02-21 22:05+0100\n"
|
||||
"Last-Translator: Justin van Steijn <jvs@fsfe.org>\n"
|
||||
"POT-Creation-Date: 2018-03-19 21:43+0000\n"
|
||||
"PO-Revision-Date: 2018-03-23 10:09+0100\n"
|
||||
"Last-Translator: Hannie Dumoleyn <hannie@ubuntu-nl.org>\n"
|
||||
"Language-Team: Dutch <gnome-nl-list@gnome.org>\n"
|
||||
"Language: nl\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Generator: Poedit 1.8.11\n"
|
||||
"X-Generator: Lokalize 2.0\n"
|
||||
"X-Project-Style: gnome\n"
|
||||
|
||||
#: data/50-gnome-shell-system.xml:6
|
||||
@@ -283,7 +283,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Geeft aan hoe vensters in het overzicht getoond worden. Geldige waarden zijn "
|
||||
"‘thumbnail-only’ (alleen een miniatuur tonen), ‘app-icon-only’ (alleen het "
|
||||
"pictogram van de toepassing tonen) of “both” (beide tonen)."
|
||||
"pictogram van de toepassing tonen) of ‘both’ (beide tonen)."
|
||||
|
||||
#: data/org.gnome.shell.gschema.xml.in:186
|
||||
msgid ""
|
||||
@@ -470,7 +470,7 @@ msgstr "Oriëntatievergrendeling"
|
||||
msgid "lock orientation;screen;rotation"
|
||||
msgstr ""
|
||||
"lock orientation;screen;rotation;oriëntatievergrendeling;scherm;draaiing;"
|
||||
"rotatie;"
|
||||
"rotatie"
|
||||
|
||||
#: js/misc/util.js:122
|
||||
msgid "Command not found"
|
||||
@@ -1232,11 +1232,11 @@ msgstr "‘%s’ downloaden van extensions.gnome.org en daarna installeren?"
|
||||
#: js/ui/inhibitShortcutsDialog.js:59
|
||||
#, javascript-format
|
||||
msgid "%s wants to inhibit shortcuts"
|
||||
msgstr "%s wil sneltoetsen inhiberen"
|
||||
msgstr "%s wil sneltoetsen blokkeren"
|
||||
|
||||
#: js/ui/inhibitShortcutsDialog.js:60
|
||||
msgid "Application wants to inhibit shortcuts"
|
||||
msgstr "Toepassing wil sneltoetsen inhiberen"
|
||||
msgstr "Toepassing wil sneltoetsen blokkeren"
|
||||
|
||||
#. Translators: %s is a keyboard shortcut like "Super+x"
|
||||
#: js/ui/inhibitShortcutsDialog.js:69
|
||||
@@ -1655,7 +1655,7 @@ msgstr "Locatie ingeschakeld"
|
||||
|
||||
#: js/ui/status/location.js:90 js/ui/status/location.js:198
|
||||
msgid "Disable"
|
||||
msgstr "Uischakelen"
|
||||
msgstr "Uitschakelen"
|
||||
|
||||
#: js/ui/status/location.js:91
|
||||
msgid "Privacy Settings"
|
||||
@@ -1823,7 +1823,7 @@ msgstr "Wifi-instellingen"
|
||||
#: js/ui/status/network.js:1298
|
||||
#, javascript-format
|
||||
msgid "%s Hotspot Active"
|
||||
msgstr "%s hotspot actief"
|
||||
msgstr "%s-hotspot actief"
|
||||
|
||||
#. Translators: %s is a network identifier
|
||||
#: js/ui/status/network.js:1313
|
||||
@@ -1967,16 +1967,16 @@ msgstr "Pauzestand"
|
||||
msgid "Power Off"
|
||||
msgstr "Uitschakelen"
|
||||
|
||||
#: js/ui/status/thunderbolt.js:272
|
||||
#: js/ui/status/thunderbolt.js:294
|
||||
msgid "Thunderbolt"
|
||||
msgstr "Thunderbolt"
|
||||
|
||||
#. we are done
|
||||
#: js/ui/status/thunderbolt.js:328
|
||||
#: js/ui/status/thunderbolt.js:350
|
||||
msgid "Unknown Thunderbolt device"
|
||||
msgstr "Onbekend Thunderbolt-apparaat"
|
||||
|
||||
#: js/ui/status/thunderbolt.js:329
|
||||
#: js/ui/status/thunderbolt.js:351
|
||||
msgid ""
|
||||
"New device has been detected while you were away. Please disconnect and "
|
||||
"reconnect the device to start using it."
|
||||
@@ -1984,11 +1984,11 @@ msgstr ""
|
||||
"Terwijl u weg was is er een nieuw apparaat gedetecteerd. Koppel het apparaat "
|
||||
"los en verbind het opnieuw om het te gebruiken."
|
||||
|
||||
#: js/ui/status/thunderbolt.js:334
|
||||
#: js/ui/status/thunderbolt.js:356
|
||||
msgid "Thunderbolt authorization error"
|
||||
msgstr "Thunderbolt-autorisatiefout"
|
||||
|
||||
#: js/ui/status/thunderbolt.js:335
|
||||
#: js/ui/status/thunderbolt.js:357
|
||||
#, javascript-format
|
||||
msgid "Could not authorize the thunderbolt device: %s"
|
||||
msgstr "Kon het Thunderbolt-apparaat niet autoriseren: %s"
|
||||
@@ -2162,7 +2162,7 @@ msgstr "De modus die door GDM voor het aanmeldscherm gebruikt wordt"
|
||||
|
||||
#: src/main.c:444
|
||||
msgid "Use a specific mode, e.g. “gdm” for login screen"
|
||||
msgstr "Specifieke modus gebruiken, bijv. “gdm” voor het aanmeldscherm"
|
||||
msgstr "Specifieke modus gebruiken, bijv. ‘gdm’ voor het aanmeldscherm"
|
||||
|
||||
#: src/main.c:450
|
||||
msgid "List possible modes"
|
||||
@@ -2176,7 +2176,7 @@ msgstr "Onbekend"
|
||||
#: src/shell-app.c:511
|
||||
#, c-format
|
||||
msgid "Failed to launch “%s”"
|
||||
msgstr "Kon “%s” niet starten"
|
||||
msgstr "Kon ‘%s’ niet starten"
|
||||
|
||||
#: src/shell-keyring-prompt.c:730
|
||||
msgid "Passwords do not match."
|
||||
|
376
po/pt_BR.po
376
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
569
po/zh_CN.po
569
po/zh_CN.po
File diff suppressed because it is too large
Load Diff
@@ -73,8 +73,8 @@ struct _ShellGlobal {
|
||||
ShellWM *wm;
|
||||
GSettings *settings;
|
||||
const char *datadir;
|
||||
const char *imagedir;
|
||||
const char *userdatadir;
|
||||
char *imagedir;
|
||||
char *userdatadir;
|
||||
GFile *userdatadir_path;
|
||||
GFile *runtime_state_path;
|
||||
|
||||
@@ -337,6 +337,10 @@ shell_global_finalize (GObject *object)
|
||||
g_clear_object (&global->userdatadir_path);
|
||||
g_clear_object (&global->runtime_state_path);
|
||||
|
||||
g_free (global->session_mode);
|
||||
g_free (global->imagedir);
|
||||
g_free (global->userdatadir);
|
||||
|
||||
G_OBJECT_CLASS(shell_global_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
|
@@ -399,9 +399,6 @@ get_gl_vendor (void)
|
||||
gboolean
|
||||
shell_util_need_background_refresh (void)
|
||||
{
|
||||
if (!clutter_check_windowing_backend (CLUTTER_WINDOWING_X11))
|
||||
return FALSE;
|
||||
|
||||
if (g_strcmp0 (get_gl_vendor (), "NVIDIA Corporation") == 0)
|
||||
return TRUE;
|
||||
|
||||
|
@@ -142,7 +142,7 @@ libst_gir = gnome.generate_gir(libst,
|
||||
sources: st_gir_sources,
|
||||
nsversion: '1.0',
|
||||
namespace: 'St',
|
||||
includes: ['Clutter-' + mutter_api_version, 'Gtk-3.0'],
|
||||
includes: ['Clutter-' + mutter_api_version, 'Cally-' + mutter_api_version, 'Gtk-3.0'],
|
||||
dependencies: [mutter_dep],
|
||||
include_directories: include_directories('..'),
|
||||
extra_args: ['-DST_COMPILATION', '--quiet'],
|
||||
|
@@ -180,6 +180,7 @@ st_label_dispose (GObject *object)
|
||||
{
|
||||
StLabelPrivate *priv = ST_LABEL (object)->priv;
|
||||
|
||||
priv->label = NULL;
|
||||
g_clear_pointer (&priv->text_shadow_pipeline, cogl_object_unref);
|
||||
|
||||
G_OBJECT_CLASS (st_label_parent_class)->dispose (object);
|
||||
|
@@ -414,11 +414,9 @@ _st_create_shadow_pipeline_from_actor (StShadow *shadow_spec,
|
||||
ClutterActor *actor)
|
||||
{
|
||||
CoglPipeline *shadow_pipeline = NULL;
|
||||
ClutterActorBox box;
|
||||
float width, height;
|
||||
|
||||
clutter_actor_get_allocation_box (actor, &box);
|
||||
clutter_actor_box_get_size (&box, &width, &height);
|
||||
clutter_actor_get_size (actor, &width, &height);
|
||||
|
||||
if (width == 0 || height == 0)
|
||||
return NULL;
|
||||
@@ -441,6 +439,7 @@ _st_create_shadow_pipeline_from_actor (StShadow *shadow_spec,
|
||||
CoglFramebuffer *fb;
|
||||
CoglColor clear_color;
|
||||
CoglError *catch_error = NULL;
|
||||
float x, y;
|
||||
|
||||
buffer = cogl_texture_new_with_size (width,
|
||||
height,
|
||||
@@ -462,6 +461,7 @@ _st_create_shadow_pipeline_from_actor (StShadow *shadow_spec,
|
||||
}
|
||||
|
||||
cogl_color_init_from_4ub (&clear_color, 0, 0, 0, 0);
|
||||
clutter_actor_get_position (actor, &x, &y);
|
||||
|
||||
/* XXX: There's no way to render a ClutterActor to an offscreen
|
||||
* as it uses the implicit API. */
|
||||
@@ -470,7 +470,7 @@ _st_create_shadow_pipeline_from_actor (StShadow *shadow_spec,
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS;
|
||||
|
||||
cogl_framebuffer_clear (fb, COGL_BUFFER_BIT_COLOR, &clear_color);
|
||||
cogl_framebuffer_translate (fb, -box.x1, -box.y1, 0);
|
||||
cogl_framebuffer_translate (fb, -x, -y, 0);
|
||||
cogl_framebuffer_orthographic (fb, 0, 0, width, height, 0, 1.0);
|
||||
|
||||
clutter_actor_set_opacity_override (actor, 255);
|
||||
|
@@ -37,6 +37,7 @@ struct _StTextureCachePrivate
|
||||
|
||||
/* Things that were loaded with a cache policy != NONE */
|
||||
GHashTable *keyed_cache; /* char * -> CoglTexture* */
|
||||
GHashTable *keyed_surface_cache; /* char * -> cairo_surface_t* */
|
||||
|
||||
/* Presently this is used to de-duplicate requests for GIcons and async URIs. */
|
||||
GHashTable *outstanding_requests; /* char * -> AsyncTextureLoadData * */
|
||||
@@ -104,6 +105,18 @@ st_texture_cache_class_init (StTextureCacheClass *klass)
|
||||
G_TYPE_NONE, 1, G_TYPE_FILE);
|
||||
}
|
||||
|
||||
/* Evicts all cached textures */
|
||||
void
|
||||
st_texture_cache_clear (StTextureCache *cache)
|
||||
{
|
||||
GHashTableIter iter;
|
||||
gpointer key;
|
||||
gpointer value;
|
||||
|
||||
g_hash_table_remove_all (cache->priv->keyed_cache);
|
||||
g_signal_emit (cache, signals[ICON_THEME_CHANGED], 0);
|
||||
}
|
||||
|
||||
/* Evicts all cached textures for named icons */
|
||||
static void
|
||||
st_texture_cache_evict_icons (StTextureCache *cache)
|
||||
@@ -145,6 +158,10 @@ st_texture_cache_init (StTextureCache *self)
|
||||
|
||||
self->priv->keyed_cache = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||
g_free, cogl_object_unref);
|
||||
self->priv->keyed_surface_cache = g_hash_table_new_full (g_str_hash,
|
||||
g_str_equal,
|
||||
g_free,
|
||||
(GDestroyNotify) cairo_surface_destroy);
|
||||
self->priv->outstanding_requests = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||
g_free, NULL);
|
||||
self->priv->file_monitors = g_hash_table_new_full (g_file_hash, (GEqualFunc) g_file_equal,
|
||||
@@ -166,6 +183,7 @@ st_texture_cache_dispose (GObject *object)
|
||||
}
|
||||
|
||||
g_clear_pointer (&self->priv->keyed_cache, g_hash_table_destroy);
|
||||
g_clear_pointer (&self->priv->keyed_surface_cache, g_hash_table_destroy);
|
||||
g_clear_pointer (&self->priv->outstanding_requests, g_hash_table_destroy);
|
||||
g_clear_pointer (&self->priv->file_monitors, g_hash_table_destroy);
|
||||
|
||||
@@ -520,6 +538,8 @@ finish_texture_load (AsyncTextureLoadData *data,
|
||||
goto out;
|
||||
|
||||
texdata = pixbuf_to_cogl_texture (pixbuf);
|
||||
if (!texdata)
|
||||
goto out;
|
||||
|
||||
if (data->policy != ST_TEXTURE_CACHE_POLICY_NONE)
|
||||
{
|
||||
@@ -986,7 +1006,7 @@ file_changed_cb (GFileMonitor *monitor,
|
||||
g_free (key);
|
||||
|
||||
key = g_strdup_printf (CACHE_PREFIX_FILE_FOR_CAIRO "%u", file_hash);
|
||||
g_hash_table_remove (cache->priv->keyed_cache, key);
|
||||
g_hash_table_remove (cache->priv->keyed_surface_cache, key);
|
||||
g_free (key);
|
||||
|
||||
g_signal_emit (cache, signals[TEXTURE_FILE_CHANGED], 0, file);
|
||||
@@ -1273,6 +1293,9 @@ st_texture_cache_load_file_sync_to_cogl_texture (StTextureCache *cache,
|
||||
texdata = pixbuf_to_cogl_texture (pixbuf);
|
||||
g_object_unref (pixbuf);
|
||||
|
||||
if (!texdata)
|
||||
goto out;
|
||||
|
||||
if (policy == ST_TEXTURE_CACHE_POLICY_FOREVER)
|
||||
{
|
||||
cogl_object_ref (texdata);
|
||||
@@ -1304,7 +1327,7 @@ st_texture_cache_load_file_sync_to_cairo_surface (StTextureCache *cache,
|
||||
|
||||
key = g_strdup_printf (CACHE_PREFIX_FILE_FOR_CAIRO "%u", g_file_hash (file));
|
||||
|
||||
surface = g_hash_table_lookup (cache->priv->keyed_cache, key);
|
||||
surface = g_hash_table_lookup (cache->priv->keyed_surface_cache, key);
|
||||
|
||||
if (surface == NULL)
|
||||
{
|
||||
@@ -1318,7 +1341,8 @@ st_texture_cache_load_file_sync_to_cairo_surface (StTextureCache *cache,
|
||||
if (policy == ST_TEXTURE_CACHE_POLICY_FOREVER)
|
||||
{
|
||||
cairo_surface_reference (surface);
|
||||
g_hash_table_insert (cache->priv->keyed_cache, g_strdup (key), surface);
|
||||
g_hash_table_insert (cache->priv->keyed_surface_cache,
|
||||
g_strdup (key), surface);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@@ -52,6 +52,7 @@ typedef enum {
|
||||
} StTextureCachePolicy;
|
||||
|
||||
StTextureCache* st_texture_cache_get_default (void);
|
||||
void st_texture_cache_clear (StTextureCache *cache);
|
||||
|
||||
ClutterActor *
|
||||
st_texture_cache_load_sliced_image (StTextureCache *cache,
|
||||
|
@@ -38,6 +38,10 @@ const tests = [
|
||||
output: [ { url: 'http://www.gnome.org:99/port', pos: 10 } ] },
|
||||
{ input: 'This is an ftp://www.gnome.org/ test.',
|
||||
output: [ { url: 'ftp://www.gnome.org/', pos: 11 } ] },
|
||||
{ input: 'https://www.gnome.org/(some_url,_with_very_unusual_characters)',
|
||||
output: [ { url: 'https://www.gnome.org/(some_url,_with_very_unusual_characters)', pos: 0 } ] },
|
||||
{ input: 'https://www.gnome.org/(some_url_with_unbalanced_parenthesis',
|
||||
output: [ { url: 'https://www.gnome.org/', pos: 0 } ] },
|
||||
|
||||
{ input: 'Visit http://www.gnome.org/ and http://developer.gnome.org',
|
||||
output: [ { url: 'http://www.gnome.org/', pos: 6 },
|
||||
@@ -68,4 +72,4 @@ for (let i = 0; i < tests.length; i++) {
|
||||
JsUnit.assertEquals('Test ' + i + ', match ' + j + ' position',
|
||||
match[j].pos, tests[i].output[j].pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user