如何使用 XIconifyWindow 更改任务栏图标? [英] How can I change the taskbar icon using XIconifyWindow?

查看:46
本文介绍了如何使用 XIconifyWindow 更改任务栏图标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Linux 中编程,我的桌面使用 X11.我想更改任务栏中最小化窗口的图像.

I am programming in Linux and am using X11 for my desktop. I would like to change the images of a minimized window in the task bar.

我正在使用 Fluxbox.

I am using Fluxbox.

当用户单击以最小化窗口时,我目前正在使用 XIconifyWindow.

I am currently using XIconifyWindow when the user clicks to minimize a window.

当用户最小化时,如何控制任务栏中的小方块图标?

How can I control the little square icon in the taskbar when the user minimized it?

谢谢.

感谢您的帮助.我用来最小化的代码如下所示:

Thank you for your help. The code I'm using to minimize looks something like this:

void minWin(Window window, bool yes) const
{
  if(yes)
  {
    XIconifyWindow(display, window, DefaultScreen(display));
  }else{
    XMapWindow(display, window);
  }
}

那么我将如何根据某些属性输入一些代码来设置图标?

So how would I put in some code to set the icon depending on some property?

喜欢

if myProp == "green" set green icon
       else set red icon

推荐答案

use _NET_WM_ICON 顶层窗口属性

use _NET_WM_ICON property of toplevel window

这篇关于如何使用 XIconifyWindow 更改任务栏图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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