桌面集成应用程序(类似于桌面小部件) [英] Desktop integrated application (desktop widget like)

查看:104
本文介绍了桌面集成应用程序(类似于桌面小部件)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在为我的个人系统编写与桌面集成的应用程序的想法,该应用程序的行为应类似于通常的桌面小部件引擎(screenlets,gdesklet,google gadgets).它应该使我从互联网上获得有关我的系统的不同信息的完整概述,并最终将它们可视化在我的桌面上.它应该集中我所有的日常必需信息.

i'm currently playing with the idea writing a desktop-integrated application for my personal system, which should act similar like usual desktop widget engines (screenlets, gdesklets, google gadgets). It should give me a complete overview about different information about my system, from the internet and should finally visualize them on my desktop. It should centralized all my daily necessary information.

最简单的方法肯定是为一种已知的桌面小部件引擎编写我自己的小部件,但是我宁愿从头开始编写它.因此,我目前正在寻找一些实现提示,如何在不使用边框,标题栏和其他由窗口管理器装饰且没有背景色的桌面上构建全局视图.不需要特殊的透明度X%效果,而需要压缩.

The easiest way would be surely to write my own widgets for one of the known desktop widget engines, but i would prefer to write it from the scratch. Therefore i'm currently looking for some implementation hints, how i can build a global view on the desktop that is not decorated with borders, titlebars and something else by the window manager and has no background color. Special transparency X% effects are not necessary, where compiz would be needed.

一个很好的例子是,它具有对绘图的额外libcario支持.我还将选择更大的GUI工具包,例如GTK +或QT.也可以选择直接使用更复杂的X11 API接口.首选的语言是C和C ++.

A good example for that would be conky with additional libcario support for drawing. I would also choose a bigger gui toolkit like GTK+ or QT. Direct Use for the more complex X11 API Interface would be also an option. Preferable languages are C and C++.

如果有人可以分享他的知识,如果他在该领域已经有类似的经验,我将感到很高兴.

I would be glad if someone could share his knowledge if he has already some similar experiences in that field.

推荐答案

有两种方法来构建无边界窗口:(1)完全绕开窗口管理器,以及(2)使用窗口管理器.

There are two ways to build a borderless window: (1) completely bypassing the window-manager, and (2) using the window manager.

第一个很简单,但是有局限性(您必须自己管理例如窗口在虚拟桌面上的拖动和放置).这是通过创建带有override-redirect标志的窗口来完成的.

The first one is simple, but limiting (you'll have to manage e.g. window dragging and placement on virtual desktops yourself). It's done by creating a window with the override-redirect flag.

第二种方法涉及设置称为WM提示的窗口属性(如xprop中所示).如果要使用原始Xlib进行此操作,则需要研究 ICCCM .大多数工具包(例如gtk +)都有用于设置WM提示的API.

The second method involves setting window properties (as in xprop) known as WM hints. If you want to do it with raw Xlib, you need to study ICCCM for that. Most toolkits like gtk+ have APIs for seting WM hints.

对于简单的是或否"透明性",有一个XShape API(从技术上讲,这是扩展,即X11的可选部分,但几乎在任何地方都存在).或者,您也可以创建一个背景设置为None的窗口(但是这种方法在合成窗口管理器(即Compiz)时可能会遇到问题).或者,您可以完全避开应用程序窗口并直接在(虚拟)根窗口上绘制.大概libcairo会让您做同样的事情,但是我对此并不熟悉.

For simple yes-or-no "transparency" there is the XShape API (this is technically an extension, that is, an optional part of X11, but it is present just about everywhere). Or you can just create a window with background set to None (this approach however can have issues with compositing window managers, i.e. Compiz). Or you can just eschew application windows altogether and paint directly on the (virtual) root window. Presumably libcairo would let you do the same, but I'm not familiar with it.

希望这会有所帮助.

这篇关于桌面集成应用程序(类似于桌面小部件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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