简体   繁体   English

如何在GNOME和KDE等Linux图形环境中支持滚动?

[英]How is scrolling supported in Linux graphical environments like GNOME and KDE?

I'm curious to know: is scrolling (such as in Firefox, Nautilus, etc.) handled be each application separately? 我很想知道:滚动(例如在Firefox,Nautilus等中)是否分别处理每个应用程序? Or is it done by the environment? 还是由环境完成? Or by the widget toolkit? 或者通过widget工具包?

What confuses me, is that it is possible to change to "smooth scrolling" in Firefox, which makes it seem like each application handles its scrolling separately. 令我困惑的是,在Firefox中可以更改为“平滑滚动”,这使得每个应用程序看起来像是单独处理它的滚动。 However, when writing software for Linux, you don't really need to specify and it seems like GTK takes care of it on its own. 但是,在为Linux编写软件时,您并不需要指定,而且GTK似乎可以自行处理它。

The reason I'm curious is because I wanted to know if Linux could have it's own "accelerated" scrolling, much like OS X. I know this is possible by app, because Google Picasa has its own built in. 我很好奇的原因是因为我想知道Linux是否可以拥有它自己的“加速”滚动,就像OS X一样。我知道这可以通过app实现,因为Google Picasa有自己的内置功能。

To make this possible for the entire system, does GTK need to be modified? 为了使整个系统成为可能,GTK是否需要修改? Or something else? 或者是其他东西?

  1. Most applications rely on their toolkit for scrolling behaviors. 大多数应用程序依赖于他们的工具包来滚动行为。

  2. Firefox does a lot of stuff by itself, partly because it runs on various platforms with various toolkits (not just GTK), and partly because it has advanced needs that aren't always met by whatever toolkit it happens to be using. Firefox本身做了很多东西,部分原因是它运行在各种工具包(不仅仅是GTK)的各种平台上,部分原因是它具有高级需求,而这些需求并不总是被它碰巧使用的工具包所满足。

  3. GTK is far from the only toolkit used on Linux. GTK远不是Linux上唯一使用的工具包。 There is also Qt (which is used in KDE), wxWidgets, Tk, FLTK, Motif clones, Xt, and you can even build applications on Xlib itself without a toolkit. 还有Qt(在KDE中使用),wxWidgets,Tk,FLTK,Motif克隆,Xt,你甚至可以在没有工具包的情况下在Xlib上构建应用程序。

  4. You're using two different terms, "smooth scrolling" and "accelerated scrolling". 您正在使用两个不同的术语,“平滑滚动”和“加速滚动”。 These are not the same thing, and the latter is technically ambiguous. 这些不是一回事,后者在技术上是模棱两可的。

  5. There is absolutely nothing preventing Linux (really X) applications from having any particular scrolling behavior. 绝对没有什么能阻止Linux(真正的X)应用程序具有任何特定的滚动行为。 It's up to the application and/or its toolkit, if it relies on one. 它取决于应用程序和/或其工具包,如果它依赖于它。

  6. Regardless of the above, keep in mind that not everyone agrees that the scrolling behaviors you allude to are good. 无论如何,请记住,并非所有人都同意您提到的滚动行为是好的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM