Compare commits

...

14 Commits

Author SHA1 Message Date
1b7577298a window-tracker: check WM_CLASS for sandboxed apps before the app's ID
For sandboxed apps, the shell needs to consider the app's ID when
matching its windows against the right .desktop file, but that
check can't be done before having attempted to match using the
WM_CLASS property of the app's window, otherwise apps installing
multiple desktop files (e.g. LibreOffice) will always match every
single window against the same .desktop file, ignoring hints such
as the StartupWMClass key.

This commit moves the call to get_app_from_sandboxed_app_id() after
get_app_from_window_wmclass() and before get_app_from_window_pid(),
so that we only rely on the sandboxed app's ID when no match has
succeed using the WM_CLASS property, but before checking by PID to
prevent wrong groups that could be created when the PID of the app
inside the sandbox matches the one from a process outside of it.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/219
2018-04-20 14:09:28 +01:00
c4e0f6df08 Update Russian translation
(cherry picked from commit 0d031dc20f)
2018-04-19 20:33:21 +00:00
58aafe9520 theme: Improve look of login user-list
* Remove tiny padding of user-list
* Less space between avatar and username
* Apply the 1em padding only to the user-widget, not the timed-login-indicator
2018-04-19 17:26:14 +02:00
a46df7f8ec theme: Use a padding of 6px on the user-list items according to HIG 2018-04-19 17:26:14 +02:00
1dd16618d1 loginDialog: Don't display timed login indicator if unused
This fixes the slightly bigger padding underneath the login item compared to the padding above
2018-04-19 17:26:14 +02:00
a4190f83ac loginDialog: Correct source name for timed login idle timeout
The _blockTimedLoginUntilIdle method sets a timeout to be called after
the user is idle for 5 seconds.  That timeout is erroneously given the
source name "[gnome-shell] this._timedLoginAnimationTime" which looks
like a copy-and-paste mistake.  The original intention was probably to
use a source name of "[gnome-shell] this._timedLoginIdleTimeOutId" which
more closely matches existing convention for source names.

This commit fixes that.
2018-04-19 17:26:14 +02:00
a8e17f73ec loginDialog: Use more function scope variables inside _startTimedLogin
Using function scope variables increases readability and prevents
unwanted changes from outside while the batch is running.
2018-04-19 17:26:13 +02:00
86a741c1ee loginDialog: Make sure timed login indicator is shown after idle timeout
If the idle timeout is done, always show the user list to make sure the
timed login indicator is visible.
2018-04-19 17:25:02 +02:00
5cc6fef689 loginDialog: Restrict grabbing of focus while timed login is running
Make sure the focus isn't grabbed right after user interaction starts a
new timed login. Only grab it after the idle timeout is done and on the
first run instead.
2018-04-19 09:08:45 +02:00
522a5fe480 loginDialog: Ensure old timed login timeout is removed before starting a new one
Normally, we give the user a 5 second grace period of inactivity before
starting a timed login operation. Unfortunately, that grace period
timeout isn't properly removed if the timed login operation is restarted
during the grace period. That means the timeout handler can
inadvertently get called multiple times leading to the grace period
duration getting subtracted from the total animation time more than
once.

This commit ensures we only ever have one grace period timeout scheduled
at a time.
2018-04-19 09:08:45 +02:00
b1239b1257 loginDialog: Use GLib instead of Mainloop for timeout
imports.mainloop is deprecated
2018-04-19 09:08:45 +02:00
58063d9ee1 loginDialog: Move reset of timed login into _startTimedLogin
This way we can make sure that already running timed logins are
always reset when starting a new one.
2018-04-19 09:08:45 +02:00
d7aba2dece loginDialog: Ensure timed login indicator is hidden on key presses
The timed login feature currently cancels the timed login operation when
a user presses a key but, oddly, only hides the indicator when the user
releases the key. This means that if a user holds down a key that
doesn't key repeat, the timed login indicator will continue to run after
the timed login operation is cancelled.

This commit address the problem by ensuring the timed login indicator is
hidden on any key press event, at the same time the timed login
operation is canceled.
2018-04-19 09:08:45 +02:00
35fced27df ibusCandidatePopup: Fix candidate-clicked signal 2018-04-18 13:37:53 +09:00
5 changed files with 94 additions and 93 deletions

View File

@ -1788,20 +1788,19 @@ StScrollBar {
.login-dialog-user-list-view { -st-vfade-offset: 1em; }
.login-dialog-user-list {
spacing: 12px;
padding: .2em;
width: 23em;
&:expanded .login-dialog-user-list-item:selected { background-color: $selected_bg_color; color: $selected_fg_color; }
&:expanded .login-dialog-user-list-item:logged-in { border-right: 2px solid $selected_bg_color; }
}
.login-dialog-user-list-item {
border-radius: 5px;
padding: .2em;
padding: 6px;
color: darken($osd_fg_color,30%);
&:ltr { padding-right: 1em; }
&:rtl { padding-left: 1em; }
&:ltr .user-widget { padding-right: 1em; }
&:rtl .user-widget { padding-left: 1em; }
.login-dialog-timed-login-indicator {
height: 2px;
margin: 2px 0 0 0;
margin-top: 6px;
background-color: $osd_fg_color;
}
&:focus .login-dialog-timed-login-indicator { background-color: $selected_fg_color; }
@ -1816,8 +1815,8 @@ StScrollBar {
padding-left: 15px;
}
.user-widget-label {
&:ltr { padding-left: 18px; }
&:rtl { padding-right: 18px; }
&:ltr { padding-left: 14px; }
&:rtl { padding-right: 14px; }
}
.login-dialog-prompt-layout {

View File

@ -25,7 +25,6 @@ const GLib = imports.gi.GLib;
const GObject = imports.gi.GObject;
const Gtk = imports.gi.Gtk;
const Lang = imports.lang;
const Mainloop = imports.mainloop;
const Meta = imports.gi.Meta;
const Pango = imports.gi.Pango;
const Shell = imports.gi.Shell;
@ -86,7 +85,8 @@ var UserListItem = new Lang.Class({
GObject.BindingFlags.SYNC_CREATE);
this._timedLoginIndicator = new St.Bin({ style_class: 'login-dialog-timed-login-indicator',
scale_x: 0 });
scale_x: 0,
visible: false });
layout.add(this._timedLoginIndicator);
this.actor.connect('clicked', this._onClicked.bind(this));
@ -126,6 +126,8 @@ var UserListItem = new Lang.Class({
this.hideTimedLoginIndicator();
this._timedLoginIndicator.visible = true;
let startTime = GLib.get_monotonic_time();
this._timedLoginTimeoutId = GLib.timeout_add (GLib.PRIORITY_DEFAULT, 33,
@ -152,6 +154,8 @@ var UserListItem = new Lang.Class({
GLib.source_remove(this._timedLoginTimeoutId);
this._timedLoginTimeoutId = 0;
}
this._timedLoginIndicator.visible = false;
this._timedLoginIndicator.scale_x = 0.;
}
});
@ -991,59 +995,81 @@ var LoginDialog = new Lang.Class({
return hold;
},
_showTimedLoginAnimation() {
this._timedLoginItem.actor.grab_key_focus();
return this._timedLoginItem.showTimedLoginIndicator(this._timedLoginAnimationTime);
},
_blockTimedLoginUntilIdle() {
// This blocks timed login from starting until a few
// seconds after the user stops interacting with the
// login screen.
//
// We skip this step if the timed login delay is very
// short.
if ((this._timedLoginDelay - _TIMED_LOGIN_IDLE_THRESHOLD) <= 0)
return null;
let hold = new Batch.Hold();
this._timedLoginIdleTimeOutId = Mainloop.timeout_add_seconds(_TIMED_LOGIN_IDLE_THRESHOLD,
this._timedLoginIdleTimeOutId = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, _TIMED_LOGIN_IDLE_THRESHOLD,
() => {
this._timedLoginAnimationTime -= _TIMED_LOGIN_IDLE_THRESHOLD;
this._timedLoginIdleTimeOutId = 0;
hold.release();
return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(this._timedLoginIdleTimeOutId, '[gnome-shell] this._timedLoginAnimationTime');
GLib.Source.set_name_by_id(this._timedLoginIdleTimeOutId, '[gnome-shell] this._timedLoginIdleTimeOutId');
return hold;
},
_startTimedLogin(userName, delay) {
this._timedLoginItem = null;
this._timedLoginDelay = delay;
this._timedLoginAnimationTime = delay;
let firstRun = true;
// Cancel execution of old batch
if (this._timedLoginBatch) {
this._timedLoginBatch.cancel();
this._timedLoginBatch = null;
firstRun = false;
}
// Reset previous idle-timeout
if (this._timedLoginIdleTimeOutId) {
GLib.source_remove(this._timedLoginIdleTimeOutId);
this._timedLoginIdleTimeOutId = 0;
}
let loginItem = null;
let animationTime;
let tasks = [() => this._waitForItemForUser(userName),
() => {
this._timedLoginItem = this._userList.getItemFromUserName(userName);
loginItem = this._userList.getItemFromUserName(userName);
// If there is an animation running on the item, reset it.
loginItem.hideTimedLoginIndicator();
},
() => {
// If we're just starting out, start on the right
// item.
// If we're just starting out, start on the right item.
if (!this._userManager.is_loaded) {
this._userList.jumpToItem(this._timedLoginItem);
this._userList.jumpToItem(loginItem);
}
},
this._blockTimedLoginUntilIdle,
() => {
this._userList.scrollToItem(this._timedLoginItem);
// This blocks the timed login animation until a few
// seconds after the user stops interacting with the
// login screen.
// We skip this step if the timed login delay is very short.
if (delay > _TIMED_LOGIN_IDLE_THRESHOLD) {
animationTime = delay - _TIMED_LOGIN_IDLE_THRESHOLD;
return this._blockTimedLoginUntilIdle();
} else {
animationTime = delay;
}
},
this._showTimedLoginAnimation,
() => {
// If idle timeout is done, make sure the timed login indicator is shown
if (delay > _TIMED_LOGIN_IDLE_THRESHOLD &&
this._authPrompt.actor.visible)
this._authPrompt.cancel();
if (delay > _TIMED_LOGIN_IDLE_THRESHOLD || firstRun) {
this._userList.scrollToItem(loginItem);
loginItem.actor.grab_key_focus();
}
},
() => loginItem.showTimedLoginIndicator(animationTime),
() => {
this._timedLoginBatch = null;
@ -1055,37 +1081,17 @@ var LoginDialog = new Lang.Class({
return this._timedLoginBatch.run();
},
_resetTimedLogin() {
if (this._timedLoginBatch) {
this._timedLoginBatch.cancel();
this._timedLoginBatch = null;
}
if (this._timedLoginItem)
this._timedLoginItem.hideTimedLoginIndicator();
let userName = this._timedLoginItem.user.get_user_name();
if (userName)
this._startTimedLogin(userName, this._timedLoginDelay);
},
_onTimedLoginRequested(client, userName, seconds) {
if (this._timedLoginBatch)
return;
this._startTimedLogin(userName, seconds);
// Restart timed login on user interaction
global.stage.connect('captured-event', (actor, event) => {
if (this._timedLoginDelay == undefined)
return Clutter.EVENT_PROPAGATE;
if (event.type() == Clutter.EventType.KEY_PRESS ||
event.type() == Clutter.EventType.BUTTON_PRESS) {
if (this._timedLoginBatch) {
this._timedLoginBatch.cancel();
this._timedLoginBatch = null;
}
} else if (event.type() == Clutter.EventType.KEY_RELEASE ||
event.type() == Clutter.EventType.BUTTON_RELEASE) {
this._resetTimedLogin();
this._startTimedLogin(userName, seconds);
}
return Clutter.EVENT_PROPAGATE;

View File

@ -166,7 +166,7 @@ var CandidatePopup = new Lang.Class({
this._panelService.cursor_down();
});
this._candidateArea.connect('candidate-clicked', () => {
this._candidateArea.connect('candidate-clicked', (area, index, button, state) => {
this._panelService.candidate_clicked(index, button, state);
});

View File

@ -18,8 +18,8 @@ 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-04-12 11:47+0000\n"
"PO-Revision-Date: 2018-04-12 16:48+0300\n"
"POT-Creation-Date: 2018-04-13 18:31+0000\n"
"PO-Revision-Date: 2018-04-19 23:31+0300\n"
"Last-Translator: Stas Solovey <whats_up@tut.by>\n"
"Language-Team: Русский <gnome-cyr@gnome.org>\n"
"Language: ru\n"
@ -344,7 +344,7 @@ msgid "There was an error loading the preferences dialog for %s:"
msgstr "Возникла ошибка загрузки диалогового окна параметров для %s:"
#: js/gdm/authPrompt.js:147 js/ui/audioDeviceSelection.js:71
#: js/ui/components/networkAgent.js:117 js/ui/components/polkitAgent.js:149
#: js/ui/components/networkAgent.js:117 js/ui/components/polkitAgent.js:153
#: js/ui/endSessionDialog.js:482 js/ui/extensionDownloader.js:197
#: js/ui/shellMountOperation.js:343 js/ui/status/network.js:919
msgid "Cancel"
@ -563,7 +563,6 @@ msgstr "Вчера, %H%M"
msgid "%A, %H%M"
msgstr "%A, %H%M"
# fix даты "11 мар., 20:35"
#. Translators: this is the month name and day number
#. followed by a time string in 24h format.
#. i.e. "May 25, 14:30"
@ -572,7 +571,6 @@ msgstr "%A, %H%M"
msgid "%B %d, %H%M"
msgstr "%-d %B, %H%M"
# fix даты
#. Translators: this is the month name, day number, year
#. number followed by a time string in 24h format.
#. i.e. "May 25 2012, 14:30"
@ -581,7 +579,6 @@ msgstr "%-d %B, %H%M"
msgid "%B %d %Y, %H%M"
msgstr "%-d %B %Y, %H%M"
# по всей видимости разрабы коммент перепутали c "Translators: Time in 12h format"
#. Translators: Time in 12h format
#: js/misc/util.js:257
msgid "%l%M %p"
@ -823,7 +820,6 @@ msgctxt "calendar heading"
msgid "%A, %B %d"
msgstr "%A, %-d %B"
# fix для даты в календаре и на экране блокировки
#: js/ui/calendar.js:868
msgctxt "calendar heading"
msgid "%A, %B %d, %Y"
@ -876,7 +872,7 @@ msgstr "Внешний диск отключён"
msgid "Open with %s"
msgstr "Открыть с помощью %s"
#: js/ui/components/keyring.js:107 js/ui/components/polkitAgent.js:285
#: js/ui/components/keyring.js:107 js/ui/components/polkitAgent.js:295
msgid "Password:"
msgstr "Пароль:"
@ -963,15 +959,15 @@ msgstr "Для подключения к «%s» требуется пароль.
msgid "Network Manager"
msgstr "Диспетчер сети"
#: js/ui/components/polkitAgent.js:44
#: js/ui/components/polkitAgent.js:48
msgid "Authentication Required"
msgstr "Требуется подтверждение подлинности"
#: js/ui/components/polkitAgent.js:72
#: js/ui/components/polkitAgent.js:76
msgid "Administrator"
msgstr "Администратор"
#: js/ui/components/polkitAgent.js:152
#: js/ui/components/polkitAgent.js:156
msgid "Authenticate"
msgstr "Подтвердить"
@ -979,7 +975,7 @@ msgstr "Подтвердить"
#. * requested authentication was not gained; this can happen
#. * because of an authentication error (like invalid password),
#. * for instance.
#: js/ui/components/polkitAgent.js:271 js/ui/shellMountOperation.js:327
#: js/ui/components/polkitAgent.js:281 js/ui/shellMountOperation.js:327
msgid "Sorry, that didnt work. Please try again."
msgstr "Не удалось подтвердить подлинность. Попробуйте снова."
@ -1004,7 +1000,6 @@ msgstr "Показать приложения"
msgid "Dash"
msgstr "Панель приложений"
# fix для даты в календаре и на экране блокировки
#. Translators: This is the date format to use when the calendar popup is
#. * shown - it is shown just below the time in the shell (e.g. "Tue 9:29 AM").
#.
@ -1012,7 +1007,6 @@ msgstr "Панель приложений"
msgid "%B %e %Y"
msgstr "%-d %B %Y"
# fix для даты в календаре и на экране блокировки
#. Translators: This is the accessible name of the date button shown
#. * below the time in the shell; it should combine the weekday and the
#. * date, e.g. "Tuesday February 17 2015".
@ -1029,7 +1023,7 @@ msgstr "Добавить мировые часы…"
msgid "World Clocks"
msgstr "Мировые часы"
#: js/ui/dateMenu.js:225
#: js/ui/dateMenu.js:227
msgid "Weather"
msgstr "Погода"
@ -1037,7 +1031,7 @@ msgstr "Погода"
#. libgweather for the possible condition strings. If at all
#. possible, the sentence should match the grammatical case etc. of
#. the inserted conditions.
#: js/ui/dateMenu.js:289
#: js/ui/dateMenu.js:291
#, javascript-format
msgid "%s all day."
msgstr "%s весь день."
@ -1046,7 +1040,7 @@ msgstr "%s весь день."
#. libgweather for the possible condition strings. If at all
#. possible, the sentence should match the grammatical case etc. of
#. the inserted conditions.
#: js/ui/dateMenu.js:295
#: js/ui/dateMenu.js:297
#, javascript-format
msgid "%s, then %s later."
msgstr "%s, затем позднее %s."
@ -1055,30 +1049,30 @@ msgstr "%s, затем позднее %s."
#. libgweather for the possible condition strings. If at all
#. possible, the sentence should match the grammatical case etc. of
#. the inserted conditions.
#: js/ui/dateMenu.js:301
#: js/ui/dateMenu.js:303
#, javascript-format
msgid "%s, then %s, followed by %s later."
msgstr "%s, затем %s, позже %s."
#: js/ui/dateMenu.js:312
#: js/ui/dateMenu.js:314
msgid "Select a location…"
msgstr "Выберите местоположение…"
#: js/ui/dateMenu.js:315
#: js/ui/dateMenu.js:317
msgid "Loading…"
msgstr "Загрузка…"
#. Translators: %s is a temperature with unit, e.g. "23℃"
#: js/ui/dateMenu.js:321
#: js/ui/dateMenu.js:323
#, javascript-format
msgid "Feels like %s."
msgstr "Ощущается как %s."
#: js/ui/dateMenu.js:324
#: js/ui/dateMenu.js:326
msgid "Go online for weather information"
msgstr "Подключите интернет для получения информации о погоде"
#: js/ui/dateMenu.js:326
#: js/ui/dateMenu.js:328
msgid "Weather information is currently unavailable"
msgstr "Информация о погоде сейчас недоступна"

View File

@ -395,13 +395,6 @@ get_app_for_window (ShellWindowTracker *tracker,
if (meta_window_is_remote (window))
return _shell_app_new_for_window (window);
/* Check if the window was opened from within a sandbox; if this
* is the case, a corresponding .desktop file is guaranteed to match;
*/
result = get_app_from_sandboxed_app_id (window);
if (result != NULL)
return result;
/* Check if the window has a GApplication ID attached; this is
* canonical if it does
*/
@ -416,6 +409,15 @@ get_app_for_window (ShellWindowTracker *tracker,
if (result != NULL)
return result;
/* Check if the window was opened from within a sandbox; if this
* is the case, a corresponding .desktop file is guaranteed to match;
* Do this after having checked by WM_CLASS so that sandboxed apps
* installing multiple .desktop files can properly match their windows.
*/
result = get_app_from_sandboxed_app_id (window);
if (result != NULL)
return result;
result = get_app_from_window_pid (tracker, window);
if (result != NULL)
return result;