[gnome-shell/wip/rstrode/rhel-7.9: 37/86] closeDialog: Periodically check for window to become responsive again
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/rstrode/rhel-7.9: 37/86] closeDialog: Periodically check for window to become responsive again
- Date: Fri, 12 Feb 2021 19:04:06 +0000 (UTC)
commit ce6fb7f43bde2760a103ae574fc2af9921d6da4b
Author: Florian Müllner <fmuellner gnome org>
Date: Mon May 21 23:12:35 2018 +0200
closeDialog: Periodically check for window to become responsive again
The close dialog for non-responding windows is closed automatically
when we detect that the window is responding again. However as we
currently only ping the window in response to certain user actions
(like focusing the window or opening the window menu), this can
easily go undetected.
Address this by periodically pinging the window while the close
dialog is shown.
https://gitlab.gnome.org/GNOME/gnome-shell/issues/298
js/ui/closeDialog.js | 12 ++++++++++++
1 file changed, 12 insertions(+)
---
diff --git a/js/ui/closeDialog.js b/js/ui/closeDialog.js
index 821480a9c3..7943880d8e 100644
--- a/js/ui/closeDialog.js
+++ b/js/ui/closeDialog.js
@@ -2,6 +2,7 @@
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;
@@ -13,6 +14,7 @@ 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',
@@ -26,6 +28,7 @@ var CloseDialog = new Lang.Class({
this.parent();
this._window = window;
this._dialog = null;
+ this._timeoutId = 0;
},
get window() {
@@ -99,6 +102,12 @@ var CloseDialog = new Lang.Class({
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._addWindowEffect();
this._initDialog();
@@ -121,6 +130,9 @@ var CloseDialog = new Lang.Class({
Meta.enable_unredirect_for_screen(global.screen);
+ GLib.source_remove(this._timeoutId);
+ this._timeoutId = 0;
+
let dialog = this._dialog;
this._dialog = null;
this._removeWindowEffect();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]