编写Gnome扩展程序以禁用左侧拖动手势以显示应用选择器 [英] Programming a Gnome extension to disable left edge drag gesture to show the app picker

查看:288
本文介绍了编写Gnome扩展程序以禁用左侧拖动手势以显示应用选择器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果在错误的组中,我向所有人道歉.

My apologies to all, if this is in the wrong group.

我们想在Kiosk模式下使用Fedora 23,但是最近在Gnome Shell中添加了最近添加的左边缘滑动功能(

We’d like to use Fedora 23 in Kiosk mode, but there is was a recently added left edge swipe feature that was added to Gnome Shell (https://github.com/GNOME/gnome-shell)that cannot be disabled easily.

https://github.com/GNOME/gnome-shell/commit/9c4ffc4bf353fe9c64368f3e194e613/a>

https://github.com/GNOME/gnome-shell/commit/9c4ffc4bf353fe9c64368f3e194e38b0e8f61311

据我所知,我们的选择是:

As far as I can tell, our options are:

1)写一个扩展程序来解决这个问题-我的最爱

1) Write an extension to fix this — My favorite

我们采访了原始作者,他建议通过扩展程序删除手势.

We spoke to the original author, who recommended removing the gesture via an extension.

我们尝试编写扩展,但无法找到一种方法来遍历global.stage中的手势列表以将其删除.

We have tried writing an extension, but cannot figure out a way to iterate over the gesture list in global.stage to remove it.

(这些手势是使用global.stage.add_action(gesture)添加的,可以使用global.stage.remove_action(gesture)删除.)

(These gestures were added using global.stage.add_action(gesture) and can be removed using global.stage.remove_action(gesture).)

此后,作者已停止回复我们的电子邮件:(

The author has since stopped responding to our emails :(

任何有关此的建议都很好!

Any advice on this would be great!

2)检查我们使用的版本,注释掉代码,重新编译 并安装到我们的机器上

2) Check out the version that we’re on, comment out the code, recompile and install onto our machines

听起来不错!这样我们也可以修复其他错误.查看自述文件

This sounds great! That way we can fix other bugs also. Looking at the README file

https://github.com/GNOME/gnome-shell/blob/master/README

https:// github.com/GNOME/gnome-shell/blob/master/README

它说:

有关GNOME Shell的更多信息,包括有关操作方法的说明

For more information about GNOME Shell, including instructions on how

从源代码构建GNOME Shell以及如何参与GNOME Shell的开发 项目,

to build GNOME Shell from source and how to get involved with the project,

请参阅https://wiki.gnome.org/Projects/GnomeShell

See https:// wiki.gnome.org/Projects/GnomeShell

因此,我们已将其跟随到此页面:

So, we’ve followed it to this page:

https://wiki.gnome.org/Newcomers/BuildGnome

https:// wiki.gnome.org/Newcomers/BuildGnome

这告诉我们检出JHBuild,但是当我们使用JHBuild时,我们似乎无法弄清楚在机器上检出gnome shell代码的位置.

And this tells us to check out JHBuild, but we can’t seem to figure out where the gnome shell code is checked out on the machine when we use JHBuild.

如果有一种更简单的制作/安装方法,那就太好了.我们可能只是点击了错误的推荐链接.

If there’s an easier way to make/install, that’d be great. We probably just followed the wrong recommended link.

3)回滚到gnome shell的早期版本

3) Roll back to an earlier version of gnome shell

但是,这使我们回到了#2所示的签出gnome shell和make/install的问题.

But this brings us back to the problem of checking out the gnome shell and make/install as shown in #2.

4)切换到KDE

我们可以尝试使用KDE而不是Gnome,但是我们已经在Gnome中进行了大量测试,并且可能会遇到重大挫折.

We could try KDE instead of Gnome, but we've done lots of testing in Gnome already and could be a major setback.

5)构建一个Fedora 22盒子,回到我最不喜欢的Gnome 3.16

5) Build a Fedora 22 box to get back to Gnome 3.16 — my least favorite

这是一项巨大的努力,我们无法确定已更改的内容和会失败的内容.我们的Kiosk软件甚至可能无法在Fedora 22上运行.但这是冰雹玛丽的备份计划

It’s a huge effort and we can’t be sure what’s changed and what will break. Our Kiosk software may not even run on Fedora 22. But it’s the hail mary back up plan

推荐答案

我使用SciComputing,在FlorianMüllner的帮助下,我们意识到使用以下Javascript代码进行的扩展将摆脱关闭我们的手势信息亭窗口:

I work with SciComputing, and, with the help of Florian Müllner, we realized that an extension with the following Javascript code would get rid of the gestures that closed our kiosk window:

/*
 * Disable all of the unwanted touchscreen gestures.
 */
function enable() {

global.stage.get_actions().forEach(a => a.enabled = false);

}

/*
 * Re-enable the touchscreen gestures.
 */
function disable() {

    global.stage.get_actions().forEach(a => a.enabled = true);
}

这篇关于编写Gnome扩展程序以禁用左侧拖动手势以显示应用选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆